This commit is contained in:
kirillsaint 2023-09-20 01:08:16 +06:00
parent cfa86cd8ce
commit 43af05e4f2
3 changed files with 30 additions and 157 deletions

View File

@ -6,17 +6,10 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.MinecraftError; 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 net.silentclient.client.mixin.accessors.MinecraftAccessor;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow; 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.*; import java.awt.*;
@ -67,8 +60,8 @@ public class LoadingScreenRendererMixin {
Gui.drawRect(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), new Color(19, 19, 19).getRGB()); Gui.drawRect(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), new Color(19, 19, 19).getRGB());
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); 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); // 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); // Client.getInstance().getSilentFontRenderer().drawCenteredString((currentlyDisplayedText != "" ? currentlyDisplayedText : "Loading") + "...", scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() - 100, 14, SilentFontRenderer.FontType.TITLE);
this.mc.updateDisplay(); this.mc.updateDisplay();

View File

@ -1,30 +1,22 @@
package net.silentclient.client.mixin.mixins; package net.silentclient.client.mixin.mixins;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient; 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.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.*; import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(NetHandlerPlayClient.class) @Mixin(NetHandlerPlayClient.class)
public class NetHandlerPlayClientMixin { public class NetHandlerPlayClientMixin {
@Shadow private WorldClient clientWorldController; // @Shadow private WorldClient clientWorldController;
//
@Inject(method = "handleEntityStatus", at = @At("RETURN")) // @Inject(method = "handleEntityStatus", at = @At("RETURN"))
public void callEntityDamageEvent(S19PacketEntityStatus packetIn, CallbackInfo ci) { // public void callEntityDamageEvent(S19PacketEntityStatus packetIn, CallbackInfo ci) {
if(packetIn.getOpCode() == 2) { // if(packetIn.getOpCode() == 2) {
EntityDamageEvent event = new EntityDamageEvent(packetIn.getEntity(clientWorldController)); // EntityDamageEvent event = new EntityDamageEvent(packetIn.getEntity(clientWorldController));
event.call(); // event.call();
} // }
} // }
@ModifyArg( @ModifyArg(
method = {"handleJoinGame", "handleRespawn"}, method = {"handleJoinGame", "handleRespawn"},
@ -34,20 +26,20 @@ public class NetHandlerPlayClientMixin {
return null; return null;
} }
//#if MC==10809 // //#if MC==10809
@Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true) // @Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true)
private void silent$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) { // private void silent$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) {
if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) { // if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) {
ci.cancel(); // ci.cancel();
} // }
} // }
@Redirect( // @Redirect(
method = "handleUpdateSign", // method = "handleUpdateSign",
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)), // 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) // 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) { // private void silent$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) {
// No-op // // No-op
} // }
//#endif // //#endif
} }

View File

@ -3,120 +3,8 @@
"package": "net.silentclient.client.mixin", "package": "net.silentclient.client.mixin",
"refmap": "mixins.SilentClient.refmap.json", "refmap": "mixins.SilentClient.refmap.json",
"mixins": [ "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.NetHandlerPlayClientMixin",
"mixins.WorldMixin",
"mixins.RendererLivingEntityMixin",
"mixins.WorldClientMixin",
"mixins.NetworkManagerMixin",
"mixins.RenderManagerMixin",
"mixins.ItemRendererMixin",
"mixins.RenderGlobalMixin",
"mixins.LayerArmorBaseMixin",
"mixins.RenderItemMixin",
"mixins.ModelBipedMixin",
"mixins.LoadingScreenRendererMixin", "mixins.LoadingScreenRendererMixin",
"accessors.MinecraftAccessor", "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"
] ]
} }