Package net.minecraft.tileentity
Class LockableTileEntity
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<TileEntity>
-
- net.minecraft.tileentity.TileEntity
-
- net.minecraft.tileentity.LockableTileEntity
-
- All Implemented Interfaces:
IContainerProvider
,INamedContainerProvider
,IClearable
,IInventory
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeTileEntity
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
AbstractFurnaceTileEntity
,BrewingStandTileEntity
,LockableLootTileEntity
public abstract class LockableTileEntity extends TileEntity implements IInventory, INamedContainerProvider, INameable
-
-
Field Summary
Fields Modifier and Type Field Description private LazyOptional<?>
itemHandler
private LockCode
lockKey
private ITextComponent
name
-
Fields inherited from class net.minecraft.tileentity.TileEntity
level, remove, worldPosition
-
Fields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LockableTileEntity(TileEntityType<?> p_i48285_1_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canOpen(PlayerEntity p_213904_1_)
static boolean
canUnlock(PlayerEntity p_213905_0_, LockCode p_213905_1_, ITextComponent p_213905_2_)
protected abstract Container
createMenu(int p_213906_1_, PlayerInventory p_213906_2_)
Container
createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_)
protected IItemHandler
createUnSidedHandler()
<T> LazyOptional<T>
getCapability(Capability<T> cap, Direction side)
Retrieves the Optional handler for the capability requested on the specific side.ITextComponent
getCustomName()
protected abstract ITextComponent
getDefaultName()
ITextComponent
getDisplayName()
ITextComponent
getName()
protected void
invalidateCaps()
void
load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
CompoundNBT
save(CompoundNBT p_189515_1_)
void
setCustomName(ITextComponent p_213903_1_)
-
Methods inherited from class net.minecraft.tileentity.TileEntity
clearCache, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, getViewDistance, hasLevel, isRemoved, loadStatic, logInvalidState, mirror, onChunkUnloaded, onlyOpCanSetNbt, rotate, setChanged, setLevelAndPosition, setPosition, setRemoved, triggerEvent
-
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Methods inherited from interface net.minecraft.inventory.IClearable
clearContent
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
Methods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getContainerSize, getItem, getMaxStackSize, hasAnyOf, isEmpty, removeItem, removeItemNoUpdate, setChanged, setItem, startOpen, stillValid, stopOpen
-
Methods inherited from interface net.minecraft.util.INameable
hasCustomName
-
-
-
-
Field Detail
-
lockKey
private LockCode lockKey
-
name
private ITextComponent name
-
itemHandler
private LazyOptional<?> itemHandler
-
-
Constructor Detail
-
LockableTileEntity
protected LockableTileEntity(TileEntityType<?> p_i48285_1_)
-
-
Method Detail
-
load
public void load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
- Overrides:
load
in classTileEntity
-
save
public CompoundNBT save(CompoundNBT p_189515_1_)
- Overrides:
save
in classTileEntity
-
setCustomName
public void setCustomName(ITextComponent p_213903_1_)
-
getName
public ITextComponent getName()
-
getDisplayName
public ITextComponent getDisplayName()
- Specified by:
getDisplayName
in interfaceINameable
- Specified by:
getDisplayName
in interfaceINamedContainerProvider
-
getCustomName
@Nullable public ITextComponent getCustomName()
- Specified by:
getCustomName
in interfaceINameable
-
getDefaultName
protected abstract ITextComponent getDefaultName()
-
canOpen
public boolean canOpen(PlayerEntity p_213904_1_)
-
canUnlock
public static boolean canUnlock(PlayerEntity p_213905_0_, LockCode p_213905_1_, ITextComponent p_213905_2_)
-
createMenu
@Nullable public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_)
- Specified by:
createMenu
in interfaceIContainerProvider
-
createMenu
protected abstract Container createMenu(int p_213906_1_, PlayerInventory p_213906_2_)
-
createUnSidedHandler
protected IItemHandler createUnSidedHandler()
-
getCapability
public <T> LazyOptional<T> getCapability(Capability<T> cap, @Nullable Direction side)
Description copied from interface:ICapabilityProvider
Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapability
in interfaceICapabilityProvider
- Overrides:
getCapability
in classCapabilityProvider<TileEntity>
- Returns:
- The requested an optional holding the requested capability.
-
invalidateCaps
protected void invalidateCaps()
- Overrides:
invalidateCaps
in classCapabilityProvider<TileEntity>
-
-