Class Astral

java.lang.Object
dev.jaxydog.astral.Astral
All Implemented Interfaces:
net.fabricmc.api.ModInitializer

public final class Astral extends Object implements net.fabricmc.api.ModInitializer
The mod's common entrypoint.

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
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
    The mod's logger instance.
    static final String
    The mod's identifier.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.util.Identifier
    getId(String path)
    Returns a new Identifier using 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 boolean
    Returns whether the mod has finished initializing.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MOD_ID

      public static final String 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 LOGGER
      The 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

      public static net.minecraft.util.Identifier getId(String path)
      Returns a new Identifier using 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 false during the registration process.

      If an instance of Astral has been initialized, this will return true.

      Returns:
      If the mod is initialized.
      Since:
      2.0.0
    • getMetadata

      public static Optional<net.fabricmc.loader.api.metadata.ModMetadata> 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:
      onInitialize in interface net.fabricmc.api.ModInitializer