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
,RecipeHolder
,StackedContentsCompatible
,MenuProvider
,Nameable
,WorldlyContainer
,ICapabilityProvider
,ICapabilitySerializable<CompoundTag>
,IForgeBlockEntity
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
BlastFurnaceBlockEntity
,FurnaceBlockEntity
,SmokerBlockEntity
public abstract class AbstractFurnaceBlockEntity
extends BaseContainerBlockEntity
implements WorldlyContainer, RecipeHolder, StackedContentsCompatible
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static int
(package private) int
(package private) int
static int
static int
static int
static int
protected ContainerData
(package private) LazyOptional<? extends IItemHandler>[]
protected NonNullList<ItemStack>
(package private) int
(package private) int
static int
private it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<ResourceLocation>
private RecipeType<? extends AbstractCookingRecipe>
protected static int
protected static int
protected static int
private static int[]
private static int[]
private static int[]
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraft.world.Container
LARGE_MAX_STACK_SIZE
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractFurnaceBlockEntity(BlockEntityType<?> p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType<? extends AbstractCookingRecipe> p_154994_)
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
private static void
void
awardUsedRecipes(Player p_58396_)
void
awardUsedRecipesAndPopExperience(ServerPlayer p_155004_)
private boolean
burn(Recipe<?> p_155027_, NonNullList<ItemStack> p_155028_, int p_155029_)
private boolean
canBurn(Recipe<?> p_155006_, 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_)
void
private static void
createExperience(ServerLevel p_154999_, Vec3 p_155000_, int p_155001_, float p_155002_)
void
fillStackedContents(StackedContents p_58342_)
protected int
getBurnDuration(ItemStack p_58343_)
<T> LazyOptional<T>
getCapability(Capability<T> capability, Direction facing)
Retrieves the Optional handler for the capability requested on the specific side.int
getFuel()
Deprecated.Forge: get burn times by calling ForgeHooks#getBurnTime(ItemStack)getItem(int p_58328_)
getRecipesToAwardAndPopExperience(ServerLevel p_154996_, Vec3 p_154997_)
Recipe<?>
int[]
getSlotsForFace(Direction p_58363_)
private static int
getTotalCookTime(Level p_155010_, RecipeType<? extends AbstractCookingRecipe> p_155011_, Container p_155012_)
void
boolean
isEmpty()
static boolean
private boolean
isLit()
private static boolean
isNeverAFurnaceFuel(Item p_58398_)
void
load(CompoundTag p_155025_)
removeItem(int p_58330_, int p_58331_)
removeItemNoUpdate(int p_58387_)
void
save(CompoundTag p_58379_)
static void
serverTick(Level p_155014_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_)
void
void
setRecipeUsed(Recipe<?> p_58345_)
boolean
stillValid(Player p_58340_)
Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
canOpen, canUnlock, createMenu, createMenu, createUnSidedHandler, getCustomName, getDefaultName, getDisplayName, getName, setCustomName
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
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.Container
countItem, getMaxStackSize, hasAnyOf, setChanged, startOpen, stopOpen
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
Methods inherited from interface net.minecraft.world.inventory.RecipeHolder
setRecipeUsed
-
Field Details
-
SLOT_INPUT
protected static final int SLOT_INPUT- See Also:
- Constant Field Values
-
SLOT_FUEL
protected static final int SLOT_FUEL- See Also:
- Constant Field Values
-
SLOT_RESULT
protected static final int SLOT_RESULT- See Also:
- Constant Field Values
-
DATA_LIT_TIME
public static final int DATA_LIT_TIME- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
DATA_COOKING_PROGRESS
public static final int DATA_COOKING_PROGRESS- See Also:
- Constant Field Values
-
DATA_COOKING_TOTAL_TIME
public static final int DATA_COOKING_TOTAL_TIME- See Also:
- Constant Field Values
-
NUM_DATA_VALUES
public static final int NUM_DATA_VALUES- See Also:
- Constant Field Values
-
BURN_TIME_STANDARD
public static final int BURN_TIME_STANDARD- See Also:
- Constant Field Values
-
BURN_COOL_SPEED
public static final int BURN_COOL_SPEED- See Also:
- Constant Field Values
-
items
-
litTime
int litTime -
litDuration
int litDuration -
cookingProgress
int cookingProgress -
cookingTotalTime
int cookingTotalTime -
dataAccess
-
recipesUsed
-
recipeType
-
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
-
getFuel
Deprecated.Forge: get burn times by calling ForgeHooks#getBurnTime(ItemStack) -
isNeverAFurnaceFuel
-
add
-
add
-
isLit
private boolean isLit() -
load
- Overrides:
load
in classBaseContainerBlockEntity
-
save
- Overrides:
save
in classBaseContainerBlockEntity
-
serverTick
public static void serverTick(Level p_155014_, BlockPos p_155015_, BlockState p_155016_, AbstractFurnaceBlockEntity p_155017_) -
canBurn
private boolean canBurn(@Nullable Recipe<?> p_155006_, NonNullList<ItemStack> p_155007_, int p_155008_) -
burn
private boolean burn(@Nullable Recipe<?> p_155027_, NonNullList<ItemStack> p_155028_, int p_155029_) -
getBurnDuration
-
getTotalCookTime
private static int getTotalCookTime(Level p_155010_, RecipeType<? extends AbstractCookingRecipe> p_155011_, Container p_155012_) -
isFuel
-
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
-
isEmpty
public boolean isEmpty() -
getItem
-
removeItem
- Specified by:
removeItem
in interfaceContainer
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceContainer
-
setItem
-
stillValid
- Specified by:
stillValid
in interfaceContainer
-
canPlaceItem
- Specified by:
canPlaceItem
in interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceClearable
-
setRecipeUsed
- Specified by:
setRecipeUsed
in interfaceRecipeHolder
-
getRecipeUsed
- Specified by:
getRecipeUsed
in interfaceRecipeHolder
-
awardUsedRecipes
- Specified by:
awardUsedRecipes
in interfaceRecipeHolder
-
awardUsedRecipesAndPopExperience
-
getRecipesToAwardAndPopExperience
-
createExperience
private static void createExperience(ServerLevel p_154999_, Vec3 p_155000_, int p_155001_, float p_155002_) -
fillStackedContents
- Specified by:
fillStackedContents
in interfaceStackedContentsCompatible
-
getCapability
Description copied from interface:ICapabilityProvider
Retrieves 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:
getCapability
in interfaceICapabilityProvider
- Overrides:
getCapability
in 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()- Overrides:
invalidateCaps
in classBaseContainerBlockEntity
-
reviveCaps
public void reviveCaps()- Overrides:
reviveCaps
in classBaseContainerBlockEntity
-