mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-09-30 16:17:27 +02:00
Basic implementation of the spawn in memory setting.
This commit is contained in:
parent
01b016f002
commit
6e1cff5d26
@ -74,6 +74,8 @@ public class MVWorld {
|
||||
private boolean allowAnimals; // Does this World allow Animals to Spawn?
|
||||
private boolean allowMonsters; // Does this World allow Monsters to Spawn?
|
||||
|
||||
private boolean keepSpawnInMemory; // Does the World have the spawn loaded all the time?
|
||||
|
||||
private Boolean pvp; // Does this World allow PVP?
|
||||
private Boolean fakepvp; // Should this world have fakePVP on? (used for PVP zones)
|
||||
|
||||
@ -131,6 +133,8 @@ public class MVWorld {
|
||||
this.setCurrency(config.getInt("worlds." + this.name + ".entryfee.currency", -1));
|
||||
this.getMobExceptions();
|
||||
|
||||
this.setSpawnInMemory(config.getBoolean("worlds." + this.name + ".keepspawninmemory", true));
|
||||
|
||||
this.getWorldBlacklist().addAll(config.getStringList("worlds." + this.name + ".worldblacklist", new ArrayList<String>()));
|
||||
this.getBlockBlacklist().addAll(config.getIntList("worlds." + this.name + ".blockblacklist", new ArrayList<Integer>()));
|
||||
this.translateTempSpawn(config);
|
||||
@ -338,16 +342,24 @@ public class MVWorld {
|
||||
if (name.equalsIgnoreCase("pvp")) {
|
||||
this.setPvp(value);
|
||||
} else if (name.equalsIgnoreCase("animals")) {
|
||||
|
||||
this.setAnimals(value);
|
||||
} else if (name.equalsIgnoreCase("monsters")) {
|
||||
this.setMonsters(value);
|
||||
} else if (name.equalsIgnoreCase("memory") || name.equalsIgnoreCase("spawnmemory")) {
|
||||
this.setSpawnInMemory(value);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setSpawnInMemory(boolean value) {
|
||||
this.world.setKeepSpawnInMemory(value);
|
||||
this.keepSpawnInMemory = value;
|
||||
this.config.setProperty("worlds." + this.name + ".keepspawninmemory", value);
|
||||
saveConfig();
|
||||
}
|
||||
|
||||
private boolean setVariable(String name, double value) {
|
||||
if (name.equalsIgnoreCase("scaling") || name.equalsIgnoreCase("scale")) {
|
||||
this.setScaling(value);
|
||||
|
@ -21,7 +21,7 @@ enum Action {
|
||||
|
||||
// Color == Aliascolor
|
||||
enum SetProperties {
|
||||
alias, animals, monsters, pvp, scaling, aliascolor, color, respawn, currency, curr, price, scale
|
||||
alias, animals, monsters, pvp, scaling, aliascolor, color, respawn, currency, curr, price, scale, spawnmemory, memory
|
||||
}
|
||||
|
||||
public class ModifyCommand extends MultiverseCommand {
|
||||
|
Loading…
Reference in New Issue
Block a user