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
public class ShulkerBoxBlockEntity extends LootableContainerBlockEntity implements SidedInventory
-
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 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(DyeColor color, BlockPos blockPos, BlockState blockState)ShulkerBoxBlockEntity(BlockPos blockPos, BlockState blockState) -
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(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)static BoxgetBoundingBox(Direction direction, float float2)private static BoxgetCollisionBox(Direction direction, float float2)DyeColorgetColor()protected TextgetContainerName()protected DefaultedList<ItemStack>getInvStackList()voidonClose(PlayerEntity player)voidonOpen(PlayerEntity player)booleanonSyncedBlockEvent(int type, int data)private static voidpushEntities(World world, BlockPos blockPos, BlockState blockState, float float2)CompoundTagserializeInventory(CompoundTag tag)protected voidsetInvStackList(DefaultedList<ItemStack> list)intsize()booleansuffocates()static voidtick(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity)CompoundTagtoTag(CompoundTag tag)private static voidupdateAnimation(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity)private static voidupdateNeighborStates(World world, BlockPos blockPos, BlockState blockState)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
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, populateCrashReport, setCachedState, setWorld, 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
-
-
Constructor Details
-
ShulkerBoxBlockEntity
-
ShulkerBoxBlockEntity
-
-
Method Details
-
tick
public static void tick(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity) -
updateAnimation
private static void updateAnimation(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity) -
getAnimationStage
-
getBoundingBox
-
getBoundingBox
-
getCollisionBox
-
pushEntities
private static void pushEntities(World world, BlockPos blockPos, BlockState blockState, float float2) -
size
public int size() -
onSyncedBlockEvent
public boolean onSyncedBlockEvent(int type, int data)- Overrides:
onSyncedBlockEventin classBlockEntity
-
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()
-