Пример #1
0
 public static void syncCurrentItemNBT(World world, EntityPlayer player) {
   if (!world.isRemote) {
     ModLoader.serverSendPacket(
         ((EntityPlayerMP) player).playerNetServerHandler,
         PacketHandler.createSyncItemNBTPacket(player, player.inventory.currentItem));
   } else {
     ModLoader.clientSendPacket(
         PacketHandler.createSyncItemNBTPacket(player, player.inventory.currentItem));
   }
 }
Пример #2
0
 @Override
 public void onGuiClosed() {
   super.onGuiClosed();
   IFI_ServerFigure isf = mod_IFI_Figure.getServerFigure(targetFigure);
   byte ldata[];
   if (isf != null) {
     isf.setRotation(targetFigure);
     ldata = new byte[17 + targetFigure.mobString.length()];
     MMM_Helper.setStr(ldata, 17, targetFigure.mobString);
   } else {
     ldata = new byte[17];
   }
   // 設定されたEntityに適合するパケットセンダーを実行
   ldata[0] = IFI_Server_SpawnFigure;
   MMM_Helper.setFloat(ldata, 1, (float) targetFigure.posX);
   MMM_Helper.setFloat(ldata, 5, (float) targetFigure.posY);
   MMM_Helper.setFloat(ldata, 9, (float) targetFigure.posZ);
   MMM_Helper.setFloat(ldata, 13, targetFigure.rotationYaw);
   ModLoader.clientSendPacket(new Packet250CustomPayload("IFI|Upd", ldata));
 }