public abstract class UTileeEntityContainer<T extends net.minecraft.tileentity.TileEntity> extends UContainer
UContainer.SlotHandlerFunction, UContainer.SlotInventoryFunction
Modifier and Type | Field and Description |
---|---|
protected net.minecraft.entity.player.PlayerInventory |
playerInventory |
protected T |
tileEntity |
Constructor and Description |
---|
UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type,
int id,
net.minecraft.entity.player.PlayerInventory playerInventory,
net.minecraft.network.PacketBuffer buffer)
This is the client constructor for the container.
|
UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type,
int id,
net.minecraft.entity.player.PlayerInventory playerInventory,
net.minecraft.network.PacketBuffer buffer,
boolean init)
This is the client constructor for the container.
|
UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type,
int id,
net.minecraft.entity.player.PlayerInventory playerInventory,
T tileEntity)
This is the server constructor for the container.
|
UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type,
int id,
net.minecraft.entity.player.PlayerInventory playerInventory,
T tileEntity,
boolean init)
This is the server constructor for the container.
|
Modifier and Type | Method and Description |
---|---|
protected net.minecraft.inventory.IInventory |
getInventoryOnDist(boolean server,
net.minecraft.inventory.IInventory inventory)
On the server side just returns the inventory.
|
T |
getTileEntity()
Gets the tile entity
|
protected abstract void |
init(boolean server)
Is called after the server and client constructor.
|
appendInventory, appendInventory, appendInventory, appendInventory, appendPlayerInventory, 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, slotClick, trackInt, trackIntArray, transferStackInSlot, updateProgressBar
protected final net.minecraft.entity.player.PlayerInventory playerInventory
protected final T extends net.minecraft.tileentity.TileEntity tileEntity
public UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type, int id, net.minecraft.entity.player.PlayerInventory playerInventory, T tileEntity)
#init()
is called.type
- Container typeid
- Window idplayerInventory
- Player inventorytileEntity
- Tile entitypublic UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type, int id, net.minecraft.entity.player.PlayerInventory playerInventory, T tileEntity, boolean init)
type
- Container typeid
- Window idplayerInventory
- Player inventorytileEntity
- Tile entityinit
- If the constructor should call #init()
public UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type, int id, net.minecraft.entity.player.PlayerInventory playerInventory, net.minecraft.network.PacketBuffer buffer)
getClientTileEntity(PacketBuffer)
to get the tile
entity. The #init()
is called.type
- Container typeid
- Window idplayerInventory
- Player inventorybuffer
- Initial data (specified with NetworkHooks#openGui(player, containerSupplier,extraDataWriter)
)public UTileeEntityContainer(net.minecraft.inventory.container.ContainerType<?> type, int id, net.minecraft.entity.player.PlayerInventory playerInventory, net.minecraft.network.PacketBuffer buffer, boolean init)
getClientTileEntity(PacketBuffer)
to get the tile
entity.type
- Container typeid
- Window idplayerInventory
- Player inventorybuffer
- Initial data (specified with NetworkHooks#openGui(player, containerSupplier,extraDataWriter)
)init
- If the constructor should call #init()
protected abstract void init(boolean server)
server
- True if its the server side false otherwiseprotected net.minecraft.inventory.IInventory getInventoryOnDist(boolean server, net.minecraft.inventory.IInventory inventory)
Inventory
with the same size as the passed inventory.server
- True if is the server side false otherwiseinventory
- Inventory to decide onpublic T getTileEntity()