@EnvironmentInterfaces(value=@EnvironmentInterface(value=CLIENT,itf=ChestAnimationProgress.class)) public class ChestBlockEntity extends LootableContainerBlockEntity implements ChestAnimationProgress
| Modifier and Type | Field and Description |
|---|---|
private DefaultedList<ItemStack> |
inventory |
private ChestLidAnimator |
lidAnimator |
private ChestStateManager |
stateManager |
lootTableId, lootTableSeedpos, removed, world| Modifier | Constructor and Description |
|---|---|
protected |
ChestBlockEntity(BlockEntityType<?> blockEntityType,
BlockPos blockPos,
BlockState blockState) |
|
ChestBlockEntity(BlockPos pos,
BlockState state) |
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStackcheckUnlocked, getCustomName, getDisplayName, getName, setCustomNamecancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAny, count, getMaxCountPerStack, isValid, markDirtyhasCustomNameprivate DefaultedList<ItemStack> inventory
private final ChestStateManager stateManager
private final ChestLidAnimator lidAnimator
protected ChestBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState)
public ChestBlockEntity(BlockPos pos, BlockState state)
protected Text getContainerName()
getContainerName in class LockableContainerBlockEntitypublic void fromTag(CompoundTag compoundTag)
fromTag in class LockableContainerBlockEntitypublic CompoundTag toTag(CompoundTag tag)
toTag in class LockableContainerBlockEntitypublic static void clientTick(World world, BlockPos pos, BlockState state, ChestBlockEntity blockEntity)
private static void playSound(World world, BlockPos pos, BlockState state, SoundEvent soundEvent)
public boolean onSyncedBlockEvent(int type,
int data)
onSyncedBlockEvent in class BlockEntitypublic void onOpen(PlayerEntity player)
public void onClose(PlayerEntity player)
protected DefaultedList<ItemStack> getInvStackList()
getInvStackList in class LootableContainerBlockEntityprotected void setInvStackList(DefaultedList<ItemStack> list)
setInvStackList in class LootableContainerBlockEntity@Environment(value=CLIENT) public float getAnimationProgress(float tickDelta)
getAnimationProgress in interface ChestAnimationProgresspublic static int getPlayersLookingInChestCount(BlockView world, BlockPos pos)
public static void copyInventory(ChestBlockEntity from, ChestBlockEntity to)
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory)
createScreenHandler in class LockableContainerBlockEntitypublic void onScheduledTick()
protected void onInvOpenOrClose(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount)