/** Displays the GUI for interacting with a chest inventory. Args: chestInventory */
  public void displayGUIChest(IInventory p_71007_1_) {
    if (this.openContainer != this.inventoryContainer) {
      this.closeScreen();
    }

    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(
        new S2DPacketOpenWindow(
            this.currentWindowId,
            0,
            p_71007_1_.getInventoryName(),
            p_71007_1_.getSizeInventory(),
            p_71007_1_.isCustomInventoryName()));
    this.openContainer = new ContainerChest(this.inventory, p_71007_1_);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.onCraftGuiOpened(this);
  }
  public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) {
    if (this.openContainer != this.inventoryContainer) {
      this.closeScreen();
    }

    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(
        new S2DPacketOpenWindow(
            this.currentWindowId,
            11,
            p_110298_2_.getInventoryName(),
            p_110298_2_.getSizeInventory(),
            p_110298_2_.isCustomInventoryName(),
            p_110298_1_.getEntityId()));
    this.openContainer = new ContainerHorseInventory(this.inventory, p_110298_2_, p_110298_1_);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.onCraftGuiOpened(this);
  }
예제 #3
0
 @Override
 public String getInventoryName() {
   return inv.getInventoryName();
 }