Klasse BundleManager

java.lang.Object
de.luckymcdev.foundryengine.common.bundle.BundleManager
Alle implementierten Schnittstellen:
net.minecraft.server.packs.resources.PreparableReloadListener, net.minecraft.server.packs.resources.ResourceManagerReloadListener

public class BundleManager extends Object implements net.minecraft.server.packs.resources.ResourceManagerReloadListener
Bundle Manager that manages Bundle Lifecycles.

Script loading is sided:

  • Verschachtelte Klassen - Übersicht

    Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier, net.minecraft.server.packs.resources.PreparableReloadListener.SharedState, net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<T>
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    BundleManager(net.neoforged.bus.api.IEventBus modBus)
     
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    boolean
    Returns true if any bundles have been loaded.
    void
    discover(Path directory)
    Discovers and loads all bundles from the specified directory.
    Retrieves a bundle by its ID.
    List<net.neoforged.fml.ModContainer>
     
     
    Returns all currently loaded bundles.
     
    void
    Loads client-side scripts for all registered bundles.
    void
    Loads server-side scripts for all registered bundles.
    void
    onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager resourceManager)
     
    void
    Rebuilds NeoForge's global loaded-mod list so it reflects the current set of bundle containers.
    void
    register(Bundle bundle)
    Registers a bundle and immediately loads its common-side scripts.
    void
    Reloads all bundles by clearing all script event callbacks, unloading current bundles, rediscovering them from disk, and re-loading common + server scripts.
    void
    remove(Bundle bundle)
    Removes and cleans up a bundle, including closing its ZIP FileSystem if applicable.
    void
    setServer(@Nullable net.minecraft.server.MinecraftServer server)
     

    Von Klasse geerbte Methoden Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Von Schnittstelle geerbte Methoden net.minecraft.server.packs.resources.PreparableReloadListener

    getName, prepareSharedState

    Von Schnittstelle geerbte Methoden net.minecraft.server.packs.resources.ResourceManagerReloadListener

    reload
  • 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 FoundryEngineModClient during client setup.
    • loadServerScripts

      public void loadServerScripts()
      Loads server-side scripts for all registered bundles. Call this from FoundryEngineModServer during server setup.
    • 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()
    • onResourceManagerReload

      public void onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager resourceManager)
      Angegeben von:
      onResourceManagerReload in Schnittstelle net.minecraft.server.packs.resources.ResourceManagerReloadListener