Package org.moddingx.libx.event
Class ConfigLoadedEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
org.moddingx.libx.event.ConfigLoadedEvent
public class ConfigLoadedEvent
extends net.minecraftforge.eventbus.api.Event
Fired whenever a
LibX config
is loaded. Is fired on both client and server.
The event is not cancelable.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
A reason for a config to loadNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
ConstructorDescriptionConfigLoadedEvent
(net.minecraft.resources.ResourceLocation configId, Class<?> configClass, ConfigLoadedEvent.LoadReason reason, boolean clientConfig, Path configPath, Path currentPath) -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Gets the class of the config that was loaded.net.minecraft.resources.ResourceLocation
Gets the id of the config that was loaded.Gets the path where the config is stored by default.Gets the path where the config is loaded from for this event.Gets the reason why the config was loadedboolean
Gets whether the config is a client config.Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
ConfigLoadedEvent
public ConfigLoadedEvent(net.minecraft.resources.ResourceLocation configId, Class<?> configClass, ConfigLoadedEvent.LoadReason reason, boolean clientConfig, Path configPath, @Nullable Path currentPath)
-
-
Method Details
-
getConfigId
public net.minecraft.resources.ResourceLocation getConfigId()Gets the id of the config that was loaded. -
getConfigClass
Gets the class of the config that was loaded. -
getReason
Gets the reason why the config was loaded -
isClientConfig
public boolean isClientConfig()Gets whether the config is a client config. -
getConfigPath
Gets the path where the config is stored by default. -
getCurrentPath
Gets the path where the config is loaded from for this event. For example, configs can be loaded per world. In that casecurrentPath
will be the path from the world andconfigPath
will be the default path for the config which might still be used for values not present in the world-specific config. The value isnull
when the current config is loaded from a non-file location (for example on shadowing). It can also be the same asconfigPath
when the config is loaded from the default path.
-