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:
register(Bundle)always loads common scripts.loadClientScripts()must be called from the client dist entrypoint.loadServerScripts()must be called from the server dist entrypoint.
-
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 -
Methodenübersicht
Modifikator und TypMethodeBeschreibungbooleanReturns true if any bundles have been loaded.voidDiscovers and loads all bundles from the specified directory.Retrieves a bundle by its ID.List<net.neoforged.fml.ModContainer> Returns all currently loaded bundles.voidLoads client-side scripts for all registered bundles.voidLoads server-side scripts for all registered bundles.voidonResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager resourceManager) voidRebuilds NeoForge's global loaded-mod list so it reflects the current set of bundle containers.voidRegisters a bundle and immediately loads its common-side scripts.voidreload()Reloads all bundles by clearing all script event callbacks, unloading current bundles, rediscovering them from disk, and re-loading common + server scripts.voidRemoves and cleans up a bundle, including closing its ZIP FileSystem if applicable.voidsetServer(@Nullable net.minecraft.server.MinecraftServer server) Von Klasse geerbte Methoden Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedStateVon 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
Registers a bundle and immediately loads its common-side scripts. -
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 staleBundleModContainers after a reload. -
loadClientScripts
public void loadClientScripts()Loads client-side scripts for all registered bundles. Call this fromFoundryEngineModClientduring client setup. -
loadServerScripts
public void loadServerScripts()Loads server-side scripts for all registered bundles. Call this fromFoundryEngineModServerduring server setup. -
remove
Removes and cleans up a bundle, including closing its ZIP FileSystem if applicable. -
discover
Discovers and loads all bundles from the specified directory.- Löst aus:
IOException
-
getBundles
Returns all currently loaded bundles. -
getBundle
-
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
-
getBundleDiscovery
-
onResourceManagerReload
public void onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager resourceManager) - Angegeben von:
onResourceManagerReloadin Schnittstellenet.minecraft.server.packs.resources.ResourceManagerReloadListener
-