From 3427381576ee96d9a3f2783e9f36bd7b9a72a226 Mon Sep 17 00:00:00 2001 From: RappyTV Date: Mon, 9 Dec 2024 11:29:37 +0100 Subject: [PATCH 1/3] Fix some error messages not being shown --- api/src/main/java/com/rappytv/globaltags/api/Util.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/rappytv/globaltags/api/Util.java b/api/src/main/java/com/rappytv/globaltags/api/Util.java index 4257b98..5c5a6e6 100644 --- a/api/src/main/java/com/rappytv/globaltags/api/Util.java +++ b/api/src/main/java/com/rappytv/globaltags/api/Util.java @@ -3,6 +3,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.rappytv.globaltags.wrapper.http.ApiHandler.ApiResponse; +import java.util.UUID; import net.labymod.api.Laby; import net.labymod.api.client.component.Component; import net.labymod.api.client.component.format.NamedTextColor; @@ -10,7 +11,6 @@ import net.labymod.api.labyconnect.LabyConnectSession; import net.labymod.api.notification.Notification; import net.labymod.api.notification.Notification.Type; -import java.util.UUID; public class Util { @@ -73,7 +73,7 @@ public static void notify(Component title, Component description) { public static Component getResponseComponent(ApiResponse response) { return Component.text( - response.getData(), + response.isSuccessful() ? response.getData() : response.getError(), response.isSuccessful() ? NamedTextColor.GREEN : NamedTextColor.RED ); } From d804adb4d35323b71513dc68b6bd515911a4a5af Mon Sep 17 00:00:00 2001 From: RappyTV Date: Mon, 9 Dec 2024 11:31:41 +0100 Subject: [PATCH 2/3] Close ban appeal popup after submitting --- .../com/rappytv/globaltags/config/widget/AppealPopup.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/rappytv/globaltags/config/widget/AppealPopup.java b/core/src/main/java/com/rappytv/globaltags/config/widget/AppealPopup.java index 66004c1..65e539c 100644 --- a/core/src/main/java/com/rappytv/globaltags/config/widget/AppealPopup.java +++ b/core/src/main/java/com/rappytv/globaltags/config/widget/AppealPopup.java @@ -39,7 +39,7 @@ public AppealPopup(GlobalTagAPI api) { )) .addId("send-button", "popup-description"); sendButton.setEnabled(false); - sendButton.setActionListener(() -> + sendButton.setActionListener(() -> { this.api.getApiHandler().appealBan(inputWidget.getText(), (response) -> Util.notify( Component.translatable(response.isSuccessful() @@ -48,8 +48,9 @@ public AppealPopup(GlobalTagAPI api) { ), Component.text(response.getData(), NamedTextColor.WHITE) ) - ) - ); + ); + this.close(); + }); inputWidget.updateListener((text) -> sendButton.setEnabled(!text.isBlank())); content.addChild(labelWidget); From 4f36527741b26b488705451913528add7996a6f2 Mon Sep 17 00:00:00 2001 From: RappyTV Date: Mon, 9 Dec 2024 11:32:19 +0100 Subject: [PATCH 3/3] Bump version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c05b4fb..e34095f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";") group = "org.example" -version = providers.environmentVariable("VERSION").getOrElse("1.3.5") +version = providers.environmentVariable("VERSION").getOrElse("1.3.6") labyMod { defaultPackageName = "com.rappytv.globaltags" //change this to your main package name (used by all modules)