Class AbstractFurnaceBlockEntity
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.AbstractFurnaceBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,MenuConstructor
,RecipeCraftingHolder
,StackedContentsCompatible
,MenuProvider
,Nameable
,WorldlyContainer
,IAttachmentHolder
,IMenuProviderExtension
,IBlockEntityExtension
- Direct Known Subclasses:
BlastFurnaceBlockEntity
,FurnaceBlockEntity
,SmokerBlockEntity
public abstract class AbstractFurnaceBlockEntity
extends BaseContainerBlockEntity
implements WorldlyContainer, RecipeCraftingHolder, StackedContentsCompatible
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
(package private) int
(package private) int
static final int
static final int
static final int
static final int
protected final ContainerData
protected NonNullList
<ItemStack> (package private) int
(package private) int
static final int
private final RecipeManager.CachedCheck
<SingleRecipeInput, ? extends AbstractCookingRecipe> private final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
<ResourceLocation> private final RecipeType
<? extends AbstractCookingRecipe> protected static final int
protected static final int
protected static final int
private static final int[]
private static final int[]
private static final int[]
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractFurnaceBlockEntity
(BlockEntityType<?> pType, BlockPos pPos, BlockState pBlockState, RecipeType<? extends AbstractCookingRecipe> pRecipeType) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
add
(ObjIntConsumer<com.mojang.datafixers.util.Either<Item, TagKey<Item>>> consumer, TagKey<Item> tag, int time) private static void
add
(ObjIntConsumer<com.mojang.datafixers.util.Either<Item, TagKey<Item>>> consumer, ItemLike item, int time) private static void
private static void
void
awardUsedRecipes
(Player pPlayer, List<ItemStack> pItems) void
static void
buildFuels
(ObjIntConsumer<com.mojang.datafixers.util.Either<Item, TagKey<Item>>> map1) private static boolean
burn
(RegistryAccess pRegistryAccess, RecipeHolder<?> pRecipe, NonNullList<ItemStack> pInventory, int pMaxStackSize, AbstractFurnaceBlockEntity furnace) private static boolean
canBurn
(RegistryAccess pRegistryAccess, RecipeHolder<?> pRecipe, NonNullList<ItemStack> pInventory, int pMaxStackSize, AbstractFurnaceBlockEntity furnace) boolean
canPlaceItem
(int pIndex, ItemStack pStack) Returnstrue
if automation is allowed to insert the given stack (ignoring stack size) into the given slot.boolean
canPlaceItemThroughFace
(int pIndex, ItemStack pItemStack, Direction pDirection) Returnstrue
if automation can insert the given item in the given slot from the given side.boolean
canTakeItemThroughFace
(int pIndex, ItemStack pStack, Direction pDirection) Returnstrue
if automation can extract the given item in the given slot from the given side.private static void
createExperience
(ServerLevel pLevel, Vec3 pPopVec, int pRecipeIndex, float pExperience) void
fillStackedContents
(StackedContents pHelper) protected int
getBurnDuration
(ItemStack pFuel) int
getFuel()
Deprecated.protected NonNullList
<ItemStack> getItems()
List
<RecipeHolder<?>> getRecipesToAwardAndPopExperience
(ServerLevel pLevel, Vec3 pPopVec) RecipeHolder
<?> int[]
getSlotsForFace
(Direction pSide) private static int
getTotalCookTime
(Level pLevel, AbstractFurnaceBlockEntity pBlockEntity) static void
static boolean
private boolean
isLit()
private static boolean
isNeverAFurnaceFuel
(Item pItem) protected void
loadAdditional
(CompoundTag pTag, HolderLookup.Provider pRegistries) protected void
saveAdditional
(CompoundTag pTag, HolderLookup.Provider pRegistries) static void
serverTick
(Level pLevel, BlockPos pPos, BlockState pState, AbstractFurnaceBlockEntity pBlockEntity) void
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).protected void
setItems
(NonNullList<ItemStack> pItems) void
setRecipeUsed
(RecipeHolder<?> pRecipe) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, canUnlock, clearContent, collectImplicitComponents, createMenu, createMenu, getCustomName, getDefaultName, getDisplayName, getItem, getName, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, stillValid
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Clearable
clearContent
Methods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, isEmpty, removeItem, removeItemNoUpdate, setChanged, startOpen, stillValid, stopOpen
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
Methods inherited from interface net.minecraft.world.inventory.RecipeCraftingHolder
setRecipeUsed
-
Field Details
-
SLOT_INPUT
protected static final int SLOT_INPUT- See Also:
-
SLOT_FUEL
protected static final int SLOT_FUEL- See Also:
-
SLOT_RESULT
protected static final int SLOT_RESULT- See Also:
-
DATA_LIT_TIME
public static final int DATA_LIT_TIME- See Also:
-
SLOTS_FOR_UP
private static final int[] SLOTS_FOR_UP -
SLOTS_FOR_DOWN
private static final int[] SLOTS_FOR_DOWN -
SLOTS_FOR_SIDES
private static final int[] SLOTS_FOR_SIDES -
DATA_LIT_DURATION
public static final int DATA_LIT_DURATION- See Also:
-
DATA_COOKING_PROGRESS
public static final int DATA_COOKING_PROGRESS- See Also:
-
DATA_COOKING_TOTAL_TIME
public static final int DATA_COOKING_TOTAL_TIME- See Also:
-
NUM_DATA_VALUES
public static final int NUM_DATA_VALUES- See Also:
-
BURN_TIME_STANDARD
public static final int BURN_TIME_STANDARD- See Also:
-
BURN_COOL_SPEED
public static final int BURN_COOL_SPEED- See Also:
-
recipeType
-
items
-
litTime
int litTime -
litDuration
int litDuration -
cookingProgress
int cookingProgress -
cookingTotalTime
int cookingTotalTime -
fuelCache
-
dataAccess
-
recipesUsed
-
quickCheck
private final RecipeManager.CachedCheck<SingleRecipeInput,? extends AbstractCookingRecipe> quickCheck
-
-
Constructor Details
-
AbstractFurnaceBlockEntity
protected AbstractFurnaceBlockEntity(BlockEntityType<?> pType, BlockPos pPos, BlockState pBlockState, RecipeType<? extends AbstractCookingRecipe> pRecipeType)
-
-
Method Details
-
invalidateCache
public static void invalidateCache() -
getFuel
Deprecated.Neo: get burn times by callingIItemStackExtension.getBurnTime(RecipeType)
-
add
private static void add(ObjIntConsumer<com.mojang.datafixers.util.Either<Item, TagKey<Item>>> consumer, ItemLike item, int time) -
add
-
buildFuels
@Internal public static void buildFuels(ObjIntConsumer<com.mojang.datafixers.util.Either<Item, TagKey<Item>>> map1) -
isNeverAFurnaceFuel
-
add
-
add
-
isLit
private boolean isLit() -
loadAdditional
- Overrides:
loadAdditional
in classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBaseContainerBlockEntity
-
serverTick
public static void serverTick(Level pLevel, BlockPos pPos, BlockState pState, AbstractFurnaceBlockEntity pBlockEntity) -
canBurn
private static boolean canBurn(RegistryAccess pRegistryAccess, @Nullable RecipeHolder<?> pRecipe, NonNullList<ItemStack> pInventory, int pMaxStackSize, AbstractFurnaceBlockEntity furnace) -
burn
private static boolean burn(RegistryAccess pRegistryAccess, @Nullable RecipeHolder<?> pRecipe, NonNullList<ItemStack> pInventory, int pMaxStackSize, AbstractFurnaceBlockEntity furnace) -
getBurnDuration
-
getTotalCookTime
-
isFuel
-
getSlotsForFace
- Specified by:
getSlotsForFace
in interfaceWorldlyContainer
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int pIndex, ItemStack pItemStack, @Nullable Direction pDirection) Returnstrue
if automation can insert the given item in the given slot from the given side.- Specified by:
canPlaceItemThroughFace
in interfaceWorldlyContainer
-
canTakeItemThroughFace
Returnstrue
if automation can extract the given item in the given slot from the given side.- Specified by:
canTakeItemThroughFace
in interfaceWorldlyContainer
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
getItems
- Specified by:
getItems
in classBaseContainerBlockEntity
-
setItems
- Specified by:
setItems
in classBaseContainerBlockEntity
-
setItem
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).- Specified by:
setItem
in interfaceContainer
- Overrides:
setItem
in classBaseContainerBlockEntity
-
canPlaceItem
Returnstrue
if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid- Specified by:
canPlaceItem
in interfaceContainer
-
setRecipeUsed
- Specified by:
setRecipeUsed
in interfaceRecipeCraftingHolder
-
getRecipeUsed
- Specified by:
getRecipeUsed
in interfaceRecipeCraftingHolder
-
awardUsedRecipes
- Specified by:
awardUsedRecipes
in interfaceRecipeCraftingHolder
-
awardUsedRecipesAndPopExperience
-
getRecipesToAwardAndPopExperience
-
createExperience
private static void createExperience(ServerLevel pLevel, Vec3 pPopVec, int pRecipeIndex, float pExperience) -
fillStackedContents
- Specified by:
fillStackedContents
in interfaceStackedContentsCompatible
-
IItemStackExtension.getBurnTime(RecipeType)