From 43af05e4f286b675b89bc60226aed6f06938198c Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Wed, 20 Sep 2023 01:08:16 +0600 Subject: [PATCH] test --- .../mixins/LoadingScreenRendererMixin.java | 11 +- .../mixins/NetHandlerPlayClientMixin.java | 62 +++++----- src/main/resources/mixins.SilentClient.json | 114 +----------------- 3 files changed, 30 insertions(+), 157 deletions(-) diff --git a/src/main/java/net/silentclient/client/mixin/mixins/LoadingScreenRendererMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/LoadingScreenRendererMixin.java index 22d6f49..d3de571 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/LoadingScreenRendererMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/LoadingScreenRendererMixin.java @@ -6,17 +6,10 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.MinecraftError; -import net.minecraft.util.ResourceLocation; -import net.silentclient.client.Client; -import net.silentclient.client.gui.font.SilentFontRenderer; -import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.mixin.accessors.MinecraftAccessor; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.awt.*; @@ -67,8 +60,8 @@ public class LoadingScreenRendererMixin { Gui.drawRect(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), new Color(19, 19, 19).getRGB()); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.drawCentredImage(new ResourceLocation("silentclient/logos/logo.png"), scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() / 3, 300, 58); - Client.getInstance().getSilentFontRenderer().drawCenteredString((currentlyDisplayedText != "" ? currentlyDisplayedText : "Loading") + "...", scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() - 100, 14, SilentFontRenderer.FontType.TITLE); +// RenderUtil.drawCentredImage(new ResourceLocation("silentclient/logos/logo.png"), scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() / 3, 300, 58); +// Client.getInstance().getSilentFontRenderer().drawCenteredString((currentlyDisplayedText != "" ? currentlyDisplayedText : "Loading") + "...", scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() - 100, 14, SilentFontRenderer.FontType.TITLE); this.mc.updateDisplay(); diff --git a/src/main/java/net/silentclient/client/mixin/mixins/NetHandlerPlayClientMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/NetHandlerPlayClientMixin.java index 45f5d69..1f3719b 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/NetHandlerPlayClientMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/NetHandlerPlayClientMixin.java @@ -1,30 +1,22 @@ package net.silentclient.client.mixin.mixins; -import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.network.NetHandlerPlayClient; -import net.minecraft.network.play.server.S19PacketEntityStatus; -import net.minecraft.network.play.server.S48PacketResourcePackSend; -import net.minecraft.util.IChatComponent; -import net.silentclient.client.event.impl.EntityDamageEvent; -import net.silentclient.client.hooks.NetHandlerPlayClientHook; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.*; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; @Mixin(NetHandlerPlayClient.class) public class NetHandlerPlayClientMixin { - @Shadow private WorldClient clientWorldController; - - @Inject(method = "handleEntityStatus", at = @At("RETURN")) - public void callEntityDamageEvent(S19PacketEntityStatus packetIn, CallbackInfo ci) { - if(packetIn.getOpCode() == 2) { - EntityDamageEvent event = new EntityDamageEvent(packetIn.getEntity(clientWorldController)); - event.call(); - } - } +// @Shadow private WorldClient clientWorldController; +// +// @Inject(method = "handleEntityStatus", at = @At("RETURN")) +// public void callEntityDamageEvent(S19PacketEntityStatus packetIn, CallbackInfo ci) { +// if(packetIn.getOpCode() == 2) { +// EntityDamageEvent event = new EntityDamageEvent(packetIn.getEntity(clientWorldController)); +// event.call(); +// } +// } @ModifyArg( method = {"handleJoinGame", "handleRespawn"}, @@ -34,20 +26,20 @@ public class NetHandlerPlayClientMixin { return null; } - //#if MC==10809 - @Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true) - private void silent$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) { - if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) { - ci.cancel(); - } - } - @Redirect( - method = "handleUpdateSign", - slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)), - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0) - ) - private void silent$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) { - // No-op - } - //#endif +// //#if MC==10809 +// @Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true) +// private void silent$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) { +// if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) { +// ci.cancel(); +// } +// } +// @Redirect( +// method = "handleUpdateSign", +// slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)), +// at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0) +// ) +// private void silent$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) { +// // No-op +// } +// //#endif } diff --git a/src/main/resources/mixins.SilentClient.json b/src/main/resources/mixins.SilentClient.json index 1bab5a4..8897702 100644 --- a/src/main/resources/mixins.SilentClient.json +++ b/src/main/resources/mixins.SilentClient.json @@ -3,120 +3,8 @@ "package": "net.silentclient.client.mixin", "refmap": "mixins.SilentClient.refmap.json", "mixins": [ - "mixins.MinecraftMixin", - "mixins.AbstractClientPlayerMixin", - "mixins.GuiChatMixin", - "accessors.GuiAccessor", - "accessors.RenderItemAccessor", - "accessors.SimpleReloadableResourceManagerAccessor", - "accessors.TextureManagerAccessor", - "mixins.EntityRendererMixin", - "mixins.RenderEntityItemMixin", - "mixins.RenderItemFrameMixin", - "mixins.TileEntityMobSpawnerRendererMixin", - "mixins.EntityFXMixin", - "mixins.EffectRendererMixin", - "accessors.RenderManagerAccessor", - "mixins.RenderPlayerMixin", - "mixins.GuiInGameMixin", - "mixins.LayerCapeMixin", - "mixins.GuiAchievementMixin", - "mixins.GuiMultiplayerMixin", - "mixins.GameSettingsMixin", - "mixins.EntityPlayerMixin", "mixins.NetHandlerPlayClientMixin", - "mixins.WorldMixin", - "mixins.RendererLivingEntityMixin", - "mixins.WorldClientMixin", - "mixins.NetworkManagerMixin", - "mixins.RenderManagerMixin", - "mixins.ItemRendererMixin", - "mixins.RenderGlobalMixin", - "mixins.LayerArmorBaseMixin", - "mixins.RenderItemMixin", - "mixins.ModelBipedMixin", "mixins.LoadingScreenRendererMixin", - "accessors.MinecraftAccessor", - "accessors.ItemFoodAccessor", - "mixins.BlockGlassMixin", - "mixins.ShaderGroupMixin", - "mixins.GuiContainerMixin", - "mixins.InventoryEffectRendererMixin", - "mixins.TextureManagerMixin", - "mixins.ChunkMixin", - "mixins.ArmorStandRendererMixin", - "mixins.RenderMixin", - "accessors.FontRendererAccessor", - "mixins.FontRendererMixin", - "mixins.WorldInfoMixin", - "mixins.GuiPlayerTabOverlayMixin", - "mixins.GuiNewChatMixin", - "mixins.FramebufferMixin", - "mixins.GlStateManagerMixin", - "accessors.GuiInGameAccessor", - "mixins.TexturedQuadMixin", - "accessors.WorldRendererAccessor", - "mixins.ModelRendererMixin", - "mixins.BlockRendererDispatcherMixin", - "mixins.MobSpawnerBaseLogicMixin", - "mixins.ChunkRenderDispatcherMixin", - "mixins.LayerArrowMixin", - "mixins.BlockLiquidMixin", - "mixins.TileEntitySkullRendererMixin", - "accessors.EntityArrowAccessor", - "mixins.BlockPosMixin", - "mixins.EntityMixin", - "mixins.EntityOtherPlayerMPMixin", - "mixins.GameRulesValueMixin", - "mixins.MinecraftServerMixin", - "mixins.NBTTagStringMixin", - "mixins.NodeProcessorMixin", - "mixins.VisGraphMixin", - "mixins.BlockRedstoneTorchMixin", - "mixins.ItemStackMixin", - "mixins.C17PacketCustomPayloadMixin", - "mixins.S3FPacketCustomPayloadMixin", - "mixins.BlockFluidRendererMixin", - "mixins.BlockModelRendererAmbientOcclusionFaceMixin", - "mixins.CommandHandlerMixin", - "mixins.EntityXPOrbMixin", - "mixins.GuiGameOverMixin", - "mixins.GuiOptionsMixin", - "mixins.GuiScreenBookMixin", - "mixins.GuiScreenMixin", - "mixins.GuiScreenOptionsSoundsMixin", - "mixins.GuiScreenResourcePacksMixin", - "mixins.GuiVideoSettingsMixin", - "mixins.LayerCreeperChargeMixin", - "mixins.LayerSpiderEyesMixin", - "mixins.LayerWitherAuraMixin", - "mixins.ScoreboardMixin", - "mixins.SoundManagerMixin", - "mixins.TileEntityBannerRendererMixin", - "mixins.TileEntityRendererDispatcherMixin", - "mixins.VertexBufferMixin", - "mixins.ItemModelMesherMixin", - "mixins.EntityLivingBaseMixin", - "mixins.NBTTagCompoundMixin", - "mixins.ServerListEntryNormalMixin", - "mixins.ServerSelectionListMixin", - "mixins.WorldRendererMixin", - "mixins.ResourcePackRepositoryMixin", - "accessors.ResourcePackRepositoryAccessor", - "mixins.LazyLoadBaseMixin", - "mixins.PacketThreadUtilMixin", - "mixins.ServerAddressMixin", - "mixins.ServerListMixin", - "mixins.EntityPacketsMixin", - "mixins.ScreenShotHelperMixin", - "mixins.RenderTNTPrimedMixin", - "mixins.GuiDisconnectedMixin", - "accessors.optifine.CustomColorsAccessor", - "accessors.optifine.ConfigAccessor", - "mixins.NetworkPlayerInfoMixin", - "accessors.NetworkPlayerInfoAccessor", - "mixins.MathHelperMixin", - "mixins.GuiLanguageMixin", - "mixins.RenderArrowMixin" + "accessors.MinecraftAccessor" ] } \ No newline at end of file