From b4ab88a02e474083aa92823b804b491045e6939f Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 29 Oct 2024 16:13:29 -0600 Subject: [PATCH] Fix allay reload --- .../com/dfsek/terra/allay/AllayPlatform.java | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/platforms/allay/src/main/java/com/dfsek/terra/allay/AllayPlatform.java b/platforms/allay/src/main/java/com/dfsek/terra/allay/AllayPlatform.java index 335c7ddf4..1cd61ae6e 100644 --- a/platforms/allay/src/main/java/com/dfsek/terra/allay/AllayPlatform.java +++ b/platforms/allay/src/main/java/com/dfsek/terra/allay/AllayPlatform.java @@ -38,27 +38,20 @@ public AllayPlatform() { @Override public boolean reload() { getTerraConfig().load(this); - getRawConfigRegistry().clear(); - try { - getRawConfigRegistry().loadAll(this); - - GENERATOR_WRAPPERS.forEach(wrapper -> { - getConfigRegistry().get(wrapper.getConfigPack().getRegistryKey()).ifPresent(pack -> { - wrapper.setConfigPack(pack); - var dimension = wrapper.getAllayWorldGenerator().getDimension(); - TerraAllayPlugin.INSTANCE.getPluginLogger().info( - "Replaced pack in chunk generator for world {}", - dimension.getWorld().getWorldData().getName() + ":" + dimension.getDimensionInfo().dimensionId() - ); - }); + boolean succeed = loadConfigPacks(); + + GENERATOR_WRAPPERS.forEach(wrapper -> { + getConfigRegistry().get(wrapper.getConfigPack().getRegistryKey()).ifPresent(pack -> { + wrapper.setConfigPack(pack); + var dimension = wrapper.getAllayWorldGenerator().getDimension(); + TerraAllayPlugin.INSTANCE.getPluginLogger().info( + "Replaced pack in chunk generator for world {}", + dimension.getWorld().getWorldData().getName() + ":" + dimension.getDimensionInfo().dimensionId() + ); }); - } catch(Exception e) { - TerraAllayPlugin.INSTANCE.getPluginLogger().error("Failed to reload Terra", e); - return false; - } + }); - - return true; + return succeed; } @Override