Package forestry.api.plugin
Interface IFarmingRegistration
public interface IFarmingRegistration
Register farm related data here.
Obtain an instance from
IForestryPlugin.registerFarming(forestry.api.plugin.IFarmingRegistration).-
Method Summary
Modifier and TypeMethodDescriptioncreateFarmType(net.minecraft.resources.ResourceLocation id, BiFunction<IFarmType, Boolean, IFarmLogic> logicFactory, net.minecraft.world.item.ItemStack icon) Creates a new farm type.voidmodifyFarmType(net.minecraft.resources.ResourceLocation id, Consumer<IFarmTypeBuilder> action) Modifies an existing farm type.voidregisterFertilizer(net.minecraft.world.item.Item fertilizer, int amount) Registers a new fertilizer item for use in the Forestry farms.
-
Method Details
-
createFarmType
IFarmTypeBuilder createFarmType(net.minecraft.resources.ResourceLocation id, BiFunction<IFarmType, Boolean, IFarmLogic> logicFactory, net.minecraft.world.item.ItemStack icon) Creates a new farm type. CallingIFarmTypeBuilder.setFertilizerConsumption(int)andIFarmTypeBuilder.setWaterConsumption(int)is required.- Parameters:
id- The unique ID of the farm type. SeeForestryFarmTypesfor defaults.logicFactory- The factory for creating IFarmLogic instances. The boolean is whether the logic should be manual.icon- The item- Returns:
- A builder to customize the properties of this farm type.
-
modifyFarmType
Modifies an existing farm type.- Parameters:
id- The ID of the farm type to modify. SeeForestryFarmTypesfor defaults.action- The modifications to this farm type.
-
registerFertilizer
void registerFertilizer(net.minecraft.world.item.Item fertilizer, int amount) Registers a new fertilizer item for use in the Forestry farms. By default, the only fertilizer is the Forestry fertilizer, which is worth500.- Parameters:
fertilizer- The ingredient to match items against.amount- The amount of fertilizer a single item is worth. Forestry's fertilizer is worth500.
-