From 564b74bd6114968a3313d61b31912efa92ba2188 Mon Sep 17 00:00:00 2001 From: UnlikePaladin <36827970+UnlikePaladin@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:32:48 -0600 Subject: [PATCH] Set regen data button to only work when in the main menu --- .../pfm/client/screens/widget/PFMOptionListWidget.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/unlikepaladin/pfm/client/screens/widget/PFMOptionListWidget.java b/common/src/main/java/com/unlikepaladin/pfm/client/screens/widget/PFMOptionListWidget.java index e9f976182..58ba09649 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/client/screens/widget/PFMOptionListWidget.java +++ b/common/src/main/java/com/unlikepaladin/pfm/client/screens/widget/PFMOptionListWidget.java @@ -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() {