This commit is contained in:
kirillsaint 2023-09-20 01:18:24 +06:00
parent 43af05e4f2
commit be98355ab1
4 changed files with 157 additions and 33 deletions

View File

@ -17,9 +17,9 @@ public class C17PacketCustomPayloadMixin {
@Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayServer;)V", at = @At("TAIL"))
private void silent$releaseData(INetHandlerPlayServer handler, CallbackInfo ci) {
if (this.data != null) {
this.data.release();
}
// if (this.data != null) {
// this.data.release();
// }
}
//#endif
}

View File

@ -6,6 +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;
@ -60,8 +64,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();

View File

@ -1,22 +1,30 @@
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.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@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"},
@ -26,20 +34,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
}

View File

@ -3,8 +3,120 @@
"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.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"
]
}