public abstract class Container
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ContainerType<?> |
containerType |
private int |
dragEvent |
private int |
dragMode |
private java.util.Set<Slot> |
dragSlots |
private NonNullList<ItemStack> |
inventoryItemStacks |
java.util.List<Slot> |
inventorySlots |
private java.util.List<IContainerListener> |
listeners |
private java.util.Set<PlayerEntity> |
playerList |
private java.util.List<IntReferenceHolder> |
trackedIntReferences |
private short |
transactionID |
int |
windowId |
Modifier | Constructor and Description |
---|---|
protected |
Container(ContainerType<?> type,
int id) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IContainerListener listener) |
protected Slot |
addSlot(Slot slotIn) |
static boolean |
areItemsAndTagsEqual(ItemStack stack1,
ItemStack stack2) |
protected static void |
assertIntArraySize(IIntArray intArrayIn,
int minSize) |
protected static void |
assertInventorySize(IInventory inventoryIn,
int minSize) |
static int |
calcRedstone(TileEntity te) |
static int |
calcRedstoneFromInventory(IInventory inv) |
static boolean |
canAddItemToSlot(Slot slotIn,
ItemStack stack,
boolean stackSizeMatters) |
boolean |
canDragIntoSlot(Slot slotIn) |
abstract boolean |
canInteractWith(PlayerEntity playerIn) |
boolean |
canMergeSlot(ItemStack stack,
Slot slotIn) |
protected void |
clearContainer(PlayerEntity playerIn,
World worldIn,
IInventory inventoryIn) |
static void |
computeStackSize(java.util.Set<Slot> dragSlotsIn,
int dragModeIn,
ItemStack stack,
int slotStackSize) |
void |
detectAndSendChanges() |
boolean |
enchantItem(PlayerEntity playerIn,
int id) |
static int |
extractDragMode(int eventButton) |
boolean |
getCanCraft(PlayerEntity player) |
static int |
getDragEvent(int clickedButton) |
NonNullList<ItemStack> |
getInventory() |
short |
getNextTransactionID(PlayerInventory invPlayer) |
static int |
getQuickcraftMask(int p_94534_0_,
int p_94534_1_) |
Slot |
getSlot(int slotId) |
ContainerType<?> |
getType() |
static boolean |
isValidDragMode(int dragModeIn,
PlayerEntity player) |
protected static boolean |
isWithinUsableDistance(IWorldPosCallable worldPos,
PlayerEntity playerIn,
Block targetBlock) |
protected boolean |
mergeItemStack(ItemStack stack,
int startIndex,
int endIndex,
boolean reverseDirection) |
void |
onContainerClosed(PlayerEntity playerIn) |
void |
onCraftMatrixChanged(IInventory inventoryIn) |
void |
putStackInSlot(int slotID,
ItemStack stack) |
void |
removeListener(IContainerListener listener) |
protected void |
resetDrag() |
void |
setAll(java.util.List<ItemStack> p_190896_1_) |
void |
setCanCraft(PlayerEntity player,
boolean canCraft) |
ItemStack |
slotClick(int slotId,
int dragType,
ClickType clickTypeIn,
PlayerEntity player) |
protected IntReferenceHolder |
trackInt(IntReferenceHolder intIn) |
protected void |
trackIntArray(IIntArray arrayIn) |
ItemStack |
transferStackInSlot(PlayerEntity playerIn,
int index) |
void |
updateProgressBar(int id,
int data) |
private final NonNullList<ItemStack> inventoryItemStacks
public final java.util.List<Slot> inventorySlots
private final java.util.List<IntReferenceHolder> trackedIntReferences
@Nullable private final ContainerType<?> containerType
public final int windowId
private short transactionID
private int dragMode
private int dragEvent
private final java.util.Set<Slot> dragSlots
private final java.util.List<IContainerListener> listeners
private final java.util.Set<PlayerEntity> playerList
protected Container(@Nullable ContainerType<?> type, int id)
protected static boolean isWithinUsableDistance(IWorldPosCallable worldPos, PlayerEntity playerIn, Block targetBlock)
public ContainerType<?> getType()
protected static void assertInventorySize(IInventory inventoryIn, int minSize)
protected static void assertIntArraySize(IIntArray intArrayIn, int minSize)
protected IntReferenceHolder trackInt(IntReferenceHolder intIn)
protected void trackIntArray(IIntArray arrayIn)
public void addListener(IContainerListener listener)
public void removeListener(IContainerListener listener)
public NonNullList<ItemStack> getInventory()
public void detectAndSendChanges()
public boolean enchantItem(PlayerEntity playerIn, int id)
public Slot getSlot(int slotId)
public ItemStack transferStackInSlot(PlayerEntity playerIn, int index)
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, PlayerEntity player)
public void onContainerClosed(PlayerEntity playerIn)
protected void clearContainer(PlayerEntity playerIn, World worldIn, IInventory inventoryIn)
public void onCraftMatrixChanged(IInventory inventoryIn)
public void putStackInSlot(int slotID, ItemStack stack)
public void setAll(java.util.List<ItemStack> p_190896_1_)
public void updateProgressBar(int id, int data)
public short getNextTransactionID(PlayerInventory invPlayer)
public boolean getCanCraft(PlayerEntity player)
public void setCanCraft(PlayerEntity player, boolean canCraft)
public abstract boolean canInteractWith(PlayerEntity playerIn)
protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection)
public static int extractDragMode(int eventButton)
public static int getDragEvent(int clickedButton)
public static int getQuickcraftMask(int p_94534_0_, int p_94534_1_)
public static boolean isValidDragMode(int dragModeIn, PlayerEntity player)
protected void resetDrag()
public static boolean canAddItemToSlot(@Nullable Slot slotIn, ItemStack stack, boolean stackSizeMatters)
public static void computeStackSize(java.util.Set<Slot> dragSlotsIn, int dragModeIn, ItemStack stack, int slotStackSize)
public boolean canDragIntoSlot(Slot slotIn)
public static int calcRedstone(@Nullable TileEntity te)
public static int calcRedstoneFromInventory(@Nullable IInventory inv)