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:
Iterable<ItemStack>
,Clearable
,Container
,MenuConstructor
,RecipeCraftingHolder
,StackedContentsCompatible
,MenuProvider
,Nameable
,WorldlyContainer
,IAttachmentHolder
,IBlockEntityExtension
,IMenuProviderExtension
- 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
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.Container
Container.ContainerIterator
-
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
private static final short
private static final short
private static final short
private static final short
protected NonNullList
<ItemStack> (package private) int
(package private) int
static final int
private final RecipeManager.CachedCheck
<SingleRecipeInput, ? extends AbstractCookingRecipe> private static final com.mojang.serialization.Codec
<Map<ResourceKey<Recipe<?>>, Integer>> private final it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap
<ResourceKey<Recipe<?>>> 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<?> p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType<? extends AbstractCookingRecipe> p_154994_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
awardUsedRecipes
(Player p_58396_, List<ItemStack> p_282202_) void
awardUsedRecipesAndPopExperience
(ServerPlayer p_155004_) private static boolean
burn
(RegistryAccess p_266740_, RecipeHolder<? extends AbstractCookingRecipe> p_300910_, SingleRecipeInput p_380269_, NonNullList<ItemStack> p_267073_, int p_267157_) private static boolean
canBurn
(RegistryAccess p_266924_, RecipeHolder<? extends AbstractCookingRecipe> p_301107_, SingleRecipeInput p_380038_, NonNullList<ItemStack> p_155007_, int p_155008_) boolean
canPlaceItem
(int p_58389_, ItemStack p_58390_) boolean
canPlaceItemThroughFace
(int p_58336_, ItemStack p_58337_, Direction p_58338_) boolean
canTakeItemThroughFace
(int p_58392_, ItemStack p_58393_, Direction p_58394_) private static void
createExperience
(ServerLevel p_154999_, Vec3 p_155000_, int p_155001_, float p_155002_) void
fillStackedContents
(StackedItemContents p_363281_) protected int
getBurnDuration
(FuelValues p_363501_, ItemStack p_58343_) int
protected NonNullList
<ItemStack> getItems()
List
<RecipeHolder<?>> getRecipesToAwardAndPopExperience
(ServerLevel p_154996_, Vec3 p_154997_) RecipeHolder
<?> int[]
getSlotsForFace
(Direction p_58363_) private static int
getTotalCookTime
(ServerLevel p_380169_, AbstractFurnaceBlockEntity p_222694_) private boolean
isLit()
protected void
loadAdditional
(CompoundTag p_155025_, HolderLookup.Provider p_323468_) void
preRemoveSideEffects
(BlockPos p_393693_, BlockState p_393780_) protected void
saveAdditional
(CompoundTag p_187452_, HolderLookup.Provider p_323656_) static void
serverTick
(ServerLevel p_379747_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_) void
protected void
setItems
(NonNullList<ItemStack> p_332808_) void
setRecipeUsed
(RecipeHolder<?> p_301245_) 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, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, 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, iterator, 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, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
Methods inherited from interface net.neoforged.neoforge.common.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData
Methods inherited from interface java.lang.Iterable
forEach, spliterator
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:
-
RECIPES_USED_CODEC
private static final com.mojang.serialization.Codec<Map<ResourceKey<Recipe<?>>,Integer>> RECIPES_USED_CODEC -
DEFAULT_COOKING_TIMER
private static final short DEFAULT_COOKING_TIMER- See Also:
-
DEFAULT_COOKING_TOTAL_TIME
private static final short DEFAULT_COOKING_TOTAL_TIME- See Also:
-
DEFAULT_LIT_TIME_REMAINING
private static final short DEFAULT_LIT_TIME_REMAINING- See Also:
-
DEFAULT_LIT_TOTAL_TIME
private static final short DEFAULT_LIT_TOTAL_TIME- See Also:
-
items
-
litTimeRemaining
int litTimeRemaining -
litTotalTime
int litTotalTime -
cookingTimer
int cookingTimer -
cookingTotalTime
int cookingTotalTime -
dataAccess
-
recipesUsed
private final it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap<ResourceKey<Recipe<?>>> recipesUsed -
quickCheck
private final RecipeManager.CachedCheck<SingleRecipeInput,? extends AbstractCookingRecipe> quickCheck -
recipeType
-
-
Constructor Details
-
AbstractFurnaceBlockEntity
protected AbstractFurnaceBlockEntity(BlockEntityType<?> p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType<? extends AbstractCookingRecipe> p_154994_)
-
-
Method Details
-
isLit
private boolean isLit() -
loadAdditional
- Overrides:
loadAdditional
in classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBaseContainerBlockEntity
-
serverTick
public static void serverTick(ServerLevel p_379747_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_) -
canBurn
private static boolean canBurn(RegistryAccess p_266924_, @Nullable RecipeHolder<? extends AbstractCookingRecipe> p_301107_, SingleRecipeInput p_380038_, NonNullList<ItemStack> p_155007_, int p_155008_) -
burn
private static boolean burn(RegistryAccess p_266740_, @Nullable RecipeHolder<? extends AbstractCookingRecipe> p_300910_, SingleRecipeInput p_380269_, NonNullList<ItemStack> p_267073_, int p_267157_) -
getBurnDuration
-
getTotalCookTime
-
getSlotsForFace
- Specified by:
getSlotsForFace
in interfaceWorldlyContainer
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int p_58336_, ItemStack p_58337_, @Nullable Direction p_58338_) - Specified by:
canPlaceItemThroughFace
in interfaceWorldlyContainer
-
canTakeItemThroughFace
- 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
- Specified by:
setItem
in interfaceContainer
- Overrides:
setItem
in classBaseContainerBlockEntity
-
canPlaceItem
- 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
public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(ServerLevel p_154996_, Vec3 p_154997_) -
createExperience
private static void createExperience(ServerLevel p_154999_, Vec3 p_155000_, int p_155001_, float p_155002_) -
fillStackedContents
- Specified by:
fillStackedContents
in interfaceStackedContentsCompatible
-
preRemoveSideEffects
- Overrides:
preRemoveSideEffects
in classBlockEntity
-