#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 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() {
setPVPMode(isPVPEnabled());
setDifficulty(getDifficulty());
setKeepSpawnInMemory(isKeepingSpawnInMemory());
setScaling(getScaling());
setRespawnToWorld(this.props.getRespawnToWorld());
setAllowAnimalSpawn(canAnimalsSpawn());
setAllowMonsterSpawn(canMonstersSpawn());
validateEntitySpawns();
setGameMode(getGameMode());
}
@ -543,6 +551,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null)
return false;
list.clear();
validateEntitySpawns();
return true;
}
@ -558,6 +567,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null)
return false;
list.add(value);
validateEntitySpawns();
return true;
}
@ -573,6 +583,7 @@ public class MVWorld implements MultiverseWorld {
if (list == null)
return false;
list.remove(value);
validateEntitySpawns();
return true;
}