Package net.minecraft.block.entity
Class ShulkerBoxBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.LootableContainerBlockEntity
net.minecraft.block.entity.ShulkerBoxBlockEntity
- All Implemented Interfaces:
Inventory,SidedInventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable,Tickable
public class ShulkerBoxBlockEntity extends LootableContainerBlockEntity implements SidedInventory, Tickable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShulkerBoxBlockEntity.AnimationStage -
Field Summary
Fields Modifier and Type Field Description private floatanimationProgressprivate ShulkerBoxBlockEntity.AnimationStageanimationStageprivate static int[]AVAILABLE_SLOTSprivate DyeColorcachedColorprivate booleancachedColorUpdateNeededprivate DefaultedList<ItemStack>inventoryprivate floatprevAnimationProgressprivate intviewerCountFields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTableId, lootTableSeedFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Constructor Description ShulkerBoxBlockEntity()ShulkerBoxBlockEntity(DyeColor color) -
Method Summary
Modifier and Type Method Description booleancanExtract(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.booleancanInsert(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.protected ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voiddeserializeInventory(CompoundTag tag)voidfromTag(BlockState state, CompoundTag tag)floatgetAnimationProgress(float float2)ShulkerBoxBlockEntity.AnimationStagegetAnimationStage()int[]getAvailableSlots(Direction side)Gets the available slot positions that are reachable from a given side.BoxgetBoundingBox(BlockState state)BoxgetBoundingBox(Direction openDirection)private BoxgetCollisionBox(Direction facing)DyeColorgetColor()protected TextgetContainerName()protected DefaultedList<ItemStack>getInvStackList()voidonClose(PlayerEntity player)voidonOpen(PlayerEntity player)booleanonSyncedBlockEvent(int type, int data)private voidpushEntities()CompoundTagserializeInventory(CompoundTag tag)protected voidsetInvStackList(DefaultedList<ItemStack> list)intsize()booleansuffocates()voidtick()CompoundTagtoTag(CompoundTag tag)protected voidupdateAnimation()private voidupdateNeighborStates()Methods inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStackMethods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, getCustomName, getDisplayName, getName, setCustomNameMethods inherited from class net.minecraft.block.entity.BlockEntity
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacketMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, containsAny, count, getMaxCountPerStack, getStack, isEmpty, isValid, markDirty, removeStack, removeStack, setStackMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
AVAILABLE_SLOTS
private static final int[] AVAILABLE_SLOTS -
inventory
-
viewerCount
private int viewerCount -
animationStage
-
animationProgress
private float animationProgress -
prevAnimationProgress
private float prevAnimationProgress -
cachedColor
-
cachedColorUpdateNeeded
private boolean cachedColorUpdateNeeded
-
-
Constructor Details
-
ShulkerBoxBlockEntity
-
ShulkerBoxBlockEntity
public ShulkerBoxBlockEntity()
-
-
Method Details
-
tick
public void tick() -
updateAnimation
protected void updateAnimation() -
getAnimationStage
-
getBoundingBox
-
getBoundingBox
-
getCollisionBox
-
pushEntities
private void pushEntities() -
size
public int size() -
onSyncedBlockEvent
public boolean onSyncedBlockEvent(int type, int data)- Overrides:
onSyncedBlockEventin classBlockEntity
-
updateNeighborStates
private void updateNeighborStates() -
onOpen
-
onClose
-
getContainerName
- Specified by:
getContainerNamein classLockableContainerBlockEntity
-
fromTag
- Overrides:
fromTagin classLockableContainerBlockEntity
-
toTag
- Overrides:
toTagin classLockableContainerBlockEntity
-
deserializeInventory
-
serializeInventory
-
getInvStackList
- Specified by:
getInvStackListin classLootableContainerBlockEntity
-
setInvStackList
- Specified by:
setInvStackListin classLootableContainerBlockEntity
-
getAvailableSlots
Gets the available slot positions that are reachable from a given side.- Specified by:
getAvailableSlotsin interfaceSidedInventory
-
canInsert
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.- Specified by:
canInsertin interfaceSidedInventory
-
canExtract
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.- Specified by:
canExtractin interfaceSidedInventory
-
getAnimationProgress
public float getAnimationProgress(float float2) -
getColor
-
createScreenHandler
- Specified by:
createScreenHandlerin classLockableContainerBlockEntity
-
suffocates
public boolean suffocates()
-