Ejemplo n.º 1
0
  @Override
  protected void drawGuiContainerForegroundLayer() {
    fontRenderer.drawString(
        filterInventory.getInvName(), getCenteredOffset(filterInventory.getInvName()), 6, 0x404040);
    fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);

    drawForegroundSelection();
  }
Ejemplo n.º 2
0
  @Override
  protected void mouseClicked(int i, int j, int k) {
    super.mouseClicked(i, j, k);

    int cornerX = (width - xSize) / 2;
    int cornerY = (height - ySize) / 2;

    int position = getSlotAtLocation(i - cornerX, j - cornerY);

    IInventorySlot slot = null;

    if (position != -1) slot = (IInventorySlot) slots[position];

    if (slot != null) {
      ItemStack playerStack = mc.thePlayer.inventory.getItemStack();

      ItemStack newStack;
      if (playerStack != null)
        newStack = new ItemStack(playerStack.itemID, 1, playerStack.getItemDamage());
      else newStack = null;

      filterInventory.setInventorySlotContents(position, newStack);

      if (CoreProxy.proxy.isRemote(filterInventory.worldObj)) {
        PacketSlotChange packet =
            new PacketSlotChange(
                PacketIds.DIAMOND_PIPE_SELECT,
                filterInventory.xCoord,
                filterInventory.yCoord,
                filterInventory.zCoord,
                position,
                newStack);
        CoreProxy.proxy.sendToServer(packet.getPacket());
      }
    }
  }