Since instanceofis used to compare GUI classes in a few places in an inconsistent manner, I am led to believe that this was made in error, and the intention was to use instanceof everywhere. This PR changes all GUI class comparisons to use instanceof unless this would cause an issue.
With this change, Aether's button now shows up in the modded inventory GUIs of both of the aforementioned mods, but in the wrong position.
To solve this, the button placement equation is changed to be consistent with how Baubles places its button. This should improve compatibility, since the Baubles button is what most mods are tested with, and can thus be considered the standard.
With this additional change, the Aether button now appears in the right position.
I agree to the Contributor License Agreement found in CONTRIBUTING.md.
See https://github.com/gildedgames/aether-issues/issues/742.
In many places, the classes of GUI objects are directly compared with vanilla ones. These checks fail with subclasses of these classes introduced by mods, resulting in Aether's buttons not showing up in these GUIs. This happens in InfiniteInvo and Satchels, which replace
GuiInventory
with their own subclass. Even if these modded GUIs added the Aether button to their button lists manually, the buttons don't do anything when clicked because they fail the check inonButtonPressed()
: https://github.com/Gilded-Games/The-Aether-Archived/blob/63e9a73e80a990c5ae654c925d29b0062f4c22b5/src/main/java/com/gildedgames/the_aether/client/AetherClientEvents.java#L384Since
instanceof
is used to compare GUI classes in a few places in an inconsistent manner, I am led to believe that this was made in error, and the intention was to useinstanceof
everywhere. This PR changes all GUI class comparisons to useinstanceof
unless this would cause an issue.With this change, Aether's button now shows up in the modded inventory GUIs of both of the aforementioned mods, but in the wrong position.
To solve this, the button placement equation is changed to be consistent with how Baubles places its button. This should improve compatibility, since the Baubles button is what most mods are tested with, and can thus be considered the standard.
With this additional change, the Aether button now appears in the right position.
I agree to the Contributor License Agreement found in CONTRIBUTING.md.