diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-10-07 11:48:14 +0200 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-10-07 11:48:14 +0200 |
commit | 255778b388e8818af53b5f8b02bfffbf0b731f85 (patch) | |
tree | cb3c1bf546054a898f78a0f3cd02be1c93143ed8 | |
parent | d39c363e5cc95af3da86586ede877e19a45084eb (diff) | |
download | craftbukkit-255778b388e8818af53b5f8b02bfffbf0b731f85.tar craftbukkit-255778b388e8818af53b5f8b02bfffbf0b731f85.tar.gz craftbukkit-255778b388e8818af53b5f8b02bfffbf0b731f85.tar.lz craftbukkit-255778b388e8818af53b5f8b02bfffbf0b731f85.tar.xz craftbukkit-255778b388e8818af53b5f8b02bfffbf0b731f85.zip |
Fix CraftBlock.equals as they are not singletons anymore
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 5d4e51f0..54e244c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -267,7 +267,11 @@ public class CraftBlock implements Block { @Override public boolean equals(Object o) { - return this == o; + if (o == this) return true; + if (!(o instanceof CraftBlock)) return false; + CraftBlock other = (CraftBlock) o; + + return this.x == other.x && this.y == other.y && this.z == other.z && this.getWorld().equals(other.getWorld()); } public boolean isBlockFacePowered(BlockFace face) { |