Metal Chests

Metal Chests

3M Downloads

[1.12.2 v6.1.0] ALL upgrades work on wooden chests

thephoenixlodge opened this issue ยท 2 comments

commented

Problem Details

As per the title, using ANY upgrade on a wooden chest will upgrade it, even if the chest isn't a "wood to ___" upgrade. E.g., a Gold to Diamond upgrade will work on a wooden chest upgrading it to Diamond, potentially allowing significant resource savings if the player does it with the highest tier single level upgrade. Other tiers are correctly only accepting upgrades meant for them (E.g Iron chest will not accept a Gold to ____ upgrade).

Environment

commented

can confirm this is reporduced in my personal modpack with no config changes

commented

The problem is in the items/ItemChestUpgrade.java class. It is missing the null check to verify that the base upgrade is for a wooden/vanilla chest on lines 63 and 71 (I'm unsure what the EnderChest section is intended for, as there don't appear to be any upgrades that target it, but left the change there for completeness. The change on line 63 is the important one). Because the codebase appears to be in a state of flux for a complete re-write from scratch, I can't easily submit a PR with this change, but below are what the lines should read:

if (vanillaChest.lidAngle > 0 || base != null)
...
if (enderChest.lidAngle > 0 || base != null)