properly implement equals, sod off Player.

This commit is contained in:
Lex Manos 2014-03-10 23:27:30 -07:00
parent d97ec2763c
commit 1a9e13f880

View file

@ -57,7 +57,14 @@ public abstract class FluidContainerRegistry
@Override
public boolean equals(Object o)
{
return o != null && o.hashCode() == hashCode();
if (!(o instanceof ContainerKey)) return false;
ContainerKey ck = (ContainerKey)o;
if (container.getItem() != ck.container.getItem()) return false;
if (container.getItemDamage() != ck.container.getItemDamage()) return false;
if (fluid == null && ck.fluid != null) return false;
if (fluid != null && ck.fluid == null) return false;
if (fluid.fluidID != ck.fluid.fluidID) return false;
return true;
}
}