Skip to content

Commit

Permalink
Set regen data button to only work when in the main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 10, 2023
1 parent bc57f8c commit 564b74b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ public PFMOptionListWidget(PFMConfigScreen parent, MinecraftClient client) {
PFMRuntimeResources.runAsyncResourceGen();
MinecraftClient.getInstance().reloadResourcesConcurrently();
}));
this.addEntry(new ButtonEntry(Side.SERVER, new TranslatableText("pfm.option.regenData"), new TranslatableText("pfm.config.regen"), new TranslatableText("pfm.option.regenData.tooltip"), button -> {
ButtonEntry entry = new ButtonEntry(Side.SERVER, new TranslatableText("pfm.option.regenData"), new TranslatableText("pfm.config.regen"), new TranslatableText("pfm.option.regenData.tooltip"), button -> {
PFMFileUtil.deleteDir(PFMRuntimeResources.getDataPackDirectory().toFile());
PFMDataGenerator.FROZEN = false;
PFMRuntimeResources.prepareAsyncDataGen(true);
PFMRuntimeResources.runAsyncResourceGen();
}));
});
entry.button.active = !PFMConfigScreen.isOnServer;
this.addEntry(entry);
}

public void save() {
Expand Down

0 comments on commit 564b74b

Please sign in to comment.