Class HeldItemGhostItemMenu

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
com.simibubi.create.foundation.gui.menu.MenuBase<net.minecraft.world.item.ItemStack>
com.simibubi.create.foundation.gui.menu.GhostItemMenu<net.minecraft.world.item.ItemStack>
com.simibubi.create.foundation.gui.menu.HeldItemGhostItemMenu
All Implemented Interfaces:
IClearableMenu
Direct Known Subclasses:
AbstractFilterMenu, LinkedControllerMenu, ScheduleMenu

public abstract class HeldItemGhostItemMenu extends GhostItemMenu<net.minecraft.world.item.ItemStack>
A GhostItemMenu that is linked to the item in a player's main hand. Prevents its owner item from being manipulated.
  • Field Summary

    Fields inherited from class com.simibubi.create.foundation.gui.menu.GhostItemMenu

    ghostInventory

    Fields inherited from class com.simibubi.create.foundation.gui.menu.MenuBase

    contentHolder, player, playerInventory

    Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu

    CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    HeldItemGhostItemMenu(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.RegistryFriendlyByteBuf extraData)
     
    protected
    HeldItemGhostItemMenu(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.item.ItemStack contentHolder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canTakeItemForPickAll(net.minecraft.world.item.ItemStack stack, net.minecraft.world.inventory.Slot slot)
     
    void
    clicked(int index, int dragType, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player)
     
    protected net.minecraft.world.item.ItemStack
    createOnClient(net.minecraft.network.RegistryFriendlyByteBuf extraData)
     
    protected boolean
    isInSlot(int index)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class com.simibubi.create.foundation.gui.menu.GhostItemMenu

    allowRepeats, canDragTo, clearContents, createGhostInventory, initAndReadInventory, moveItemStackTo, quickMoveStack

    Methods inherited from class com.simibubi.create.foundation.gui.menu.MenuBase

    addPlayerSlots, addSlots, createPlayerSlot, init, removed, saveData

    Methods inherited from class net.minecraft.world.inventory.AbstractContainerMenu

    addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canItemQuickReplace, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.simibubi.create.foundation.gui.menu.IClearableMenu

    sendClearPacket
  • Constructor Details

    • HeldItemGhostItemMenu

      protected HeldItemGhostItemMenu(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.RegistryFriendlyByteBuf extraData)
    • HeldItemGhostItemMenu

      protected HeldItemGhostItemMenu(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.item.ItemStack contentHolder)
  • Method Details

    • createOnClient

      protected net.minecraft.world.item.ItemStack createOnClient(net.minecraft.network.RegistryFriendlyByteBuf extraData)
      Specified by:
      createOnClient in class MenuBase<net.minecraft.world.item.ItemStack>
    • clicked

      public void clicked(int index, int dragType, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player)
      Overrides:
      clicked in class GhostItemMenu<net.minecraft.world.item.ItemStack>
    • canTakeItemForPickAll

      public boolean canTakeItemForPickAll(net.minecraft.world.item.ItemStack stack, net.minecraft.world.inventory.Slot slot)
      Overrides:
      canTakeItemForPickAll in class GhostItemMenu<net.minecraft.world.item.ItemStack>
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Overrides:
      stillValid in class MenuBase<net.minecraft.world.item.ItemStack>
    • isInSlot

      protected boolean isInSlot(int index)