Fuel
dev.architectury.registry.fuel.FuelRegistry
Make items usable as furnace fuel, or change the burn time of existing items.
Registering a burn time
// Make ruby burn for 200 ticks (the same as a plank):
FuelRegistry.register(200, MyMod.RUBY.get());
// You can pass several items at once:
FuelRegistry.register(1600, MyMod.COAL_CHUNK.get(), MyMod.CHARCOAL_CHUNK.get());
The first argument is the burn time in ticks. Two values are special:
0- mark the item as not a fuel.-1- fall back to vanilla logic for that item.
Call this from your common initializer.
Smelting speed
An overload takes a speed multiplier, controlling how fast the fuel smelts. 1.0 is the normal
speed, so register(int, ItemLike...) is equivalent to passing 1.0F.
// Ruby burns for 200 ticks and smelts twice as fast:
FuelRegistry.register(200, 2.0F, MyMod.RUBY.get());
Reading a burn time
FuelRegistry.get(ItemStack stack, ServerLevel level) returns the burn time of a stack (or 0 if
it isn't a fuel), taking registered overrides into account. The level is used to resolve the stack's
cooking fuel component.
Changed in 22.0
get previously took a RecipeType<?> and a FuelValues. Both were replaced by the ServerLevel
in Architectury API 22.0.