Skip to content

Commit

Permalink
fix allay
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Oct 25, 2024
1 parent 2a40f4a commit d91e531
Showing 1 changed file with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,26 @@ public AllayPlatform() {
public boolean reload() {
getTerraConfig().load(this);
getRawConfigRegistry().clear();
boolean succeed = 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()
);
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()
);
});
});
});
return succeed;
} catch(Exception e) {
TerraAllayPlugin.INSTANCE.getPluginLogger().error("Failed to reload Terra", e);
return false;
}


return true;
}

@Override
Expand Down

0 comments on commit d91e531

Please sign in to comment.