diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java index ea388850e..180c09103 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java @@ -22,6 +22,7 @@ package com.intellectualcrafters.plot; import com.intellectualcrafters.plot.database.DBFunc; + import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.block.Biome; @@ -285,6 +286,21 @@ public class Plot implements Cloneable { public void clear(final Player plr) { PlotHelper.clear(plr, this); } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Plot other = (Plot) obj; + return ((this.id.x.equals(other.id.x)) && (this.id.y.equals(other.id.y)) && (this.world.equals(other.world))); + } /** * Get the plot hashcode diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotId.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotId.java index 807fd129d..a1ecbee54 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotId.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotId.java @@ -75,7 +75,7 @@ public class PlotId { return false; } final PlotId other = (PlotId) obj; - return ((this.x == other.x) && (this.y == other.y)); + return ((this.x.equals(other.x)) && (this.y.equals(other.y))); } @Override