Class CrafterBlockEntity
- All Implemented Interfaces:
Inventory
,LootableInventory
,RecipeInputInventory
,RecipeInputProvider
,NamedScreenHandlerFactory
,ScreenHandlerFactory
,Clearable
,Nameable
- Mappings:
Namespace Name named net/minecraft/block/entity/CrafterBlockEntity
intermediary net/minecraft/class_8887
official dvk
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
static final int
static final int
static final int
private DefaultedList
<ItemStack> static final int
protected final PropertyDelegate
static final int
static final int
static final int
Fields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTable, lootTableSeed
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
Fields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE
Fields inherited from interface net.minecraft.inventory.LootableInventory
LOOT_TABLE_KEY, LOOT_TABLE_SEED_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
betterSlotExists
(int count, ItemStack stack, int slot) boolean
canPlayerUse
(PlayerEntity player) Returns whetherplayer
can use this inventory.private boolean
canToggleSlot
(int slot) protected ScreenHandler
createScreenHandler
(int syncId, PlayerInventory playerInventory) int
protected Text
int
Returns the height of the recipe grid.Returns the stacks held by the inventory.getStack
(int slot) Returns the stack currently stored atslot
.int
getWidth()
Returns the width of the recipe grid.boolean
isEmpty()
Returns whether the inventory consists entirely of empty item stacks.boolean
isSlotDisabled
(int slot) boolean
boolean
Returns whetherstack
is valid for theslot
.void
provideRecipeInputs
(RecipeFinder finder) private void
private void
putTriggered
(NbtCompound nbt) protected void
readNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Reads data fromnbt
.void
setCraftingTicksRemaining
(int craftingTicksRemaining) protected void
setHeldStacks
(DefaultedList<ItemStack> inventory) void
setSlotEnabled
(int slot, boolean enabled) void
Sets the stack stored atslot
tostack
.void
setTriggered
(boolean triggered) int
size()
Returns the size of the inventory.static void
tickCrafting
(World world, BlockPos pos, BlockState state, CrafterBlockEntity blockEntity) protected void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
addComponents, checkUnlocked, createMenu, getLootTable, getLootTableSeed, readComponents, removeFromCopiedStackNbt, removeStack, removeStack, setLootTable, setLootTableSeed
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, clear, getCustomName, getDisplayName, getName
Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, setCachedState, setComponents, setStackNbt, setWorld, supports, toInitialChunkDataNbt, toUpdatePacket, tryParseCustomName, writeIdToNbt
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
canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, markDirty, onClose, onOpen, removeStack, removeStack
Methods inherited from interface net.minecraft.inventory.LootableInventory
generateLoot, getPos, getWorld, readLootTable, setLootTable, writeLootTable
Methods inherited from interface net.minecraft.util.Nameable
hasCustomName
Methods inherited from interface net.minecraft.inventory.RecipeInputInventory
createPositionedRecipeInput, createRecipeInput
-
Field Details
-
GRID_WIDTH
public static final int GRID_WIDTH- See Also:
- Mappings:
Namespace Name Mixin selector named GRID_WIDTH
Lnet/minecraft/block/entity/CrafterBlockEntity;GRID_WIDTH:I
intermediary field_46809
Lnet/minecraft/class_8887;field_46809:I
official d
Ldvk;d:I
-
GRID_HEIGHT
public static final int GRID_HEIGHT- See Also:
- Mappings:
Namespace Name Mixin selector named GRID_HEIGHT
Lnet/minecraft/block/entity/CrafterBlockEntity;GRID_HEIGHT:I
intermediary field_46810
Lnet/minecraft/class_8887;field_46810:I
official e
Ldvk;e:I
-
GRID_SIZE
public static final int GRID_SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named GRID_SIZE
Lnet/minecraft/block/entity/CrafterBlockEntity;GRID_SIZE:I
intermediary field_46811
Lnet/minecraft/class_8887;field_46811:I
official f
Ldvk;f:I
-
SLOT_DISABLED
public static final int SLOT_DISABLED- See Also:
- Mappings:
Namespace Name Mixin selector named SLOT_DISABLED
Lnet/minecraft/block/entity/CrafterBlockEntity;SLOT_DISABLED:I
intermediary field_46812
Lnet/minecraft/class_8887;field_46812:I
official g
Ldvk;g:I
-
SLOT_ENABLED
public static final int SLOT_ENABLED- See Also:
- Mappings:
Namespace Name Mixin selector named SLOT_ENABLED
Lnet/minecraft/block/entity/CrafterBlockEntity;SLOT_ENABLED:I
intermediary field_46813
Lnet/minecraft/class_8887;field_46813:I
official h
Ldvk;h:I
-
TRIGGERED_PROPERTY
public static final int TRIGGERED_PROPERTY- See Also:
- Mappings:
Namespace Name Mixin selector named TRIGGERED_PROPERTY
Lnet/minecraft/block/entity/CrafterBlockEntity;TRIGGERED_PROPERTY:I
intermediary field_46814
Lnet/minecraft/class_8887;field_46814:I
official i
Ldvk;i:I
-
PROPERTIES_COUNT
public static final int PROPERTIES_COUNT- See Also:
- Mappings:
Namespace Name Mixin selector named PROPERTIES_COUNT
Lnet/minecraft/block/entity/CrafterBlockEntity;PROPERTIES_COUNT:I
intermediary field_46815
Lnet/minecraft/class_8887;field_46815:I
official j
Ldvk;j:I
-
inputStacks
- Mappings:
Namespace Name Mixin selector named inputStacks
Lnet/minecraft/block/entity/CrafterBlockEntity;inputStacks:Lnet/minecraft/util/collection/DefaultedList;
intermediary field_46817
Lnet/minecraft/class_8887;field_46817:Lnet/minecraft/class_2371;
official n
Ldvk;n:Ljz;
-
craftingTicksRemaining
private int craftingTicksRemaining- Mappings:
Namespace Name Mixin selector named craftingTicksRemaining
Lnet/minecraft/block/entity/CrafterBlockEntity;craftingTicksRemaining:I
intermediary field_46818
Lnet/minecraft/class_8887;field_46818:I
official r
Ldvk;r:I
-
propertyDelegate
- Mappings:
Namespace Name Mixin selector named propertyDelegate
Lnet/minecraft/block/entity/CrafterBlockEntity;propertyDelegate:Lnet/minecraft/screen/PropertyDelegate;
intermediary field_46816
Lnet/minecraft/class_8887;field_46816:Lnet/minecraft/class_3913;
official k
Ldvk;k:Lctn;
-
-
Constructor Details
-
CrafterBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/entity/CrafterBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary <init>
Lnet/minecraft/class_8887;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official <init>
Ldvk;<init>(Ljh;Ldxu;)V
-
-
Method Details
-
getContainerName
- Specified by:
getContainerName
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named getContainerName
Lnet/minecraft/block/entity/LockableContainerBlockEntity;getContainerName()Lnet/minecraft/text/Text;
intermediary method_17823
Lnet/minecraft/class_2624;method_17823()Lnet/minecraft/class_2561;
official j
Lduq;j()Lxv;
-
createScreenHandler
- Specified by:
createScreenHandler
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named createScreenHandler
Lnet/minecraft/block/entity/LockableContainerBlockEntity;createScreenHandler(ILnet/minecraft/entity/player/PlayerInventory;)Lnet/minecraft/screen/ScreenHandler;
intermediary method_5465
Lnet/minecraft/class_2624;method_5465(ILnet/minecraft/class_1661;)Lnet/minecraft/class_1703;
official a
Lduq;a(ILcpv;)Lctb;
-
setSlotEnabled
public void setSlotEnabled(int slot, boolean enabled) - Mappings:
Namespace Name Mixin selector named setSlotEnabled
Lnet/minecraft/block/entity/CrafterBlockEntity;setSlotEnabled(IZ)V
intermediary method_54480
Lnet/minecraft/class_8887;method_54480(IZ)V
official a
Ldvk;a(IZ)V
-
isSlotDisabled
public boolean isSlotDisabled(int slot) - Mappings:
Namespace Name Mixin selector named isSlotDisabled
Lnet/minecraft/block/entity/CrafterBlockEntity;isSlotDisabled(I)Z
intermediary method_54483
Lnet/minecraft/class_8887;method_54483(I)Z
official c
Ldvk;c(I)Z
-
isValid
Returns whetherstack
is valid for theslot
.Implementations can, for example, use this to check whether the item is in a specific tag. This returns
true
by default.- Specified by:
isValid
in interfaceInventory
- Returns:
- whether
stack
is valid for theslot
- Mappings:
Namespace Name Mixin selector named isValid
Lnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
intermediary method_5437
Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Z
official b
Lbtb;b(ILcxo;)Z
-
betterSlotExists
- Mappings:
Namespace Name Mixin selector named betterSlotExists
Lnet/minecraft/block/entity/CrafterBlockEntity;betterSlotExists(ILnet/minecraft/item/ItemStack;I)Z
intermediary method_54479
Lnet/minecraft/class_8887;method_54479(ILnet/minecraft/class_1799;I)Z
official a
Ldvk;a(ILcxo;I)Z
-
readNbt
Reads data fromnbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Overrides:
readNbt
in classLockableContainerBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official a
Lduw;a(Lux;Ljs$a;)V
-
writeNbt
Writes data tonbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
- Overrides:
writeNbt
in classLockableContainerBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official b
Lduw;b(Lux;Ljs$a;)V
-
size
public int size()Returns the size of the inventory.The inventory should support the slot ID from
0
tosize() - 1
. This should remain constant throughout the inventory's lifetime. -
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmpty
in interfaceInventory
- Overrides:
isEmpty
in classLootableContainerBlockEntity
- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmpty
Lnet/minecraft/inventory/Inventory;isEmpty()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
official c
Lbtb;c()Z
-
getStack
Returns the stack currently stored atslot
.If the slot is empty, or is outside the bounds of this inventory, this returns
ItemStack.EMPTY
.- Specified by:
getStack
in interfaceInventory
- Overrides:
getStack
in classLootableContainerBlockEntity
- Returns:
- the stack currently stored at
slot
- Mappings:
Namespace Name Mixin selector named getStack
Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
intermediary method_5438
Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
official a
Lbtb;a(I)Lcxo;
-
setStack
Sets the stack stored atslot
tostack
.- Specified by:
setStack
in interfaceInventory
- Overrides:
setStack
in classLootableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named setStack
Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
intermediary method_5447
Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
official a
Lbtb;a(ILcxo;)V
-
canPlayerUse
Returns whetherplayer
can use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block)
.- Specified by:
canPlayerUse
in interfaceInventory
- Overrides:
canPlayerUse
in classLockableContainerBlockEntity
- Returns:
- whether
player
can use this inventory - See Also:
- API Note:
- Implementations should check the distance between the inventory
holder and
player
. For convenience, this interface offers two methods used by block entities to implement this check. - Mappings:
Namespace Name Mixin selector named canPlayerUse
Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_5443
Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
official a
Lbtb;a(Lcpw;)Z
-
getHeldStacks
Description copied from interface:RecipeInputInventory
Returns the stacks held by the inventory.- Specified by:
getHeldStacks
in interfaceRecipeInputInventory
- Specified by:
getHeldStacks
in classLockableContainerBlockEntity
- Returns:
- the stacks held by the inventory
- Mappings:
Namespace Name Mixin selector named getHeldStacks
Lnet/minecraft/block/entity/CrafterBlockEntity;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;
intermediary method_11282
Lnet/minecraft/class_8887;method_11282()Lnet/minecraft/class_2371;
official method_11282
Ldvk;method_11282()Ljz;
-
setHeldStacks
- Specified by:
setHeldStacks
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named setHeldStacks
Lnet/minecraft/block/entity/LockableContainerBlockEntity;setHeldStacks(Lnet/minecraft/util/collection/DefaultedList;)V
intermediary method_11281
Lnet/minecraft/class_2624;method_11281(Lnet/minecraft/class_2371;)V
official a
Lduq;a(Ljz;)V
-
getWidth
public int getWidth()Returns the width of the recipe grid.- Specified by:
getWidth
in interfaceRecipeInputInventory
- Returns:
- the width of the recipe grid
- Mappings:
Namespace Name Mixin selector named getWidth
Lnet/minecraft/inventory/RecipeInputInventory;getWidth()I
intermediary method_17398
Lnet/minecraft/class_8566;method_17398()I
official az_
Lctt;az_()I
-
getHeight
public int getHeight()Returns the height of the recipe grid.- Specified by:
getHeight
in interfaceRecipeInputInventory
- Returns:
- the height of the recipe grid
- Mappings:
Namespace Name Mixin selector named getHeight
Lnet/minecraft/inventory/RecipeInputInventory;getHeight()I
intermediary method_17397
Lnet/minecraft/class_8566;method_17397()I
official g
Lctt;g()I
-
provideRecipeInputs
- Specified by:
provideRecipeInputs
in interfaceRecipeInputProvider
- Mappings:
Namespace Name Mixin selector named provideRecipeInputs
Lnet/minecraft/recipe/RecipeInputProvider;provideRecipeInputs(Lnet/minecraft/recipe/RecipeFinder;)V
intermediary method_7683
Lnet/minecraft/class_1737;method_7683(Lnet/minecraft/class_9875;)V
official fillStackedContents
Lcvd;fillStackedContents(Lcqb;)V
-
putDisabledSlots
- Mappings:
Namespace Name Mixin selector named putDisabledSlots
Lnet/minecraft/block/entity/CrafterBlockEntity;putDisabledSlots(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_54486
Lnet/minecraft/class_8887;method_54486(Lnet/minecraft/class_2487;)V
official c
Ldvk;c(Lux;)V
-
putTriggered
- Mappings:
Namespace Name Mixin selector named putTriggered
Lnet/minecraft/block/entity/CrafterBlockEntity;putTriggered(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_54487
Lnet/minecraft/class_8887;method_54487(Lnet/minecraft/class_2487;)V
official d
Ldvk;d(Lux;)V
-
setTriggered
public void setTriggered(boolean triggered) - Mappings:
Namespace Name Mixin selector named setTriggered
Lnet/minecraft/block/entity/CrafterBlockEntity;setTriggered(Z)V
intermediary method_54482
Lnet/minecraft/class_8887;method_54482(Z)V
official a
Ldvk;a(Z)V
-
isTriggered
public boolean isTriggered()- Mappings:
Namespace Name Mixin selector named isTriggered
Lnet/minecraft/block/entity/CrafterBlockEntity;isTriggered()Z
intermediary method_54488
Lnet/minecraft/class_8887;method_54488()Z
official k
Ldvk;k()Z
-
tickCrafting
public static void tickCrafting(World world, BlockPos pos, BlockState state, CrafterBlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named tickCrafting
Lnet/minecraft/block/entity/CrafterBlockEntity;tickCrafting(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/CrafterBlockEntity;)V
intermediary method_54481
Lnet/minecraft/class_8887;method_54481(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_8887;)V
official a
Ldvk;a(Ldhh;Ljh;Ldxu;Ldvk;)V
-
setCraftingTicksRemaining
public void setCraftingTicksRemaining(int craftingTicksRemaining) - Mappings:
Namespace Name Mixin selector named setCraftingTicksRemaining
Lnet/minecraft/block/entity/CrafterBlockEntity;setCraftingTicksRemaining(I)V
intermediary method_54484
Lnet/minecraft/class_8887;method_54484(I)V
official d
Ldvk;d(I)V
-
getComparatorOutput
public int getComparatorOutput()- Mappings:
Namespace Name Mixin selector named getComparatorOutput
Lnet/minecraft/block/entity/CrafterBlockEntity;getComparatorOutput()I
intermediary method_54489
Lnet/minecraft/class_8887;method_54489()I
official t
Ldvk;t()I
-
canToggleSlot
private boolean canToggleSlot(int slot) - Mappings:
Namespace Name Mixin selector named canToggleSlot
Lnet/minecraft/block/entity/CrafterBlockEntity;canToggleSlot(I)Z
intermediary method_54485
Lnet/minecraft/class_8887;method_54485(I)Z
official e
Ldvk;e(I)Z
-