remove usages of TerraWorld#getConfig

This commit is contained in:
dfsek
2021-07-22 13:59:39 -07:00
parent a56d1818c8
commit 8898bbd5c4
17 changed files with 23 additions and 70 deletions

View File

@@ -100,8 +100,8 @@ public class TerraBukkitPlugin extends JavaPlugin implements TerraPlugin {
boolean succeed = registry.loadAll(this);
Map<World, TerraWorld> newMap = new HashMap<>();
worldMap.forEach((world, tw) -> {
tw.getConfig().getSamplerCache().clear();
String packID = tw.getConfig().getID();
world.getConfig().getSamplerCache().clear();
String packID = world.getConfig().getID();
newMap.put(world, new TerraWorldImpl(world, registry.get(packID), this));
});
worldMap.clear();

View File

@@ -43,8 +43,7 @@ public class CommonListener implements Listener {
if(e.isCancelled()) return;
World bukkit = BukkitAdapter.adapt(e.getWorld());
if(!bukkit.isTerraWorld()) return;
TerraWorld tw = main.getWorld(bukkit);
WorldConfig c = tw.getConfig();
WorldConfig c = bukkit.getConfig();
if(c.isDisableSaplings()) return;
e.setCancelled(true);
Block block = e.getLocation().getBlock();