mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
Fix Block Waypoint
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user