mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-08 08:21:54 +01:00
Added some defensive code in some Island's methods
This commit is contained in:
parent
8da1dc1590
commit
55afa166cd
@ -512,6 +512,10 @@ public class Island implements DataObject {
|
|||||||
* @param owner the island owner - the owner to set
|
* @param owner the island owner - the owner to set
|
||||||
*/
|
*/
|
||||||
public void setOwner(UUID owner){
|
public void setOwner(UUID owner){
|
||||||
|
if (this.owner == owner) {
|
||||||
|
return; //No need to update anything
|
||||||
|
}
|
||||||
|
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
if (owner == null) {
|
if (owner == null) {
|
||||||
return;
|
return;
|
||||||
@ -579,6 +583,10 @@ public class Island implements DataObject {
|
|||||||
* @param isSpawn {@code true} if the island is a spawn, {@code false} otherwise.
|
* @param isSpawn {@code true} if the island is a spawn, {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
public void setSpawn(boolean isSpawn){
|
public void setSpawn(boolean isSpawn){
|
||||||
|
if (spawn == isSpawn) {
|
||||||
|
return; // No need to update anything
|
||||||
|
}
|
||||||
|
|
||||||
spawn = isSpawn;
|
spawn = isSpawn;
|
||||||
if (isSpawn) {
|
if (isSpawn) {
|
||||||
owner = null;
|
owner = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user