Fix Block Waypoint

This commit is contained in:
Kam committed 2026-01-23 01:41:57 -05:00
1 parent aa923fae54
commit 9cbd9fd3eb
1 file changed
+8 -2
@@ -41,8 +41,14 @@ public class BlockWaypoint extends BlockContainer {
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack item) {
if (entityliving instanceof EntityPlayer && world.isRemote) {
CustomNpcs.proxy.openGui(i, j, k, EnumGuiType.Waypoint, (EntityPlayer) entityliving);
if (entityliving instanceof EntityPlayer) {
if (!world.isRemote) {
// Server-side: sync TileEntity data to client and open GUI (same as onBlockActivated)
TileEntity tile = world.getTileEntity(i, j, k);
NBTTagCompound compound = new NBTTagCompound();
tile.writeToNBT(compound);
PacketHandler.Instance.sendToPlayer(new GuiWaypointPacket(compound), (EntityPlayerMP) entityliving);
}
}
}