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 ); } 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) 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);