Class FurnaceFuelBurnTimeEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.furnace.FurnaceFuelBurnTimeEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class FurnaceFuelBurnTimeEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
FurnaceFuelBurnTimeEvent is fired when determining the fuel value for an ItemStack. To set the burn time of your own item, use
IItemExtension.getBurnTime(ItemStack, RecipeType) instead.This event is fired from
EventHooks.getItemBurnTime(ItemStack, int, RecipeType).This event is
ICancellableEvent to prevent later handlers from changing the value.This event does not have a result.
Event.HasResultThis event is fired on the
NeoForge.EVENT_BUS.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.bus.api.Event
net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final @NotNull ItemStackprivate final @Nullable RecipeType<?> -
Constructor Summary
ConstructorsConstructorDescriptionFurnaceFuelBurnTimeEvent(@NotNull ItemStack itemStack, int burnTime, @Nullable RecipeType<?> recipeType) -
Method Summary
Modifier and TypeMethodDescriptionintThe resulting value of this event, the burn time for the ItemStack.@NotNull ItemStackGet the ItemStack "fuel" in question.@Nullable RecipeType<?>Get the recipe type for which to obtain the burn time, if known.voidsetBurnTime(int burnTime) Set the burn time for the given ItemStack.Methods inherited from class net.neoforged.bus.api.Event
getResult, hasResult, setResultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
itemStack
-
recipeType
-
burnTime
private int burnTime
-
-
Constructor Details
-
FurnaceFuelBurnTimeEvent
public FurnaceFuelBurnTimeEvent(@NotNull @NotNull ItemStack itemStack, int burnTime, @Nullable @Nullable RecipeType<?> recipeType)
-
-
Method Details
-
getItemStack
Get the ItemStack "fuel" in question. -
getRecipeType
Get the recipe type for which to obtain the burn time, if known. -
setBurnTime
public void setBurnTime(int burnTime) Set the burn time for the given ItemStack. Setting it to 0 will prevent the item from being used as fuel, overriding vanilla's decision. -
getBurnTime
public int getBurnTime()The resulting value of this event, the burn time for the ItemStack. A value of 0 will prevent the item from being used as fuel, overriding vanilla's decision.
-