Class AbstractFurnaceBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
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,ICapabilityProvider,ICapabilityProviderImpl<BlockEntity>,IForgeBlockEntity
- 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.DataComponentInputNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int(package private) int(package private) intstatic final intstatic final intstatic final intstatic final intprotected final ContainerData(package private) LazyOptional<? extends IItemHandler>[]protected NonNullList<ItemStack> (package private) int(package private) intstatic final intprivate final RecipeManager.CachedCheck<SingleRecipeInput, ? extends AbstractCookingRecipe> private final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<ResourceLocation> private final RecipeType<? extends AbstractCookingRecipe> protected static final intprotected static final intprotected static final intprivate static final int[]private static final int[]private static final int[]Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFurnaceBlockEntity(BlockEntityType<?> p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType<? extends AbstractCookingRecipe> p_154994_) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate static voidvoidawardUsedRecipes(Player p_58396_, List<ItemStack> p_282202_) voidawardUsedRecipesAndPopExperience(ServerPlayer p_155004_) private booleanburn(RegistryAccess p_266740_, RecipeHolder<?> p_299450_, NonNullList<ItemStack> p_267073_, int p_267157_) private booleancanBurn(RegistryAccess p_266924_, RecipeHolder<?> p_299207_, NonNullList<ItemStack> p_155007_, int p_155008_) booleancanPlaceItem(int p_58389_, ItemStack p_58390_) booleancanPlaceItemThroughFace(int p_58336_, ItemStack p_58337_, Direction p_58338_) booleancanTakeItemThroughFace(int p_58392_, ItemStack p_58393_, Direction p_58394_) private static voidcreateExperience(ServerLevel p_154999_, Vec3 p_155000_, int p_155001_, float p_155002_) voidfillStackedContents(StackedContents p_58342_) protected intgetBurnDuration(ItemStack p_58343_) <T> LazyOptional<T> getCapability(Capability<T> capability, Direction facing) Retrieves the Optional handler for the capability requested on the specific side.intgetFuel()Deprecated.Forge: get burn times by calling ForgeHooks#getBurnTime(ItemStack)protected NonNullList<ItemStack> getItems()List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(ServerLevel p_154996_, Vec3 p_154997_) RecipeHolder<?> int[]getSlotsForFace(Direction p_58363_) private static intgetTotalCookTime(Level p_222693_, AbstractFurnaceBlockEntity p_222694_) static voidvoidstatic booleanprivate booleanisLit()private static booleanisNeverAFurnaceFuel(Item p_58398_) protected voidloadAdditional(CompoundTag p_335441_, HolderLookup.Provider p_330623_) voidprotected voidsaveAdditional(CompoundTag p_187452_, HolderLookup.Provider p_330192_) static voidserverTick(Level p_155014_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_) voidprotected voidsetItems(NonNullList<ItemStack> p_327930_) voidsetRecipeUsed(RecipeHolder<?> p_297739_) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, canUnlock, clearContent, collectImplicitComponents, createMenu, createMenu, createUnSidedHandler, getCustomName, getDefaultName, getDisplayName, getItem, getName, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, stillValidMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onChunkUnloaded, onlyOpCanSetNbt, parseCustomNameSafe, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCapsMethods 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, getItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, isEmpty, removeItem, removeItemNoUpdate, setChanged, startOpen, stillValid, stopOpenMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface net.minecraft.world.Nameable
hasCustomNameMethods 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 -
handlers
LazyOptional<? extends IItemHandler>[] handlers
-
-
Constructor Details
-
AbstractFurnaceBlockEntity
protected AbstractFurnaceBlockEntity(BlockEntityType<?> p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType<? extends AbstractCookingRecipe> p_154994_)
-
-
Method Details
-
invalidateCache
public static void invalidateCache() -
getFuel
Deprecated.Forge: get burn times by calling ForgeHooks#getBurnTime(ItemStack) -
isNeverAFurnaceFuel
-
add
-
add
-
isLit
private boolean isLit() -
loadAdditional
- Overrides:
loadAdditionalin classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBaseContainerBlockEntity
-
serverTick
public static void serverTick(Level p_155014_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_) -
canBurn
private boolean canBurn(RegistryAccess p_266924_, @Nullable RecipeHolder<?> p_299207_, NonNullList<ItemStack> p_155007_, int p_155008_) -
burn
private boolean burn(RegistryAccess p_266740_, @Nullable RecipeHolder<?> p_299450_, NonNullList<ItemStack> p_267073_, int p_267157_) -
getBurnDuration
-
getTotalCookTime
-
isFuel
-
getSlotsForFace
- Specified by:
getSlotsForFacein interfaceWorldlyContainer
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int p_58336_, ItemStack p_58337_, @Nullable Direction p_58338_) - Specified by:
canPlaceItemThroughFacein interfaceWorldlyContainer
-
canTakeItemThroughFace
- Specified by:
canTakeItemThroughFacein interfaceWorldlyContainer
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
getItems
- Specified by:
getItemsin classBaseContainerBlockEntity
-
setItems
- Specified by:
setItemsin classBaseContainerBlockEntity
-
setItem
- Specified by:
setItemin interfaceContainer- Overrides:
setItemin classBaseContainerBlockEntity
-
canPlaceItem
- Specified by:
canPlaceItemin interfaceContainer
-
setRecipeUsed
- Specified by:
setRecipeUsedin interfaceRecipeCraftingHolder
-
getRecipeUsed
- Specified by:
getRecipeUsedin interfaceRecipeCraftingHolder
-
awardUsedRecipes
- Specified by:
awardUsedRecipesin 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:
fillStackedContentsin interfaceStackedContentsCompatible
-
getCapability
Description copied from interface:ICapabilityProviderRetrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapabilityin interfaceICapabilityProvider- Overrides:
getCapabilityin classBaseContainerBlockEntity- Parameters:
capability- The capability to checkfacing- The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'- Returns:
- The requested an optional holding the requested capability.
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCapsin interfaceICapabilityProviderImpl<BlockEntity>- Overrides:
invalidateCapsin classBaseContainerBlockEntity
-
reviveCaps
public void reviveCaps()- Specified by:
reviveCapsin interfaceICapabilityProviderImpl<BlockEntity>- Overrides:
reviveCapsin classBaseContainerBlockEntity
-