Fix missing fields in copy constructor for Island class.

This commit is contained in:
tastybento 2021-04-03 16:33:55 -07:00
parent fb2c9c0553
commit 3e068e4283

View File

@ -236,6 +236,7 @@ public class Island implements DataObject, MetaDataAble {
this.setChanged(); this.setChanged();
} }
/** /**
* Clones an island object * Clones an island object
* @param island - island to clone * @param island - island to clone
@ -256,10 +257,13 @@ public class Island implements DataObject, MetaDataAble {
this.doNotLoad = island.isDoNotLoad(); this.doNotLoad = island.isDoNotLoad();
this.flags.putAll(island.getFlags()); this.flags.putAll(island.getFlags());
this.gameMode = island.getGameMode(); this.gameMode = island.getGameMode();
this.homes = new HashMap<>(island.getHomes());
this.history.addAll(island.getHistory()); this.history.addAll(island.getHistory());
this.levelHandicap = island.getLevelHandicap(); this.levelHandicap = island.getLevelHandicap();
this.location = island.getProtectionCenter(); this.location = island.getProtectionCenter();
this.maxEverProtectionRange = island.getMaxEverProtectionRange(); this.maxEverProtectionRange = island.getMaxEverProtectionRange();
this.maxHomes = island.getMaxHomes();
this.maxMembers = new HashMap<>(island.getMaxMembers());
this.members.putAll(island.getMembers()); this.members.putAll(island.getMembers());
island.getMetaData().ifPresent(m -> { island.getMetaData().ifPresent(m -> {
this.metaData = new HashMap<>(); this.metaData = new HashMap<>();
@ -1516,7 +1520,7 @@ public class Island implements DataObject, MetaDataAble {
this.maxHomes = maxHomes; this.maxHomes = maxHomes;
setChanged(); setChanged();
} }
/** /**
* @return the maxMembers * @return the maxMembers
* @since 1.16.0 * @since 1.16.0