mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-10 17:41:52 +01:00
#1671 Fixed lists changing not forcing validation of the elements
This commit is contained in:
parent
648365f336
commit
bd1d852393
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user