@EnvironmentInterfaces(value=@EnvironmentInterface(value=CLIENT,itf=ChestAnimationProgress.class)) public class ChestBlockEntity extends LootableContainerBlockEntity implements ChestAnimationProgress, Tickable
Modifier and Type | Field and Description |
---|---|
protected float |
animationAngle |
private DefaultedList<ItemStack> |
inventory |
protected float |
lastAnimationAngle |
private int |
ticksOpen |
protected int |
viewerCount |
lootTableId, lootTableSeed
pos, removed, world
Modifier | Constructor and Description |
---|---|
|
ChestBlockEntity() |
protected |
ChestBlockEntity(BlockEntityType<?> type) |
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
containsAny, count, getMaxCountPerStack, isValid, markDirty
hasCustomName
private DefaultedList<ItemStack> inventory
protected float animationAngle
protected float lastAnimationAngle
protected int viewerCount
private int ticksOpen
protected ChestBlockEntity(BlockEntityType<?> type)
public ChestBlockEntity()
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 static int tickViewerCount(World world, LockableContainerBlockEntity inventory, int ticksOpen, int x, int y, int z, int viewerCount)
public static int countViewers(World world, LockableContainerBlockEntity inventory, int x, int y, int z)
private void playSound(SoundEvent soundEvent)
public boolean onSyncedBlockEvent(int type, int data)
onSyncedBlockEvent
in class BlockEntity
public void onOpen(PlayerEntity player)
public void onClose(PlayerEntity player)
protected void onInvOpenOrClose()
protected DefaultedList<ItemStack> getInvStackList()
getInvStackList
in class LootableContainerBlockEntity
protected void setInvStackList(DefaultedList<ItemStack> list)
setInvStackList
in class LootableContainerBlockEntity
@Environment(value=CLIENT) public float getAnimationProgress(float tickDelta)
getAnimationProgress
in interface ChestAnimationProgress
public 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 LockableContainerBlockEntity