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 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

      default List<net.minecraft.resources.ResourceLocation> getModuleDependencies()
      Returns:
      A list of identifiers of the modules this module requires in order to load (Apiculture, Mail, etc.)
    • getModDependencies

      default List<String> 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, use registerClientHandler(java.util.function.Consumer<forestry.api.client.IClientModuleHandler>) and IClientModuleHandler.registerEvents(net.neoforged.bus.api.IEventBus).
      Parameters:
      modBus - The mod-specific event bus for the mod found from the namespace of getId().
    • registerClientHandler

      default void registerClientHandler(Consumer<IClientModuleHandler> registrar)
      Runs at mod construction on the logical client, after registerEvents(net.neoforged.bus.api.IEventBus).
    • setupApi

      @Deprecated default void setupApi()
      Deprecated.
      Note: this is generally not recommended to use. Called during Forestry's common phase. Initialize any static API.
    • registerPackets

      default void registerPackets(IPacketRegistry registry)
    • 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 in getModuleDependencies().
      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

      default void applyClientPluginRegistration(IClientRegistration registration)
      Called during client plugin registration after applyPluginRegistration(). 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.