예제 #1
0
  private void handleChestPage(Packet250CustomPayload packet) {
    DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));

    try {
      int x = inputStream.readInt();
      int y = inputStream.readInt();
      int z = inputStream.readInt();
      int d = inputStream.readInt();

      MinecraftServer s = MinecraftServer.getServer();
      WorldServer w = s.worldServerForDimension(d);
      TileEntity te = w.getBlockTileEntity(x, y, z);
      if (te instanceof YC_TileEntityBlockChest) {
        int t = 0;
        t = inputStream.readInt();
        int l = inputStream.readInt();
        String PlayerName = "";
        for (int i = 0; i < l; i++) {
          PlayerName = PlayerName + ((char) inputStream.readInt());
        }
        ((YC_TileEntityBlockChest) te).handlePacketDataPage(t, PlayerName);
        PacketDispatcher.sendPacketToAllAround(x, y, z, 16, d, te.getDescriptionPacket());
      }
    } catch (IOException e) {
      e.printStackTrace();
      return;
    }
  }
 @Override
 public void execute() {
   if (t != null && p != null && t.getWorldObj() != null)
     if (t.getWorldObj().blockExists(t.xCoord, t.yCoord, t.zCoord))
       if (t.getWorldObj().getTileEntity(t.xCoord, t.yCoord, t.zCoord) == t)
         MiscUtils.sendPacketToPlayer(t.getWorldObj(), t.getDescriptionPacket(), p);
 }
예제 #3
0
  private void sendTileToAllPlayersWatchingChunk(TileEntity par1TileEntity) {
    if (par1TileEntity != null) {
      Packet packet = par1TileEntity.getDescriptionPacket();

      if (packet != null) {
        this.sendToAllPlayersWatchingChunk(packet);
      }
    }
  }
  private void func_147097_b(TileEntity p_147097_1_) {
    if (p_147097_1_ != null) {
      Packet packet = p_147097_1_.getDescriptionPacket();

      if (packet != null) {
        this.playerNetServerHandler.sendPacket(packet);
      }
    }
  }