This commit is contained in:
kirillsaint 2023-07-02 21:26:30 +06:00
parent dcb8a74264
commit c4ab086685
4 changed files with 24 additions and 14 deletions

View File

@ -12,11 +12,9 @@ import net.silentclient.client.event.EventManager;
import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.EventTarget;
import net.silentclient.client.event.impl.ClientTickEvent; import net.silentclient.client.event.impl.ClientTickEvent;
import net.silentclient.client.event.impl.ConnectToServerEvent; 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.GuiError;
import net.silentclient.client.gui.clickgui.ClickGUI; import net.silentclient.client.gui.clickgui.ClickGUI;
import net.silentclient.client.gui.font.SilentFontRenderer; 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.gui.util.BackgroundPanorama;
import net.silentclient.client.keybinds.KeyBindManager; import net.silentclient.client.keybinds.KeyBindManager;
import net.silentclient.client.mods.ModInstances; import net.silentclient.client.mods.ModInstances;
@ -400,11 +398,6 @@ public class Client {
} }
} }
@EventTarget
public void renderNotification(RenderEvent event) {
NotificationManager.render();
}
@EventTarget @EventTarget
public void onServerConnect(ConnectToServerEvent event) { public void onServerConnect(ConnectToServerEvent event) {
ping = 0; ping = 0;

View File

@ -11,6 +11,7 @@ import net.silentclient.client.Client;
import net.silentclient.client.event.impl.EventRenderDamageTint; import net.silentclient.client.event.impl.EventRenderDamageTint;
import net.silentclient.client.event.impl.RenderEvent; import net.silentclient.client.event.impl.RenderEvent;
import net.silentclient.client.gui.clickgui.utils.GlUtils; 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.BossBarMod;
import net.silentclient.client.mods.hud.ScoreboardMod; import net.silentclient.client.mods.hud.ScoreboardMod;
import net.silentclient.client.mods.render.CrosshairMod; import net.silentclient.client.mods.render.CrosshairMod;
@ -39,6 +40,7 @@ public abstract class GuiInGameMixin extends Gui {
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.disableAlpha(); GlStateManager.disableAlpha();
NotificationManager.render();
} }
@Inject(method = "renderTooltip", at = @At("HEAD")) @Inject(method = "renderTooltip", at = @At("HEAD"))
@ -94,7 +96,7 @@ public abstract class GuiInGameMixin extends Gui {
} }
@Inject(method = "renderVignette", at = @At("HEAD"), cancellable = true) @Inject(method = "renderVignette", at = @At("HEAD"), cancellable = true)
private void patcher$cancelVignette(CallbackInfo ci) { private void silent$cancelVignette(CallbackInfo ci) {
if (HUDCaching.renderingCacheOverride) { if (HUDCaching.renderingCacheOverride) {
ci.cancel(); ci.cancel();
} }

View File

@ -2,6 +2,7 @@ package net.silentclient.client.mixin.mixins;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenBook; import net.minecraft.client.gui.GuiScreenBook;
import net.minecraft.client.renderer.GlStateManager;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
@ -14,6 +15,18 @@ public class GuiScreenBookMixin extends GuiScreen {
super.drawScreen(mouseX, mouseY, partialTicks); 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) @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) { private void silent$cancelFurtherRendering(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
ci.cancel(); ci.cancel();

View File

@ -1,6 +1,7 @@
package net.silentclient.client.utils.types; package net.silentclient.client.utils.types;
import net.silentclient.client.Client; import net.silentclient.client.Client;
import net.silentclient.client.utils.NotificationUtils;
import net.silentclient.client.utils.Players; import net.silentclient.client.utils.Players;
import net.silentclient.client.utils.Requests; import net.silentclient.client.utils.Requests;
import net.silentclient.client.utils.reply.AbstractReply; import net.silentclient.client.utils.reply.AbstractReply;
@ -163,12 +164,13 @@ public class PlayerResponse extends AbstractReply {
this.nametag_message = message; this.nametag_message = message;
Players.reload(); Players.reload();
Players.handleAccount(this); Players.handleAccount(this);
(new Thread("setShowNametagMessage") { String response = Requests.post("https://api.silentclient.net/plus/set_nametag_message", new JSONObject().put("message", message).toString());
public void run() { if(response != null) {
Requests.post("https://api.silentclient.net/plus/set_nametag_message", new JSONObject().put("message", message).toString()); NotificationUtils.showNotification("success", "Nametag Message updated successfully!");
Client.getInstance().updateUserInformation(); } else {
} NotificationUtils.showNotification("error", "");
}).start(); }
Client.getInstance().updateUserInformation();
} }
public String getNametagMessage() { public String getNametagMessage() {