From f9cf54b43a83d1ddd0e4405d6872de95e4ed586f Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Thu, 11 Jan 2024 21:26:30 +0600 Subject: [PATCH] Update PlayerControllerMPMixin.java --- .../client/mixin/mixins/PlayerControllerMPMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/silentclient/client/mixin/mixins/PlayerControllerMPMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/PlayerControllerMPMixin.java index 9d74d0b..86dd05f 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/PlayerControllerMPMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/PlayerControllerMPMixin.java @@ -15,7 +15,7 @@ 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) { + if(itemstack != null && (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; }