diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index 1b5d943..516d5d7 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -12,11 +12,9 @@ import net.silentclient.client.event.EventManager; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.ClientTickEvent; import net.silentclient.client.event.impl.ConnectToServerEvent; -import net.silentclient.client.event.impl.RenderEvent; import net.silentclient.client.gui.GuiError; import net.silentclient.client.gui.clickgui.ClickGUI; import net.silentclient.client.gui.font.SilentFontRenderer; -import net.silentclient.client.gui.notification.NotificationManager; import net.silentclient.client.gui.util.BackgroundPanorama; import net.silentclient.client.keybinds.KeyBindManager; import net.silentclient.client.mods.ModInstances; @@ -400,11 +398,6 @@ public class Client { } } - @EventTarget - public void renderNotification(RenderEvent event) { - NotificationManager.render(); - } - @EventTarget public void onServerConnect(ConnectToServerEvent event) { ping = 0; diff --git a/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java index 683bdc0..a9274b6 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/GuiInGameMixin.java @@ -11,6 +11,7 @@ import net.silentclient.client.Client; import net.silentclient.client.event.impl.EventRenderDamageTint; import net.silentclient.client.event.impl.RenderEvent; import net.silentclient.client.gui.clickgui.utils.GlUtils; +import net.silentclient.client.gui.notification.NotificationManager; import net.silentclient.client.mods.hud.BossBarMod; import net.silentclient.client.mods.hud.ScoreboardMod; import net.silentclient.client.mods.render.CrosshairMod; @@ -39,6 +40,7 @@ public abstract class GuiInGameMixin extends Gui { GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GlStateManager.disableAlpha(); + NotificationManager.render(); } @Inject(method = "renderTooltip", at = @At("HEAD")) @@ -94,7 +96,7 @@ public abstract class GuiInGameMixin extends Gui { } @Inject(method = "renderVignette", at = @At("HEAD"), cancellable = true) - private void patcher$cancelVignette(CallbackInfo ci) { + private void silent$cancelVignette(CallbackInfo ci) { if (HUDCaching.renderingCacheOverride) { ci.cancel(); } diff --git a/src/main/java/net/silentclient/client/mixin/mixins/GuiScreenBookMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/GuiScreenBookMixin.java index d012efe..61423bf 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/GuiScreenBookMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/GuiScreenBookMixin.java @@ -2,6 +2,7 @@ package net.silentclient.client.mixin.mixins; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreenBook; +import net.minecraft.client.renderer.GlStateManager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -14,6 +15,18 @@ public class GuiScreenBookMixin extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); } + @Inject(method = "drawScreen", at = @At(value = "HEAD")) + private void silent$fix1(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { + GlStateManager.enableBlend(); + GlStateManager.enableAlpha(); + } + + @Inject(method = "drawScreen", at = @At(value = "TAIL")) + private void silent$fix2(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + @Inject(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreenBook;handleComponentHover(Lnet/minecraft/util/IChatComponent;II)V", shift = At.Shift.AFTER), cancellable = true) private void silent$cancelFurtherRendering(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { ci.cancel(); diff --git a/src/main/java/net/silentclient/client/utils/types/PlayerResponse.java b/src/main/java/net/silentclient/client/utils/types/PlayerResponse.java index 9fc3052..6f99ce2 100644 --- a/src/main/java/net/silentclient/client/utils/types/PlayerResponse.java +++ b/src/main/java/net/silentclient/client/utils/types/PlayerResponse.java @@ -1,6 +1,7 @@ package net.silentclient.client.utils.types; import net.silentclient.client.Client; +import net.silentclient.client.utils.NotificationUtils; import net.silentclient.client.utils.Players; import net.silentclient.client.utils.Requests; import net.silentclient.client.utils.reply.AbstractReply; @@ -163,12 +164,13 @@ public class PlayerResponse extends AbstractReply { this.nametag_message = message; Players.reload(); Players.handleAccount(this); - (new Thread("setShowNametagMessage") { - public void run() { - Requests.post("https://api.silentclient.net/plus/set_nametag_message", new JSONObject().put("message", message).toString()); - Client.getInstance().updateUserInformation(); - } - }).start(); + String response = Requests.post("https://api.silentclient.net/plus/set_nametag_message", new JSONObject().put("message", message).toString()); + if(response != null) { + NotificationUtils.showNotification("success", "Nametag Message updated successfully!"); + } else { + NotificationUtils.showNotification("error", ""); + } + Client.getInstance().updateUserInformation(); } public String getNametagMessage() {