Class ChiseledBookShelfBlockEntity
java.lang.Object
net.neoforged.neoforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,ICapabilityProvider
,ICapabilityProviderImpl<BlockEntity>
,ICapabilitySerializable<CompoundTag>
,IBlockEntityExtension
,INBTSerializable<CompoundTag>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate LazyOptional<?>
private final NonNullList<ItemStack>
private int
private static final org.slf4j.Logger
static final int
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canPlaceItem
(int p_256567_, ItemStack p_255922_) boolean
canTakeItem
(Container p_282172_, int p_281387_, ItemStack p_283257_) void
int
count()
protected IItemHandler
<T> LazyOptional<T>
getCapability
(Capability<T> cap, Direction side) Retrieves the Optional handler for the capability requested on the specific side.int
getItem
(int p_256203_) int
int
void
boolean
isEmpty()
void
load
(CompoundTag p_249911_) removeItem
(int p_255828_, int p_255673_) removeItemNoUpdate
(int p_255874_) void
protected void
saveAdditional
(CompoundTag p_251872_) void
boolean
stillValid
(Player p_256481_) private void
updateState
(int p_261806_) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Container
countItem, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpen
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.neoforged.neoforge.common.capabilities.ICapabilityProvider
getCapability
-
Field Details
-
MAX_BOOKS_IN_STORAGE
public static final int MAX_BOOKS_IN_STORAGE- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
items
-
lastInteractedSlot
private int lastInteractedSlot -
itemHandler
-
-
Constructor Details
-
ChiseledBookShelfBlockEntity
-
-
Method Details
-
updateState
private void updateState(int p_261806_) -
load
- Overrides:
load
in classBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
count
public int count() -
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceClearable
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
-
removeItem
- Specified by:
removeItem
in interfaceContainer
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceContainer
-
setItem
-
canTakeItem
- Specified by:
canTakeItem
in interfaceContainer
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSize
in interfaceContainer
-
stillValid
- Specified by:
stillValid
in interfaceContainer
-
canPlaceItem
- Specified by:
canPlaceItem
in interfaceContainer
-
getLastInteractedSlot
public int getLastInteractedSlot() -
createUnSidedHandler
-
getCapability
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<BlockEntity>
- Parameters:
cap
- The capability to checkside
- The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'- Returns:
- The requested an optional holding the requested capability.
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCaps
in interfaceICapabilityProviderImpl<BlockEntity>
- Overrides:
invalidateCaps
in classCapabilityProvider<BlockEntity>
-
reviveCaps
public void reviveCaps()- Specified by:
reviveCaps
in interfaceICapabilityProviderImpl<BlockEntity>
- Overrides:
reviveCaps
in classCapabilityProvider<BlockEntity>
-