类 FurnaceFuelBurnTimeEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.furnace.FurnaceFuelBurnTimeEvent
- 所有已实现的接口:
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, FuelValues)
instead.This event is fired from
EventHooks.getItemBurnTime(ItemStack, int, RecipeType, FuelValues)
.This event is
ICancellableEvent
to prevent later handlers from changing the value.This event is fired on the
NeoForge.EVENT_BUS
.-
字段概要
字段修饰符和类型字段说明private int
private final FuelValues
private final ItemStack
private final @Nullable RecipeType
<?> -
构造器概要
构造器构造器说明FurnaceFuelBurnTimeEvent
(ItemStack itemStack, int burnTime, @Nullable RecipeType<?> recipeType, FuelValues fuelValues) -
方法概要
修饰符和类型方法说明int
The resulting value of this event, the burn time for the ItemStack.Get theFuelValues
populated from thedata map
Get the ItemStack "fuel" in question.@Nullable RecipeType
<?> Get the recipe type for which to obtain the burn time, if known.void
setBurnTime
(int burnTime) Set the burn time for the given ItemStack.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
itemStack
-
recipeType
-
fuelValues
-
burnTime
private int burnTime
-
-
构造器详细资料
-
FurnaceFuelBurnTimeEvent
public FurnaceFuelBurnTimeEvent(ItemStack itemStack, int burnTime, @Nullable @Nullable RecipeType<?> recipeType, FuelValues fuelValues)
-
-
方法详细资料
-
getItemStack
Get the ItemStack "fuel" in question. -
getRecipeType
Get the recipe type for which to obtain the burn time, if known. -
getFuelValues
Get theFuelValues
populated from thedata map
-
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.The initial burn time can come from either the
extension method
or thedata map
throughFuelValues
.
-