MineMen fix!

This commit is contained in:
kirillsaint 2024-01-11 21:10:15 +06:00
parent e55d4240e1
commit cd9ad7311a
3 changed files with 123 additions and 94 deletions

View File

@ -1,6 +1,7 @@
package net.silentclient.client.mixin.mixins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.*;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.EntityRenderer;
@ -132,6 +133,8 @@ public abstract class MinecraftMixin implements MinecraftExt {
@Shadow private Timer timer;
@Shadow public EntityPlayerSP thePlayer;
@Inject(method = "displayGuiScreen", at = @At("HEAD"), cancellable = true)
public void displayGuiScreenInject(GuiScreen guiScreenIn, CallbackInfo ci) {
if(guiScreenIn instanceof SilentScreen) {
@ -198,7 +201,7 @@ public abstract class MinecraftMixin implements MinecraftExt {
new EventClickMouse(0).call();
}
@Inject(method = "rightClickMouse", at = @At("HEAD"))
@Inject(method = "rightClickMouse", at = @At("HEAD"), cancellable = true)
public void rightClickMouse(CallbackInfo ci) {
if (AnimationsMod.getSettingBoolean("Punching During Usage") &&
Minecraft.getMinecraft().playerController.getIsHittingBlock() &&
@ -210,6 +213,7 @@ public abstract class MinecraftMixin implements MinecraftExt {
// think we are still breaking the block while right clicking.
// Which is bad. Obviously.
Minecraft.getMinecraft().playerController.resetBlockRemoving();
ci.cancel();
}
}

View File

@ -0,0 +1,24 @@
package net.silentclient.client.mixin.mixins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(PlayerControllerMP.class)
public class PlayerControllerMPMixin {
@Redirect(method = "onPlayerRightClick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/NetHandlerPlayClient;addToSendQueue(Lnet/minecraft/network/Packet;)V"))
public void fixPacketSend(NetHandlerPlayClient instance, Packet p_147297_1_) {
ItemStack itemstack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem();
if(itemstack.getItem() == Items.diamond_sword || itemstack.getItem() == Items.stone_sword || itemstack.getItem() == Items.golden_sword || itemstack.getItem() == Items.iron_sword || itemstack.getItem() == Items.wooden_sword) {
return;
}
instance.addToSendQueue(p_147297_1_);
}
}

View File

@ -3,121 +3,122 @@
"package": "net.silentclient.client.mixin",
"refmap": "mixins.SilentClient.refmap.json",
"mixins": [
"mixins.MinecraftMixin",
"mixins.AbstractClientPlayerMixin",
"mixins.GuiChatMixin",
"accessors.EntityArrowAccessor",
"accessors.FontRendererAccessor",
"accessors.GuiAccessor",
"accessors.GuiInGameAccessor",
"accessors.ItemFoodAccessor",
"accessors.MinecraftAccessor",
"accessors.NetworkPlayerInfoAccessor",
"accessors.RenderItemAccessor",
"accessors.RenderManagerAccessor",
"accessors.ResourcePackRepositoryAccessor",
"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",
"accessors.optifine.ConfigAccessor",
"accessors.optifine.CustomColorsAccessor",
"mixins.AbstractClientPlayerMixin",
"mixins.ArmorStandRendererMixin",
"mixins.BlockFluidRendererMixin",
"mixins.BlockGlassMixin",
"mixins.BlockLiquidMixin",
"mixins.TileEntitySkullRendererMixin",
"accessors.EntityArrowAccessor",
"mixins.BlockModelRendererAmbientOcclusionFaceMixin",
"mixins.BlockPosMixin",
"mixins.BlockRedstoneTorchMixin",
"mixins.BlockRendererDispatcherMixin",
"mixins.C17PacketCustomPayloadMixin",
"mixins.ChunkMixin",
"mixins.ChunkRenderDispatcherMixin",
"mixins.CommandHandlerMixin",
"mixins.EffectRendererMixin",
"mixins.EntityFXMixin",
"mixins.EntityLivingBaseMixin",
"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.EntityPacketsMixin",
"mixins.EntityPlayerMixin",
"mixins.EntityRendererMixin",
"mixins.EntityXPOrbMixin",
"mixins.FontRendererMixin",
"mixins.FramebufferMixin",
"mixins.GameRulesValueMixin",
"mixins.GameSettingsMixin",
"mixins.GlStateManagerMixin",
"mixins.GuiAchievementMixin",
"mixins.GuiChatMixin",
"mixins.GuiContainerMixin",
"mixins.GuiDisconnectedMixin",
"mixins.GuiGameOverMixin",
"mixins.GuiInGameMixin",
"mixins.GuiLanguageMixin",
"mixins.GuiMultiplayerMixin",
"mixins.GuiNewChatMixin",
"mixins.GuiOptionsMixin",
"mixins.GuiPlayerTabOverlayMixin",
"mixins.GuiScreenBookMixin",
"mixins.GuiScreenMixin",
"mixins.GuiScreenOptionsSoundsMixin",
"mixins.GuiScreenResourcePacksMixin",
"mixins.GuiVideoSettingsMixin",
"mixins.InventoryEffectRendererMixin",
"mixins.ItemModelMesherMixin",
"mixins.ItemRendererMixin",
"mixins.ItemStackMixin",
"mixins.LayerArmorBaseMixin",
"mixins.LayerArrowMixin",
"mixins.LayerCapeMixin",
"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.LoadingScreenRendererMixin",
"mixins.MathHelperMixin",
"mixins.GuiLanguageMixin",
"mixins.MinecraftMixin",
"mixins.MinecraftServerMixin",
"mixins.MobSpawnerBaseLogicMixin",
"mixins.ModelBipedMixin",
"mixins.ModelRendererMixin",
"mixins.NBTTagCompoundMixin",
"mixins.NBTTagStringMixin",
"mixins.NetHandlerPlayClientMixin",
"mixins.NetworkManagerMixin",
"mixins.NetworkPlayerInfoMixin",
"mixins.NodeProcessorMixin",
"mixins.PacketThreadUtilMixin",
"mixins.PlayerControllerMPMixin",
"mixins.RenderArrowMixin",
"mixins.RenderFishMixin"
"mixins.RenderEntityItemMixin",
"mixins.RendererLivingEntityMixin",
"mixins.RenderFishMixin",
"mixins.RenderGlobalMixin",
"mixins.RenderItemFrameMixin",
"mixins.RenderItemMixin",
"mixins.RenderManagerMixin",
"mixins.RenderMixin",
"mixins.RenderPlayerMixin",
"mixins.RenderTNTPrimedMixin",
"mixins.ResourcePackRepositoryMixin",
"mixins.S3FPacketCustomPayloadMixin",
"mixins.ScoreboardMixin",
"mixins.ScreenShotHelperMixin",
"mixins.ServerAddressMixin",
"mixins.ServerListEntryNormalMixin",
"mixins.ServerListMixin",
"mixins.ServerSelectionListMixin",
"mixins.ShaderGroupMixin",
"mixins.SoundManagerMixin",
"mixins.TexturedQuadMixin",
"mixins.TextureManagerMixin",
"mixins.TileEntityBannerRendererMixin",
"mixins.TileEntityMobSpawnerRendererMixin",
"mixins.TileEntityRendererDispatcherMixin",
"mixins.TileEntitySkullRendererMixin",
"mixins.VertexBufferMixin",
"mixins.VisGraphMixin",
"mixins.WorldClientMixin",
"mixins.WorldInfoMixin",
"mixins.WorldMixin",
"mixins.WorldRendererMixin"
]
}