From 255778b388e8818af53b5f8b02bfffbf0b731f85 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Fri, 7 Oct 2011 11:48:14 +0200 Subject: [PATCH] Fix CraftBlock.equals as they are not singletons anymore --- src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 5d4e51f05a..54e244c8f0 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) {