mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-04 18:02:36 +01:00
Moving stuff into their gitters and setters
Pun intended.
This commit is contained in:
parent
028b910e9a
commit
0a88c086f4
@ -69,11 +69,7 @@ public class MVWorld {
|
||||
this.setAlias(config.getString("worlds." + this.name + ".alias", ""));
|
||||
this.setPvp(config.getBoolean("worlds." + this.name + ".pvp", true));
|
||||
this.setScaling(config.getDouble("worlds." + this.name + ".scale", 1.0));
|
||||
if (this.scaling <= 0) {
|
||||
// Disallow negative or 0 scalings.
|
||||
config.setProperty("worlds." + this.name + ".scale", 1.0);
|
||||
this.scaling = 1.0;
|
||||
}
|
||||
|
||||
this.setAnimals(config.getBoolean("worlds." + this.name + ".animals.spawn", true));
|
||||
this.setMonsters(config.getBoolean("worlds." + this.name + ".monsters.spawn", true));
|
||||
this.getMobExceptions();
|
||||
@ -162,11 +158,11 @@ public class MVWorld {
|
||||
try {
|
||||
boolean boolValue = Boolean.parseBoolean(value);
|
||||
if (name.equalsIgnoreCase("pvp")) {
|
||||
this.pvp = boolValue;
|
||||
this.setPvp(boolValue);
|
||||
} else if (name.equalsIgnoreCase("animals")) {
|
||||
this.animals = boolValue;
|
||||
this.setAnimals(boolValue);
|
||||
} else if (name.equalsIgnoreCase("monsters")) {
|
||||
this.monsters = boolValue;
|
||||
this.setMonsters(boolValue);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -178,7 +174,7 @@ public class MVWorld {
|
||||
try {
|
||||
double doubleValue = Double.parseDouble(value);
|
||||
if (name.equalsIgnoreCase("scaling")) {
|
||||
this.scaling = doubleValue;
|
||||
this.setScaling(doubleValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -304,6 +300,10 @@ public class MVWorld {
|
||||
}
|
||||
|
||||
public void setScaling(Double scaling) {
|
||||
if (scaling <= 0) {
|
||||
// Disallow negative or 0 scalings.
|
||||
scaling = 1.0;
|
||||
}
|
||||
this.scaling = scaling;
|
||||
this.config.setProperty("worlds." + this.name + ".scaling", scaling);
|
||||
this.config.save();
|
||||
|
Loading…
Reference in New Issue
Block a user