From 0bc9cd5fa2170cc2c2eefb29f15e00371149f462 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Thu, 31 Jul 2025 19:59:22 +0100 Subject: [PATCH] fix: don't save if profile deleted --- .../optionsprofiles/gui/EditProfileScreen.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/net/trafficlunar/optionsprofiles/gui/EditProfileScreen.java b/common/src/main/java/net/trafficlunar/optionsprofiles/gui/EditProfileScreen.java index 7cd1557..d2a09e6 100644 --- a/common/src/main/java/net/trafficlunar/optionsprofiles/gui/EditProfileScreen.java +++ b/common/src/main/java/net/trafficlunar/optionsprofiles/gui/EditProfileScreen.java @@ -107,7 +107,7 @@ public class EditProfileScreen extends Screen { .withStyle(ChatFormatting.RED), (button) -> { Profiles.deleteProfile(profileName.getString()); - this.onClose(); + this.onClose(true); }) .width(50) .build(), @@ -122,8 +122,14 @@ public class EditProfileScreen extends Screen { this.layout.arrangeElements(); } + @Override public void onClose() { - this.profileConfiguration.save(); + this.onClose(false); + } + + public void onClose(boolean deleted) { + if (!deleted) + this.profileConfiguration.save(); this.minecraft.setScreen(this.profilesScreen); this.profilesScreen.profilesList.refreshEntries(); }