public class ShulkerBoxBlockEntity extends LootableContainerBlockEntity implements SidedInventory, Tickable
Modifier and Type | Class and Description |
---|---|
static class |
ShulkerBoxBlockEntity.AnimationStage |
Modifier and Type | Field and 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 |
lootTableId, lootTableSeed
pos, removed, world
Constructor and Description |
---|
ShulkerBoxBlockEntity() |
ShulkerBoxBlockEntity(DyeColor color) |
Modifier and Type | Method and 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() |
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStack
checkUnlocked, getCustomName, getDisplayName, getName, setCustomName
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canPlayerUse, containsAny, count, getMaxCountPerStack, getStack, isEmpty, isValid, markDirty, removeStack, removeStack, setStack
hasCustomName
private static final int[] AVAILABLE_SLOTS
private DefaultedList<ItemStack> inventory
private int viewerCount
private ShulkerBoxBlockEntity.AnimationStage animationStage
private float animationProgress
private float prevAnimationProgress
private boolean cachedColorUpdateNeeded
protected void updateAnimation()
public ShulkerBoxBlockEntity.AnimationStage getAnimationStage()
public Box getBoundingBox(BlockState state)
private void pushEntities()
public boolean onSyncedBlockEvent(int type, int data)
onSyncedBlockEvent
in class BlockEntity
private void updateNeighborStates()
public void onOpen(PlayerEntity player)
public void onClose(PlayerEntity player)
protected Text getContainerName()
getContainerName
in class LockableContainerBlockEntity
public void fromTag(BlockState state, CompoundTag tag)
fromTag
in class LockableContainerBlockEntity
public CompoundTag toTag(CompoundTag tag)
toTag
in class LockableContainerBlockEntity
public void deserializeInventory(CompoundTag tag)
public CompoundTag serializeInventory(CompoundTag tag)
protected DefaultedList<ItemStack> getInvStackList()
getInvStackList
in class LootableContainerBlockEntity
protected void setInvStackList(DefaultedList<ItemStack> list)
setInvStackList
in class LootableContainerBlockEntity
public int[] getAvailableSlots(Direction side)
getAvailableSlots
in interface SidedInventory
public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir)
canInsert
in interface SidedInventory
public boolean canExtract(int slot, ItemStack stack, Direction dir)
canExtract
in interface SidedInventory
public float getAnimationProgress(float float2)
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory)
createScreenHandler
in class LockableContainerBlockEntity
public boolean suffocates()