MineMen fix!

This commit is contained in:
kirillsaint 2024-01-11 21:15:29 +06:00
parent da73dd653b
commit b333bb4384
3 changed files with 120 additions and 94 deletions

View File

@ -198,7 +198,7 @@ public abstract class MinecraftMixin implements MinecraftExt {
new EventClickMouse(0).call(); new EventClickMouse(0).call();
} }
@Inject(method = "rightClickMouse", at = @At("HEAD")) @Inject(method = "rightClickMouse", at = @At("HEAD"), cancellable = true)
public void rightClickMouse(CallbackInfo ci) { public void rightClickMouse(CallbackInfo ci) {
if (AnimationsMod.getSettingBoolean("Punching During Usage") && if (AnimationsMod.getSettingBoolean("Punching During Usage") &&
Minecraft.getMinecraft().playerController.getIsHittingBlock() && Minecraft.getMinecraft().playerController.getIsHittingBlock() &&
@ -210,6 +210,7 @@ public abstract class MinecraftMixin implements MinecraftExt {
// think we are still breaking the block while right clicking. // think we are still breaking the block while right clicking.
// Which is bad. Obviously. // Which is bad. Obviously.
Minecraft.getMinecraft().playerController.resetBlockRemoving(); 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", "package": "net.silentclient.client.mixin",
"refmap": "mixins.SilentClient.refmap.json", "refmap": "mixins.SilentClient.refmap.json",
"mixins": [ "mixins": [
"mixins.MinecraftMixin", "accessors.EntityArrowAccessor",
"mixins.AbstractClientPlayerMixin", "accessors.FontRendererAccessor",
"mixins.GuiChatMixin",
"accessors.GuiAccessor", "accessors.GuiAccessor",
"accessors.GuiInGameAccessor",
"accessors.ItemFoodAccessor",
"accessors.MinecraftAccessor",
"accessors.NetworkPlayerInfoAccessor",
"accessors.RenderItemAccessor", "accessors.RenderItemAccessor",
"accessors.RenderManagerAccessor",
"accessors.ResourcePackRepositoryAccessor",
"accessors.SimpleReloadableResourceManagerAccessor", "accessors.SimpleReloadableResourceManagerAccessor",
"accessors.TextureManagerAccessor", "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", "accessors.WorldRendererAccessor",
"mixins.ModelRendererMixin", "accessors.optifine.ConfigAccessor",
"mixins.BlockRendererDispatcherMixin", "accessors.optifine.CustomColorsAccessor",
"mixins.MobSpawnerBaseLogicMixin", "mixins.AbstractClientPlayerMixin",
"mixins.ChunkRenderDispatcherMixin", "mixins.ArmorStandRendererMixin",
"mixins.LayerArrowMixin", "mixins.BlockFluidRendererMixin",
"mixins.BlockGlassMixin",
"mixins.BlockLiquidMixin", "mixins.BlockLiquidMixin",
"mixins.TileEntitySkullRendererMixin", "mixins.BlockModelRendererAmbientOcclusionFaceMixin",
"accessors.EntityArrowAccessor",
"mixins.BlockPosMixin", "mixins.BlockPosMixin",
"mixins.BlockRedstoneTorchMixin",
"mixins.BlockRendererDispatcherMixin",
"mixins.C17PacketCustomPayloadMixin",
"mixins.ChunkMixin",
"mixins.ChunkRenderDispatcherMixin",
"mixins.CommandHandlerMixin",
"mixins.EffectRendererMixin",
"mixins.EntityFXMixin",
"mixins.EntityLivingBaseMixin",
"mixins.EntityMixin", "mixins.EntityMixin",
"mixins.EntityOtherPlayerMPMixin", "mixins.EntityOtherPlayerMPMixin",
"mixins.GameRulesValueMixin", "mixins.EntityPacketsMixin",
"mixins.MinecraftServerMixin", "mixins.EntityPlayerMixin",
"mixins.NBTTagStringMixin", "mixins.EntityRendererMixin",
"mixins.NodeProcessorMixin",
"mixins.VisGraphMixin",
"mixins.BlockRedstoneTorchMixin",
"mixins.ItemStackMixin",
"mixins.C17PacketCustomPayloadMixin",
"mixins.S3FPacketCustomPayloadMixin",
"mixins.BlockFluidRendererMixin",
"mixins.BlockModelRendererAmbientOcclusionFaceMixin",
"mixins.CommandHandlerMixin",
"mixins.EntityXPOrbMixin", "mixins.EntityXPOrbMixin",
"mixins.FontRendererMixin",
"mixins.FramebufferMixin",
"mixins.GameRulesValueMixin",
"mixins.GameSettingsMixin",
"mixins.GlStateManagerMixin",
"mixins.GuiAchievementMixin",
"mixins.GuiChatMixin",
"mixins.GuiContainerMixin",
"mixins.GuiDisconnectedMixin",
"mixins.GuiGameOverMixin", "mixins.GuiGameOverMixin",
"mixins.GuiInGameMixin",
"mixins.GuiLanguageMixin",
"mixins.GuiMultiplayerMixin",
"mixins.GuiNewChatMixin",
"mixins.GuiOptionsMixin", "mixins.GuiOptionsMixin",
"mixins.GuiPlayerTabOverlayMixin",
"mixins.GuiScreenBookMixin", "mixins.GuiScreenBookMixin",
"mixins.GuiScreenMixin", "mixins.GuiScreenMixin",
"mixins.GuiScreenOptionsSoundsMixin", "mixins.GuiScreenOptionsSoundsMixin",
"mixins.GuiScreenResourcePacksMixin", "mixins.GuiScreenResourcePacksMixin",
"mixins.GuiVideoSettingsMixin", "mixins.GuiVideoSettingsMixin",
"mixins.InventoryEffectRendererMixin",
"mixins.ItemModelMesherMixin",
"mixins.ItemRendererMixin",
"mixins.ItemStackMixin",
"mixins.LayerArmorBaseMixin",
"mixins.LayerArrowMixin",
"mixins.LayerCapeMixin",
"mixins.LayerCreeperChargeMixin", "mixins.LayerCreeperChargeMixin",
"mixins.LayerSpiderEyesMixin", "mixins.LayerSpiderEyesMixin",
"mixins.LayerWitherAuraMixin", "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.LazyLoadBaseMixin",
"mixins.PacketThreadUtilMixin", "mixins.LoadingScreenRendererMixin",
"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.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.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"
] ]
} }