public abstract class LootableContainerBlockEntity extends LockableContainerBlockEntity
| Modifier and Type | Field and Description |
|---|---|
protected Identifier |
lootTableId |
protected long |
lootTableSeed |
pos, removed, world| Modifier | Constructor and Description |
|---|---|
protected |
LootableContainerBlockEntity(BlockEntityType<?> type) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canPlayerUse(PlayerEntity player) |
void |
checkLootInteraction(PlayerEntity player) |
boolean |
checkUnlocked(PlayerEntity player) |
void |
clear() |
ScreenHandler |
createMenu(int syncId,
PlayerInventory inv,
PlayerEntity player) |
protected boolean |
deserializeLootTable(CompoundTag compoundTag) |
protected abstract DefaultedList<ItemStack> |
getInvStackList() |
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
boolean |
isEmpty() |
ItemStack |
removeStack(int slot)
Removes the stack currently stored at the indicated slot.
|
ItemStack |
removeStack(int slot,
int amount)
Removes a specific number of items from the given slot.
|
protected boolean |
serializeLootTable(CompoundTag compoundTag) |
protected abstract void |
setInvStackList(DefaultedList<ItemStack> list) |
static void |
setLootTable(BlockView world,
Random random,
BlockPos pos,
Identifier id) |
void |
setLootTable(Identifier id,
long seed) |
void |
setStack(int slot,
ItemStack stack) |
checkUnlocked, createScreenHandler, fromTag, getContainerName, getCustomName, getDisplayName, getName, setCustomName, toTagapplyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, sizehasCustomName@Nullable protected Identifier lootTableId
protected long lootTableSeed
protected LootableContainerBlockEntity(BlockEntityType<?> type)
public static void setLootTable(BlockView world, Random random, BlockPos pos, Identifier id)
protected boolean deserializeLootTable(CompoundTag compoundTag)
protected boolean serializeLootTable(CompoundTag compoundTag)
public void checkLootInteraction(@Nullable PlayerEntity player)
public void setLootTable(Identifier id, long seed)
public boolean isEmpty()
public ItemStack getStack(int slot)
ItemStack.EMPTY.public ItemStack removeStack(int slot, int amount)
public ItemStack removeStack(int slot)
public void setStack(int slot,
ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
public void clear()
protected abstract DefaultedList<ItemStack> getInvStackList()
protected abstract void setInvStackList(DefaultedList<ItemStack> list)
public boolean checkUnlocked(PlayerEntity player)
checkUnlocked in class LockableContainerBlockEntity@Nullable public ScreenHandler createMenu(int syncId, PlayerInventory inv, PlayerEntity player)
createMenu in interface ScreenHandlerFactorycreateMenu in class LockableContainerBlockEntity