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 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 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(DyeColor color, BlockPos blockPos, BlockState blockState)
ShulkerBoxBlockEntity(BlockPos blockPos, BlockState blockState)
-
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(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)
static Box
getBoundingBox(Direction direction, float float2)
private static Box
getCollisionBox(Direction direction, float float2)
DyeColor
getColor()
protected Text
getContainerName()
protected DefaultedList<ItemStack>
getInvStackList()
void
onClose(PlayerEntity player)
void
onOpen(PlayerEntity player)
boolean
onSyncedBlockEvent(int type, int data)
private static void
pushEntities(World world, BlockPos blockPos, BlockState blockState, float float2)
CompoundTag
serializeInventory(CompoundTag tag)
protected void
setInvStackList(DefaultedList<ItemStack> list)
int
size()
boolean
suffocates()
static void
tick(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity)
CompoundTag
toTag(CompoundTag tag)
private static void
updateAnimation(World world, BlockPos blockPos, BlockState blockState, ShulkerBoxBlockEntity shulkerBoxBlockEntity)
private static void
updateNeighborStates(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, setStack
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, getCustomName, getDisplayName, getName, setCustomName
Methods 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, 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
-
-
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:
onSyncedBlockEvent
in classBlockEntity
-
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()
-