mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +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;
|
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
|
* 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;
|
return this.owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the owner
|
||||||
|
*
|
||||||
|
* @param player
|
||||||
|
*/
|
||||||
|
public void setOwner(final Player player) {
|
||||||
|
this.owner = player.getUniqueId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the plot ID
|
* Get the plot ID
|
||||||
*/
|
*/
|
||||||
@ -204,11 +204,11 @@ public class Plot implements Cloneable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object clone() throws CloneNotSupportedException {
|
public Object clone() throws CloneNotSupportedException {
|
||||||
try {
|
Plot p = (Plot) super.clone();
|
||||||
return super.clone();
|
if (!p.equals(this) || p != this) {
|
||||||
} catch (final CloneNotSupportedException e) {
|
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 null;
|
|
||||||
}
|
}
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user