Cloning :D

This commit is contained in:
Sauilitired 2014-11-09 17:02:45 +01:00
parent 9309855df2
commit 1b9a42d3c9

View File

@ -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;
}
/**