From 1b9a42d3c935a22b6604b6442ed671d79b620209 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sun, 9 Nov 2014 17:02:45 +0100 Subject: [PATCH] Cloning :D --- .../com/intellectualcrafters/plot/Plot.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java index 68cbae5c7..ea388850e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/Plot.java @@ -147,15 +147,6 @@ public class Plot implements Cloneable { return this.owner != null; } - /** - * Set the owner - * - * @param player - */ - public void setOwner(final Player player) { - this.owner = player.getUniqueId(); - } - /** * Check if the player is either the owner or on the helpers list * @@ -183,6 +174,15 @@ public class Plot implements Cloneable { return this.owner; } + /** + * Set the owner + * + * @param player + */ + public void setOwner(final Player player) { + this.owner = player.getUniqueId(); + } + /** * Get the plot ID */ @@ -204,11 +204,11 @@ public class Plot implements Cloneable { */ @Override public Object clone() throws CloneNotSupportedException { - try { - return super.clone(); - } catch (final CloneNotSupportedException e) { - return null; + Plot p = (Plot) super.clone(); + if (!p.equals(this) || p != this) { + return new Plot(id, owner, settings.getBiome(), helpers, trusted, denied, settings.getAlias(), settings.getPosition(), settings.getFlags().toArray(new Flag[settings.getFlags().size()]), getWorld().getName(), settings.getMerged()); } + return p; } /**