Klasse BundleManager

java.lang.Object
de.luckymcdev.foundryengine.bundle.common.BundleManager

public class BundleManager extends Object
Bundle Manager that manages Bundle Lifecycles.

Script loading is sided:

  • Konstruktordetails

    • BundleManager

      public BundleManager(net.neoforged.bus.api.IEventBus modBus)
  • Methodendetails

    • setServer

      public void setServer(@Nullable net.minecraft.server.MinecraftServer server)
    • register

      public void register(Bundle bundle)
      Registers a bundle and immediately loads its common-side scripts.
    • getBundleContainers

      public List<net.neoforged.fml.ModContainer> getBundleContainers()
    • refreshModList

      public void refreshModList()
      Rebuilds NeoForge's global loaded-mod list so it reflects the current set of bundle containers. The construct-mod event only runs once, so without this the list would keep stale BundleModContainers after a reload.
    • loadClientScripts

      public void loadClientScripts()
      Loads client-side scripts for all registered bundles. Call this from ClientMod during client setup.
    • loadServerScripts

      public void loadServerScripts()
      Loads server-side scripts for all registered bundles. Call this from ServerMod during server setup.
    • reportScriptErrors

      public void reportScriptErrors()
    • remove

      public void remove(Bundle bundle)
      Removes and cleans up a bundle, including closing its ZIP FileSystem if applicable.
    • discover

      public void discover(Path directory) throws IOException
      Discovers and loads all bundles from the specified directory.
      Löst aus:
      IOException
    • getBundles

      public Collection<Bundle> getBundles()
      Returns all currently loaded bundles.
    • getBundle

      public Bundle getBundle(String id)
      Retrieves a bundle by its ID.
    • anyBundles

      public boolean anyBundles()
      Returns true if any bundles have been loaded.
    • reload

      public void reload()
      Reloads all bundles by clearing all script event callbacks, unloading current bundles, rediscovering them from disk, and re-loading common + server scripts.
    • getLifecycleDispatcher

      public BundleLifecycleDispatcher getLifecycleDispatcher()
    • getBundleDiscovery

      public BundleDiscovery getBundleDiscovery()