Package net.minecraft.block.entity
Class LootableContainerBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.LootableContainerBlockEntity
- All Implemented Interfaces:
Inventory
,NamedScreenHandlerFactory
,ScreenHandlerFactory
,Clearable
,Nameable
- Direct Known Subclasses:
BarrelBlockEntity
,ChestBlockEntity
,DispenserBlockEntity
,HopperBlockEntity
,ShulkerBoxBlockEntity
public abstract class LootableContainerBlockEntity extends LockableContainerBlockEntity
- Mappings:
Namespace Name official cgo
intermediary net/minecraft/class_2621
named net/minecraft/block/entity/LootableContainerBlockEntity
-
Field Summary
Fields Modifier and Type Field Description protected Identifier
lootTableId
protected long
lootTableSeed
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors Modifier Constructor Description protected
LootableContainerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state)
-
Method Summary
Modifier and Type Method 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 tag)
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 tag)
protected abstract void
setInvStackList(DefaultedList<ItemStack> list)
void
setLootTable(Identifier id, long seed)
static void
setLootTable(BlockView world, Random random, BlockPos pos, Identifier id)
void
setStack(int slot, ItemStack stack)
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, createScreenHandler, fromTag, getContainerName, getCustomName, getDisplayName, getName, setCustomName, toTag
Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, 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
containsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, size
Methods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lootTableId
- Mappings:
Namespace Name Mixin selector official d_
Lcgo;d_:Lwb;
intermediary field_12037
Lnet/minecraft/class_2621;field_12037:Lnet/minecraft/class_2960;
named lootTableId
Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableId:Lnet/minecraft/util/Identifier;
-
lootTableSeed
protected long lootTableSeed- Mappings:
Namespace Name Mixin selector official e_
Lcgo;e_:J
intermediary field_12036
Lnet/minecraft/class_2621;field_12036:J
named lootTableSeed
Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableSeed:J
-
-
Constructor Details
-
LootableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>
Lcfr;<init>(Lcft;Lfx;Lcht;)V
intermediary <init>
Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
named <init>
Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
-
Method Details
-
setLootTable
- Mappings:
Namespace Name Mixin selector official a
Lcgo;a(Lbsz;Ljava/util/Random;Lfx;Lwb;)V
intermediary method_11287
Lnet/minecraft/class_2621;method_11287(Lnet/minecraft/class_1922;Ljava/util/Random;Lnet/minecraft/class_2338;Lnet/minecraft/class_2960;)V
named setLootTable
Lnet/minecraft/block/entity/LootableContainerBlockEntity;setLootTable(Lnet/minecraft/world/BlockView;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/Identifier;)V
-
deserializeLootTable
- Mappings:
Namespace Name Mixin selector official c
Lcgo;c(Lmq;)Z
intermediary method_11283
Lnet/minecraft/class_2621;method_11283(Lnet/minecraft/class_2487;)Z
named deserializeLootTable
Lnet/minecraft/block/entity/LootableContainerBlockEntity;deserializeLootTable(Lnet/minecraft/nbt/CompoundTag;)Z
-
serializeLootTable
- Mappings:
Namespace Name Mixin selector official d
Lcgo;d(Lmq;)Z
intermediary method_11286
Lnet/minecraft/class_2621;method_11286(Lnet/minecraft/class_2487;)Z
named serializeLootTable
Lnet/minecraft/block/entity/LootableContainerBlockEntity;serializeLootTable(Lnet/minecraft/nbt/CompoundTag;)Z
-
checkLootInteraction
- Mappings:
Namespace Name Mixin selector official e
Lcgo;e(Lbhl;)V
intermediary method_11289
Lnet/minecraft/class_2621;method_11289(Lnet/minecraft/class_1657;)V
named checkLootInteraction
Lnet/minecraft/block/entity/LootableContainerBlockEntity;checkLootInteraction(Lnet/minecraft/entity/player/PlayerEntity;)V
-
setLootTable
- Mappings:
Namespace Name Mixin selector official a
Lcgo;a(Lwb;J)V
intermediary method_11285
Lnet/minecraft/class_2621;method_11285(Lnet/minecraft/class_2960;J)V
named setLootTable
Lnet/minecraft/block/entity/LootableContainerBlockEntity;setLootTable(Lnet/minecraft/util/Identifier;J)V
-
isEmpty
public boolean isEmpty()- Mappings:
Namespace Name Mixin selector official c
Lapj;c()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
named isEmpty
Lnet/minecraft/inventory/Inventory;isEmpty()Z
-
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY
.- Mappings:
Namespace Name Mixin selector official a
Lapj;a(I)Lbnv;
intermediary method_5438
Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
named getStack
Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes a specific number of items from the given slot.- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official a
Lapj;a(II)Lbnv;
intermediary method_5434
Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes the stack currently stored at the indicated slot.- Returns:
- the stack previously stored at the indicated slot.
- Mappings:
Namespace Name Mixin selector official b
Lapj;b(I)Lbnv;
intermediary method_5441
Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
- Mappings:
Namespace Name Mixin selector official a
Lapj;a(ILbnv;)V
intermediary method_5447
Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
named setStack
Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
-
canPlayerUse
- Mappings:
Namespace Name Mixin selector official a
Lapj;a(Lbhl;)Z
intermediary method_5443
Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
named canPlayerUse
Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
clear
public void clear()- Mappings:
Namespace Name Mixin selector official Z_
Laph;Z_()V
intermediary method_5448
Lnet/minecraft/class_3829;method_5448()V
named clear
Lnet/minecraft/util/Clearable;clear()V
-
getInvStackList
- Mappings:
Namespace Name Mixin selector official f
Lcgo;f()Lgj;
intermediary method_11282
Lnet/minecraft/class_2621;method_11282()Lnet/minecraft/class_2371;
named getInvStackList
Lnet/minecraft/block/entity/LootableContainerBlockEntity;getInvStackList()Lnet/minecraft/util/collection/DefaultedList;
-
setInvStackList
- Mappings:
Namespace Name Mixin selector official a
Lcgo;a(Lgj;)V
intermediary method_11281
Lnet/minecraft/class_2621;method_11281(Lnet/minecraft/class_2371;)V
named setInvStackList
Lnet/minecraft/block/entity/LootableContainerBlockEntity;setInvStackList(Lnet/minecraft/util/collection/DefaultedList;)V
-
checkUnlocked
- Overrides:
checkUnlocked
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official d
Lcfl;d(Lbhl;)Z
intermediary method_17489
Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Z
named checkUnlocked
Lnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
createMenu
- Specified by:
createMenu
in interfaceScreenHandlerFactory
- Overrides:
createMenu
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official createMenu
Lbkt;createMenu(ILbhk;Lbhl;)Lbjr;
intermediary createMenu
Lnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;
named createMenu
Lnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;
-