Class Lodestone

java.lang.Object
dev.jaxydog.lodestone.Lodestone
All Implemented Interfaces:
net.fabricmc.api.ModInitializer

public final class Lodestone extends Object implements net.fabricmc.api.ModInitializer
Lodestone's common entrypoint.
Since:
1.0.0
  • Constructor Details

    • Lodestone

      public Lodestone()
      Creates a new instance of this entrypoint.
      Since:
      1.5.3
  • Method Details

    • createEnvironment

      public static <T extends Loaded> void createEnvironment(Class<? extends T> type, Consumer<? super T> load)
      Creates and registers a new environment for the given Loaded interface.

      This is used to implement custom Loaded interfaces.

      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      load - A method that loads the given value.
      Since:
      1.0.0
    • getInterfaces

      @Internal public static Set<Class<? extends Loaded>> getInterfaces()
      Returns a set containing all registered interface instances.
      Returns:
      A set containing all registered interface instances.
      Since:
      0.1.0
    • register

      public static <T extends Loaded> void register(Class<? extends T> type, T value)
      Registers a value for automatic registration.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      value - The value to be registered.
      Since:
      1.0.0
    • register

      @SafeVarargs public static <T extends Loaded> void register(Class<? extends T> type, T... values)
      Registers the given values for automatic registration.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      values - The values to be registered.
      Since:
      1.0.0
    • register

      public static <T extends Loaded> void register(Class<? extends T> type, Iterator<? extends T> values)
      Registers the given values for automatic registration.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      values - The values to be registered.
      Since:
      1.0.0
    • register

      public static <T extends Loaded> void register(Class<? extends T> type, Collection<? extends T> values)
      Registers the given values for automatic registration.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      values - The values to be registered.
      Since:
      1.0.0
    • load

      public static <T extends Loaded> void load(Class<? extends T> type, String modId)
      Loads the target environment for the given mod identifier.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      modId - The requesting mod's identifier.
      Since:
      1.0.0
    • load

      public static <T extends Loaded> void load(Class<? extends T> type, String... modIds) throws IllegalArgumentException
      Loads the target environment for the given mod identifier.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      modIds - The requesting mod's identifiers.
      Throws:
      IllegalArgumentException - If the given list of mod identifiers is empty.
      Since:
      1.0.0
    • load

      public static <T extends Loaded> void load(Class<? extends T> type, Iterator<String> modIds) throws IllegalArgumentException
      Loads the target environment for the given mod identifier.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      modIds - The requesting mod's identifiers.
      Throws:
      IllegalArgumentException - If the given list of mod identifiers is empty.
      Since:
      1.0.0
    • load

      public static <T extends Loaded> void load(Class<? extends T> type, Collection<String> modIds) throws IllegalArgumentException
      Loads the target environment for the given mod identifier.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The Loaded interface.
      modIds - The requesting mod's identifiers.
      Throws:
      IllegalArgumentException - If the given list of mod identifiers is empty.
      Since:
      1.0.0
    • onInitialize

      public void onInitialize()
      Specified by:
      onInitialize in interface net.fabricmc.api.ModInitializer