public abstract class BaseContainer extends ContainerGeneric
Modifier and Type | Field and Description |
---|---|
protected net.minecraftforge.items.IItemHandler |
inventory |
protected int |
inventorySize |
protected net.minecraft.inventory.IInventory |
playerInventory |
Constructor and Description |
---|
BaseContainer(net.minecraft.inventory.container.ContainerType<?> type,
int id,
net.minecraft.inventory.IInventory playerInventory,
net.minecraftforge.items.IItemHandler inventory)
Creates the contianer object
|
Modifier and Type | Method and Description |
---|---|
protected void |
addInventoryGrid(int xOffset,
int yOffset,
int width,
int start)
Adds an inventory grid to the container
|
protected void |
addInventoryLine(int xOffset,
int yOffset,
int start,
int count)
Adds a line of slots
|
protected void |
addInventoryLine(int xOffset,
int yOffset,
int start,
int count,
int margin)
Adds a line of inventory slots with a margin around them
|
protected void |
addPlayerInventorySlots(int offsetY)
Adds the player offset with Y offset
|
protected void |
addPlayerInventorySlots(int offsetX,
int offsetY)
Adds player inventory at location, includes space between normal and hotbar
|
int |
getInventorySizeNotPlayer()
Get the size of the inventory that isn't the players
|
net.minecraft.item.ItemStack |
slotClick(int slotId,
int dragType,
net.minecraft.inventory.container.ClickType clickTypeIn,
net.minecraft.entity.player.PlayerEntity player)
The logic for when a slot is clicked
|
net.minecraft.item.ItemStack |
transferStackInSlot(net.minecraft.entity.player.PlayerEntity playerIn,
int index)
Take a stack from the specified inventory slot.
|
canInteractWith
addListener, addSlot, areItemsAndTagsEqual, assertIntArraySize, assertInventorySize, calcRedstone, calcRedstoneFromInventory, canAddItemToSlot, canDragIntoSlot, canMergeSlot, clearContainer, computeStackSize, detectAndSendChanges, enchantItem, extractDragMode, getCanCraft, getDragEvent, getInventory, getNextTransactionID, getQuickcraftMask, getSlot, getType, isValidDragMode, isWithinUsableDistance, mergeItemStack, onContainerClosed, onCraftMatrixChanged, putStackInSlot, removeListener, resetDrag, setAll, setCanCraft, trackInt, trackIntArray, updateProgressBar
protected net.minecraft.inventory.IInventory playerInventory
protected net.minecraftforge.items.IItemHandler inventory
protected int inventorySize
public BaseContainer(@Nullable net.minecraft.inventory.container.ContainerType<?> type, int id, net.minecraft.inventory.IInventory playerInventory, net.minecraftforge.items.IItemHandler inventory)
playerInventory
- The players inventoryinventory
- The tile/object inventorypublic int getInventorySizeNotPlayer()
protected void addPlayerInventorySlots(int offsetY)
offsetY
- How far downprotected void addPlayerInventorySlots(int offsetX, int offsetY)
offsetX
- X offsetoffsetY
- Y offsetprotected void addInventoryLine(int xOffset, int yOffset, int start, int count)
xOffset
- X offsetyOffset
- Y offsetstart
- start slot numbercount
- how many slotsprotected void addInventoryLine(int xOffset, int yOffset, int start, int count, int margin)
xOffset
- X OffsetyOffset
- Y Offsetstart
- The start slot idcount
- The count of slotsmargin
- How much to pad the slotsprotected void addInventoryGrid(int xOffset, int yOffset, int width, int start)
xOffset
- X pixel offsetyOffset
- Y pixel offsetwidth
- How many widestart
- The start slot idpublic net.minecraft.item.ItemStack slotClick(int slotId, int dragType, net.minecraft.inventory.container.ClickType clickTypeIn, net.minecraft.entity.player.PlayerEntity player)
slotClick
in class net.minecraft.inventory.container.Container
slotId
- The slotdragType
- The mouse buttonclickTypeIn
- The modifierplayer
- The playerpublic net.minecraft.item.ItemStack transferStackInSlot(net.minecraft.entity.player.PlayerEntity playerIn, int index)
transferStackInSlot
in class net.minecraft.inventory.container.Container