mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-09 09:16:34 +00:00
Fix reloading issues
This commit is contained in:
@@ -71,12 +71,17 @@ public class Terra extends GaeaPlugin {
|
||||
private final ConfigRegistry registry = new ConfigRegistry();
|
||||
private final PluginConfig config = new PluginConfig();
|
||||
|
||||
public void invalidate() {
|
||||
public void reload() {
|
||||
Map<World, TerraWorld> newMap = new HashMap<>();
|
||||
worldMap.forEach((world, tw) -> {
|
||||
String packID = tw.getConfig().getTemplate().getID();
|
||||
newMap.put(world, new TerraWorld(world, registry.get(packID)));
|
||||
});
|
||||
worldMap.clear();
|
||||
worlds.clear();
|
||||
registry.clear();
|
||||
worldMap.putAll(newMap);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
TerraChunkGenerator.saveAll();
|
||||
|
||||
Reference in New Issue
Block a user