Merge pull request #94 from Silent-Client/PREMIUM2

Update PlayerControllerMPMixin.java
This commit is contained in:
kirillsaint 2024-01-11 21:26:48 +06:00 committed by GitHub
commit 43c9a4925e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")) @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_) { public void fixPacketSend(NetHandlerPlayClient instance, Packet p_147297_1_) {
ItemStack itemstack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(); 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; return;
} }