Exemple #1
0
 public static void openBuggyInv(EntityPlayerMP player, IInventory buggyInv, int type) {
   player.incrementWindowID();
   player.closeInventory();
   int id = player.currentWindowId;
   player.playerNetServerHandler.sendPacketToPlayer(
       PacketUtil.createPacket(GalacticraftCore.CHANNEL, 28, new Object[] {id}));
   player.openContainer = new GCCoreContainerBuggy(player.inventory, buggyInv, type);
   player.openContainer.windowId = id;
   player.openContainer.addCraftingToCrafters(player);
 }
  @Override
  public void processCommandPlayer(EntityPlayer sender, String[] args) {
    EntityPlayerMP player = (EntityPlayerMP) sender;
    if (player.openContainer != player.inventoryContainer) {
      player.closeScreen();
    }
    player.incrementWindowID();

    VirtualChest chest = new VirtualChest(player);
    player.playerNetServerHandler.sendPacketToPlayer(
        new Packet100OpenWindow(player.currentWindowId, 0, name, size, true));
    player.openContainer = new ContainerChest(player.inventory, chest);
    player.openContainer.windowId = player.currentWindowId;
    player.openContainer.addCraftingToCrafters(player);
  }