Skip to content

Commit

Permalink
Fix allay reload
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Oct 29, 2024
1 parent ef1c9c1 commit b4ab88a
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4ab88a

Please sign in to comment.