[1.12.2 v6.1.0] ALL upgrades work on wooden chests
thephoenixlodge opened this issue ยท 2 comments
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
- OS: Windows 10
- Minecraft: 1.12.2
- Full Forge version: 14.23.5.2854
- Mod version: v6.1.0
- Modpack: Heavens of Sorcery
- Initial bug report and discussion: thephoenixlodge/Heavens-of-Sorcery#96
- Customised config file: https://github.com/thephoenixlodge/Heavens-of-Sorcery/blob/master/config/T145/MetalChests.cfg
- Customised JSON config: https://github.com/thephoenixlodge/Heavens-of-Sorcery/blob/master/config/T145/MetalChests.json
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)