mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 05:35:44 +01:00
Improved Island#isSpawn() and Island#setSpawn() Javadoc + improved handling of Island#setSpawn() and added logging to the Island history
This commit is contained in:
parent
f75de015a2
commit
185082f261
@ -407,7 +407,8 @@ public class Island implements DataObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return spawn
|
||||
* Returns whether the island is a spawn or not.
|
||||
* @return {@code true} if the island is a spawn, {@code false} otherwise.
|
||||
*/
|
||||
public boolean isSpawn() {
|
||||
return spawn;
|
||||
@ -567,10 +568,21 @@ public class Island implements DataObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isSpawn - if the island is the spawn
|
||||
* Sets whether this island is a spawn or not.
|
||||
* <br/>
|
||||
* If {@code true}, the members and the owner will be removed from this island.
|
||||
* The flags will also be resetted to default values.
|
||||
* @param isSpawn {@code true} if the island is a spawn, {@code false} otherwise.
|
||||
*/
|
||||
public void setSpawn(boolean isSpawn){
|
||||
spawn = isSpawn;
|
||||
if (isSpawn) {
|
||||
owner = null;
|
||||
members.clear();
|
||||
setFlagsDefaults();
|
||||
setFlag(Flags.LOCK, RanksManager.VISITOR_RANK);
|
||||
}
|
||||
log(new LogEntry.Builder("SPAWN").data("value", String.valueOf(isSpawn)).build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user