MineTweaker3 icon indicating copy to clipboard operation
MineTweaker3 copied to clipboard

Tweaks for MCLiquidStack

Open Zixxl opened this issue 9 years ago • 3 comments

  • Added equals() method in class MCLiquidDefinition to fix a bug where the method matches() in class MCLiquidStack always returns false.
  • Added toString() method in class MCLiquidStack to get a proper String representation

Fix for issue #191

Zixxl avatar Jun 18 '15 14:06 Zixxl

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.

stanhebben avatar Jul 28 '15 19:07 stanhebben

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.

Zixxl avatar Jul 29 '15 10:07 Zixxl

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.

stanhebben avatar Jul 30 '15 20:07 stanhebben