public abstract class TileEntityLockable extends TileEntity implements ILockableContainer
Modifier and Type | Field and Description |
---|---|
private LockCode |
code |
private IItemHandler |
itemHandler |
blockType, INFINITE_EXTENT_AABB, pos, tileEntityInvalid, world
Constructor and Description |
---|
TileEntityLockable() |
Modifier and Type | Method and Description |
---|---|
protected IItemHandler |
createUnSidedHandler() |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
ITextComponent |
getDisplayName() |
LockCode |
getLockCode() |
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
boolean |
isLocked() |
void |
readFromNBT(NBTTagCompound compound) |
void |
setLockCode(LockCode code) |
NBTTagCompound |
writeToNBT(NBTTagCompound compound) |
addInfoToCrashReport, canRenderBreaking, create, deserializeNBT, getBlockMetadata, getBlockType, getDistanceSq, getKey, getMaxRenderDistanceSquared, getPos, getRenderBoundingBox, getTileData, getUpdatePacket, getUpdateTag, getWorld, handleUpdateTag, hasFastRenderer, hasWorld, invalidate, isInvalid, markDirty, mirror, onChunkUnload, onDataPacket, onLoad, onlyOpsCanSetNbt, receiveClientEvent, register, restrictNBTCopy, rotate, serializeNBT, setPos, setWorld, setWorldCreate, shouldRefresh, shouldRenderInPass, updateContainingBlockInfo, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, closeInventory, decrStackSize, getField, getFieldCount, getInventoryStackLimit, getSizeInventory, getStackInSlot, isEmpty, isItemValidForSlot, isUsableByPlayer, markDirty, openInventory, removeStackFromSlot, setField, setInventorySlotContents
createContainer, getGuiID
getName, hasCustomName
private LockCode code
private IItemHandler itemHandler
public void readFromNBT(NBTTagCompound compound)
readFromNBT
in class TileEntity
public NBTTagCompound writeToNBT(NBTTagCompound compound)
writeToNBT
in class TileEntity
public boolean isLocked()
isLocked
in interface ILockableContainer
public LockCode getLockCode()
getLockCode
in interface ILockableContainer
public void setLockCode(LockCode code)
setLockCode
in interface ILockableContainer
public ITextComponent getDisplayName()
getDisplayName
in interface IWorldNameable
getDisplayName
in class TileEntity
protected IItemHandler createUnSidedHandler()
@Nullable public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
ICapabilityProvider
Basically, this method functions analogously to Map.get(Object)
.
getCapability
in interface ICapabilityProvider
getCapability
in class TileEntity
capability
- The capability to checkfacing
- The Side to check from,
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.hasCapability(Capability, EnumFacing)
would return true.public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
ICapabilityProvider
ICapabilityProvider.getCapability(Capability, EnumFacing)
.
Basically, this method functions analogously to Map.containsKey(Object)
.
Example: A Pipe getting a cover placed on one side causing it lose the Inventory attachment function for that side.
This is a light weight version of getCapability, intended for metadata uses.
hasCapability
in interface ICapabilityProvider
hasCapability
in class TileEntity
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.getCapability(Capability, EnumFacing)
must not return null.