Package forestry.api.modules
Interface IForestryModule
public interface IForestryModule
IF YOU WANT TO ADD BEE SPECIES, FORESTRY COMPATIBILITY, ETC. USE A
IForestryPlugin.
The entry point for a Forestry module. Your mod probably doesn't need this, but it's here if you want to use it.
Must be annotated by ForestryModule to be loaded and must have an empty constructor.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidapplyClientPluginRegistration(IClientRegistration registration) Called during client plugin registration afterapplyPluginRegistration().default voidCalled after item registration, in module load order.net.minecraft.resources.ResourceLocationgetId()default List<net.minecraft.resources.ResourceLocation> default booleanisCore()default voidregisterClientHandler(Consumer<IClientModuleHandler> registrar) Runs at mod construction on the logical client, afterregisterEvents(net.neoforged.bus.api.IEventBus).default voidregisterEvents(net.neoforged.bus.api.IEventBus modBus) Called during mod construction, allowing modules to subscribe to mod bus events using their mod's event bus.default voidregisterPackets(IPacketRegistry registry) default voidregisterReloadListeners(net.neoforged.neoforge.event.AddReloadListenerEvent event) Called when the server gathers its datapack reload listeners.default voidsendDatapackData(net.neoforged.neoforge.event.OnDatapackSyncEvent event) Send datapack data to clients here.default voidsetupApi()Deprecated.
-
Method Details
-
getId
net.minecraft.resources.ResourceLocation getId()- Returns:
- The unique identifier for this module. The namespace should be the modid of the mod adding this module.
-
getModuleDependencies
- Returns:
- A list of identifiers of the modules this module requires in order to load (Apiculture, Mail, etc.)
-
getModDependencies
- Returns:
- A list of identifiers of the mods this module requires in order to load (IC2, BuildCraft, etc.)
-
registerEvents
default void registerEvents(net.neoforged.bus.api.IEventBus modBus) Called during mod construction, allowing modules to subscribe to mod bus events using their mod's event bus. For client-only events, useregisterClientHandler(java.util.function.Consumer<forestry.api.client.IClientModuleHandler>)andIClientModuleHandler.registerEvents(net.neoforged.bus.api.IEventBus).- Parameters:
modBus- The mod-specific event bus for the mod found from the namespace ofgetId().
-
registerClientHandler
Runs at mod construction on the logical client, afterregisterEvents(net.neoforged.bus.api.IEventBus). -
setupApi
Deprecated.Note: this is generally not recommended to use. Called during Forestry's common phase. Initialize any static API. -
registerPackets
-
registerReloadListeners
default void registerReloadListeners(net.neoforged.neoforge.event.AddReloadListenerEvent event) Called when the server gathers its datapack reload listeners. Modules add their own data loaders here. Called in module load order, so a module's data may depend on data loaded by any module it names ingetModuleDependencies().- Parameters:
event- The reload listener registration event
-
sendDatapackData
default void sendDatapackData(net.neoforged.neoforge.event.OnDatapackSyncEvent event) Send datapack data to clients here. Called after taxa and flower types are synced.Data-driven parts of the genetics system are sent via this method. This includes bee effects, bee species, tree species, and butterfly species. It does not include code-only parts of the genetic system, such as tree effects or fruit types.
- Parameters:
event- The datapack sync event, fired when a player joins the server or /reload is ran, before tags/recipes
-
applyPluginRegistration
default void applyPluginRegistration()Called after item registration, in module load order. Used to register IFlowerTypeManager, IFarmingManger, etc. -
applyClientPluginRegistration
Called during client plugin registration afterapplyPluginRegistration(). Modules build their client manager from the assembled registration and install it here.- Parameters:
registration- The completed client registration
-
isCore
default boolean isCore()- Returns:
- If this module is a "core" module, a dependency of all other modules added by this mod. Loads before other modules.
-