Add ProtectedRegion.copyFrom().

This commit is contained in:
sk89q 2014-08-14 21:22:39 -07:00
parent 76f7ac8d8e
commit 501a7aa77a

View File

@ -462,6 +462,24 @@ public void setFlags(Map<Flag<?>, Object> flags) {
this.flags = new ConcurrentHashMap<Flag<?>, Object>(flags);
}
/**
* Copy attributes from another region.
*
* @param other the other region
*/
public void copyFrom(ProtectedRegion other) {
checkNotNull(other);
setMembers(other.getMembers());
setOwners(other.getOwners());
setFlags(other.getFlags());
setPriority(other.getPriority());
try {
setParent(other.getParent());
} catch (CircularInheritanceException ignore) {
// This should not be thrown
}
}
/**
* Get points of the region projected onto the X-Z plane.
*