Skip to content

Commit

Permalink
Fix Network Tool not working (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss authored Jan 16, 2024
1 parent 7a6d494 commit ac259dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/appeng/core/sync/packets/PacketClick.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
import appeng.block.networking.BlockCableBus;
import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo;
import appeng.items.tools.ToolNetworkTool;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -97,6 +99,11 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack
if (block instanceof BlockCableBus) {
((BlockCableBus) block).onBlockClickPacket(player.world, pos, player, this.hand, new Vec3d(this.hitX, this.hitY, this.hitZ));
}
} else {
final ItemStack is = player.inventory.getCurrentItem();
if (!is.isEmpty() && is.getItem() instanceof ToolNetworkTool tnt) {
tnt.serverSideToolLogic(is, player, hand, player.world, pos, side, hitX, hitY, hitZ);
}
}
}
}

0 comments on commit ac259dc

Please sign in to comment.