MineTweaker3
MineTweaker3 copied to clipboard
Tweaks for MCLiquidStack
- Added
equals()
method in class MCLiquidDefinition to fix a bug where the methodmatches()
in class MCLiquidStack always returns false. - Added
toString()
method in class MCLiquidStack to get a proper String representation
Fix for issue #191
Sorry not getting back on this earlier, I'm so busy these days I don't know where my head is...
Why not just comparing the liquid instances for LiquidDefinition? If the wrapped MC fluid is the same, the two MCLiquidDefinitions would be equivalent.
The MCLiquidDefinition is missing the equals() function, therefore java only compares the references of the two MCLiquidDefinition instances which are two separate instances created in the matches() function of MCLiquidStack. The class MCLiquidDefinition does not compare the wrapped liquid instances. Result is, MCLiquidStack.matches() or MCLiquidStack.contains() will always return false.
MCLiquidDefinition needs the equals function, but it could be implemented by comparing the Fluid instances it holds. I believe each Fluid type has only one instance.