mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Cloning :D
This commit is contained in:
parent
9309855df2
commit
1b9a42d3c9
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user