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 class
ShulkerBoxBlockEntity.AnimationStage
-
Field Summary
Fields Modifier and Type Field Description private float
animationProgress
private ShulkerBoxBlockEntity.AnimationStage
animationStage
private static int[]
AVAILABLE_SLOTS
private DyeColor
cachedColor
private boolean
cachedColorUpdateNeeded
private DefaultedList<ItemStack>
inventory
private float
prevAnimationProgress
private int
viewerCount
Fields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTableId, lootTableSeed
Fields 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 boolean
canExtract(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.boolean
canInsert(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 ScreenHandler
createScreenHandler(int syncId, PlayerInventory playerInventory)
void
deserializeInventory(CompoundTag tag)
void
fromTag(BlockState state, CompoundTag tag)
float
getAnimationProgress(float float2)
ShulkerBoxBlockEntity.AnimationStage
getAnimationStage()
int[]
getAvailableSlots(Direction side)
Gets the available slot positions that are reachable from a given side.Box
getBoundingBox(BlockState state)
Box
getBoundingBox(Direction openDirection)
private Box
getCollisionBox(Direction facing)
DyeColor
getColor()
protected Text
getContainerName()
protected DefaultedList<ItemStack>
getInvStackList()
void
onClose(PlayerEntity player)
void
onOpen(PlayerEntity player)
boolean
onSyncedBlockEvent(int type, int data)
private void
pushEntities()
CompoundTag
serializeInventory(CompoundTag tag)
protected void
setInvStackList(DefaultedList<ItemStack> list)
int
size()
boolean
suffocates()
void
tick()
CompoundTag
toTag(CompoundTag tag)
protected void
updateAnimation()
private void
updateNeighborStates()
Methods inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStack
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, getCustomName, getDisplayName, getName, setCustomName
Methods inherited from class net.minecraft.block.entity.BlockEntity
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, containsAny, count, getMaxCountPerStack, getStack, isEmpty, isValid, markDirty, removeStack, removeStack, setStack
Methods 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:
onSyncedBlockEvent
in classBlockEntity
-
updateNeighborStates
private void updateNeighborStates() -
onOpen
-
onClose
-
getContainerName
- Specified by:
getContainerName
in classLockableContainerBlockEntity
-
fromTag
- Overrides:
fromTag
in classLockableContainerBlockEntity
-
toTag
- Overrides:
toTag
in classLockableContainerBlockEntity
-
deserializeInventory
-
serializeInventory
-
getInvStackList
- Specified by:
getInvStackList
in classLootableContainerBlockEntity
-
setInvStackList
- Specified by:
setInvStackList
in classLootableContainerBlockEntity
-
getAvailableSlots
Gets the available slot positions that are reachable from a given side.- Specified by:
getAvailableSlots
in interfaceSidedInventory
-
canInsert
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.- Specified by:
canInsert
in interfaceSidedInventory
-
canExtract
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.- Specified by:
canExtract
in interfaceSidedInventory
-
getAnimationProgress
public float getAnimationProgress(float float2) -
getColor
-
createScreenHandler
- Specified by:
createScreenHandler
in classLockableContainerBlockEntity
-
suffocates
public boolean suffocates()
-