Class CrafterBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
net.minecraft.world.level.block.entity.CrafterBlockEntity
- All Implemented Interfaces:
Iterable<ItemStack>,DebugValueSource,Clearable,Container,CraftingContainer,MenuConstructor,StackedContentsCompatible,MenuProvider,Nameable,RandomizableContainer,IAttachmentHolder,ContainerExtension,IBlockEntityExtension,IMenuProviderExtension
public class CrafterBlockEntity
extends RandomizableContainerBlockEntity
implements CraftingContainer
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.BlockEntityPathElementNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.world.Container
Container.ContainerIteratorNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprotected final ContainerDataprivate intstatic final intprivate static final intprivate static final Componentprivate static final intprivate NonNullList<ItemStack> static final intstatic final intstatic final intFields inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
lootTable, lootTableSeedFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface net.minecraft.world.RandomizableContainer
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddDisabledSlots(ValueOutput pOutput) private voidaddTriggered(ValueOutput pOutput) booleancanPlaceItem(int p_307543_, ItemStack p_307267_) Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot.protected AbstractContainerMenucreateMenu(int p_307441_, Inventory p_307664_) voidfillStackedContents(StackedItemContents p_364629_) intprotected ComponentintgetItem(int p_307189_) Returns the stack in the given slot.getItems()intintgetWidth()booleanisEmpty()booleanisSlotDisabled(int pSlot) booleanprotected voidloadAdditional(ValueInput p_421579_) protected voidsaveAdditional(ValueOutput p_422000_) static voidserverTick(Level pLevel, BlockPos pPos, BlockState pState, CrafterBlockEntity pCrafter) voidsetCraftingTicksRemaining(int pCraftingTicksRemaining) voidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).protected voidsetItems(NonNullList<ItemStack> p_307392_) voidsetSlotState(int pSlot, boolean pState) voidsetTriggered(boolean pTriggered) private booleanslotCanBeDisabled(int pSlot) private booleansmallerStackExist(int pCurrentSize, ItemStack pStack, int pSlot) booleanstillValid(Player p_307443_) Don't rename this method to canInteractWith due to conflicts with ContainerMethods inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getLootTable, getLootTableSeed, removeComponentsFromTag, removeItem, removeItemNoUpdate, setLootTable, setLootTableSeedMethods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
canUnlock, clearContent, getCustomName, getDisplayName, getName, isLocked, setItemMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Clearable
clearContentMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, iterator, removeItem, removeItemNoUpdate, setChanged, startOpen, stopOpenMethods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension
onTransfer, setItemMethods inherited from interface net.minecraft.world.inventory.CraftingContainer
asCraftInput, asPositionedCraftInputMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface net.neoforged.neoforge.common.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideDataMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.Nameable
getPlainTextName, hasCustomNameMethods inherited from interface net.minecraft.world.RandomizableContainer
getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTable
-
Field Details
-
CONTAINER_WIDTH
public static final int CONTAINER_WIDTH- See Also:
-
CONTAINER_HEIGHT
public static final int CONTAINER_HEIGHT- See Also:
-
CONTAINER_SIZE
public static final int CONTAINER_SIZE- See Also:
-
SLOT_DISABLED
public static final int SLOT_DISABLED- See Also:
-
SLOT_ENABLED
public static final int SLOT_ENABLED- See Also:
-
DATA_TRIGGERED
public static final int DATA_TRIGGERED- See Also:
-
NUM_DATA
public static final int NUM_DATA- See Also:
-
DEFAULT_CRAFTING_TICKS_REMAINING
private static final int DEFAULT_CRAFTING_TICKS_REMAINING- See Also:
-
DEFAULT_TRIGGERED
private static final int DEFAULT_TRIGGERED- See Also:
-
DEFAULT_NAME
-
items
-
craftingTicksRemaining
private int craftingTicksRemaining -
containerData
-
-
Constructor Details
-
CrafterBlockEntity
-
-
Method Details
-
getDefaultName
- Specified by:
getDefaultNamein classBaseContainerBlockEntity
-
createMenu
- Specified by:
createMenuin classBaseContainerBlockEntity
-
setSlotState
public void setSlotState(int pSlot, boolean pState) -
isSlotDisabled
public boolean isSlotDisabled(int pSlot) -
canPlaceItem
Description copied from interface:ContainerReturnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid- Specified by:
canPlaceItemin interfaceContainer
-
smallerStackExist
-
loadAdditional
- Overrides:
loadAdditionalin classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBaseContainerBlockEntity
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceContainer- Overrides:
isEmptyin classRandomizableContainerBlockEntity
-
getItem
Description copied from interface:ContainerReturns the stack in the given slot.- Specified by:
getItemin interfaceContainer- Overrides:
getItemin classRandomizableContainerBlockEntity
-
setItem
Description copied from interface:ContainerSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).- Specified by:
setItemin interfaceContainer- Overrides:
setItemin classRandomizableContainerBlockEntity
-
stillValid
Description copied from interface:ContainerDon't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValidin interfaceContainer- Overrides:
stillValidin classBaseContainerBlockEntity
-
getItems
- Specified by:
getItemsin interfaceCraftingContainer- Specified by:
getItemsin classBaseContainerBlockEntity
-
setItems
- Specified by:
setItemsin classBaseContainerBlockEntity
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceCraftingContainer
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceCraftingContainer
-
fillStackedContents
- Specified by:
fillStackedContentsin interfaceStackedContentsCompatible
-
addDisabledSlots
-
addTriggered
-
setTriggered
public void setTriggered(boolean pTriggered) -
isTriggered
public boolean isTriggered() -
serverTick
public static void serverTick(Level pLevel, BlockPos pPos, BlockState pState, CrafterBlockEntity pCrafter) -
setCraftingTicksRemaining
public void setCraftingTicksRemaining(int pCraftingTicksRemaining) -
getRedstoneSignal
public int getRedstoneSignal() -
slotCanBeDisabled
private boolean slotCanBeDisabled(int pSlot)
-