Class Astral
- All Implemented Interfaces:
net.fabricmc.api.ModInitializer
This class is initialized on both the client and the server environments. All code referenced here must be able to be shared between environments, or else it may cause runtime crashes. Please use with a healthy dose of caution!
It should also be assumed that prior to onInitialize(), nothing has been fully loaded. For safety purposes,
you may use the hasInitialized() method to verify whether this is the case.
- Since:
- 1.0.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.util.IdentifierReturns a newIdentifierusing the mod's identifier namespace ("astral") and the provided path.static Optional<net.fabricmc.loader.api.metadata.ModMetadata> Returns the mod metadata for Astral.static booleanReturns whether the mod has finished initializing.void
-
Field Details
-
MOD_ID
The mod's identifier.This is most commonly used for generating
Identifiers.- Since:
- 1.0.0
- See Also:
-
LOGGER
public static final org.slf4j.Logger LOGGERThe mod's logger instance.This is used extensively throughout the codebase to interface with Minecraft's console.
- Since:
- 1.0.0
-
-
Constructor Details
-
Astral
public Astral()
-
-
Method Details
-
getId
Returns a newIdentifierusing the mod's identifier namespace ("astral") and the provided path.- Parameters:
path- The identifier's path.- Returns:
- A new identifier.
- Since:
- 1.0.0
-
hasInitialized
public static boolean hasInitialized()Returns whether the mod has finished initializing.This method will always return
falseduring the registration process.If an instance of
Astralhas been initialized, this will returntrue.- Returns:
- If the mod is initialized.
- Since:
- 2.0.0
-
getMetadata
Returns the mod metadata for Astral.If this is called before Fabric itself has loaded it will cause the game to crash, however in normal runtime conditions this is impossible.
- Returns:
- The mod's metadata.
- Since:
- 1.7.0
-
onInitialize
public void onInitialize()- Specified by:
onInitializein interfacenet.fabricmc.api.ModInitializer
-