#1671 Fixed lists changing not forcing validation of the elements

This commit is contained in:
Eric Stokes 2016-03-06 20:59:18 -07:00
parent 648365f336
commit bd1d852393
1 changed files with 13 additions and 2 deletions

View File

@ -185,14 +185,22 @@ public class MVWorld implements MultiverseWorld {
//this.props.validate(); //this.props.validate();
} }
/**
* This method is here to provide a stopgap until the add/remove/clear methods are implemented with
* SerializationConfig.
*/
public void validateEntitySpawns() {
setAllowAnimalSpawn(canAnimalsSpawn());
setAllowMonsterSpawn(canMonstersSpawn());
}
private void validateProperties() { private void validateProperties() {
setPVPMode(isPVPEnabled()); setPVPMode(isPVPEnabled());
setDifficulty(getDifficulty()); setDifficulty(getDifficulty());
setKeepSpawnInMemory(isKeepingSpawnInMemory()); setKeepSpawnInMemory(isKeepingSpawnInMemory());
setScaling(getScaling()); setScaling(getScaling());
setRespawnToWorld(this.props.getRespawnToWorld()); setRespawnToWorld(this.props.getRespawnToWorld());
setAllowAnimalSpawn(canAnimalsSpawn()); validateEntitySpawns();
setAllowMonsterSpawn(canMonstersSpawn());
setGameMode(getGameMode()); setGameMode(getGameMode());
} }
@ -543,6 +551,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null) if (list == null)
return false; return false;
list.clear(); list.clear();
validateEntitySpawns();
return true; return true;
} }
@ -558,6 +567,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null) if (list == null)
return false; return false;
list.add(value); list.add(value);
validateEntitySpawns();
return true; return true;
} }
@ -573,6 +583,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null) if (list == null)
return false; return false;
list.remove(value); list.remove(value);
validateEntitySpawns();
return true; return true;
} }