Fix up issues with code

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax
2020-11-06 22:26:57 -05:00
parent a362ed47ce
commit 0c8c0723ef
130 changed files with 1228 additions and 1059 deletions

View File

@@ -23,6 +23,14 @@ public class TerraWorld {
private final WorldConfig worldConfig;
private boolean safe;
public static void loadWorld(WorldConfig w) {
loaded.put(w.getWorldID(), w);
}
public static synchronized TerraWorld getWorld(World w) {
return map.computeIfAbsent(w, TerraWorld::new);
}
private TerraWorld(World w) {
safe = true;
worldConfig = loaded.get(w.getName());
@@ -31,7 +39,7 @@ public class TerraWorld {
for(int i = 0; i < config.biomeList.size(); i++) {
String partName = config.biomeList.get(i);
try {
if(partName.startsWith("BIOME:")) {
if (partName.startsWith("BIOME:")) {
UserDefinedBiome[][] temp = new UserDefinedBiome[1][1];
UserDefinedBiome b = config.getBiomes().get(partName.substring(6)).getBiome();
temp[0][0] = b;
@@ -78,14 +86,6 @@ public class TerraWorld {
grid = new TerraBiomeGrid(w, config.freq1, config.freq2, zone, config, erosion);
}
public static void loadWorld(WorldConfig w) {
loaded.put(w.getWorldID(), w);
}
public static synchronized TerraWorld getWorld(World w) {
return map.computeIfAbsent(w, TerraWorld::new);
}
public static synchronized void invalidate() {
map.clear();
for(WorldConfig config : loaded.values()) {