Class Config<T>

java.lang.Object
net.frozenblock.lib.config.api.instance.Config<T>
Direct Known Subclasses:
JsonConfig, TomlConfig, XjsConfig

public abstract class Config<T> extends Object
  • Constructor Details

    • Config

      protected Config(String modId, Class<T> configClass, Path path, boolean supportsModification, @Nullable @Nullable com.mojang.datafixers.DataFixer dataFixer, @Nullable @Nullable Integer version)
  • Method Details

    • makePath

      @NotNull @Contract(pure=true) public static @NotNull Path makePath(String modId, String extension)
    • modId

      public String modId()
    • path

      public Path path()
    • supportsModification

      public boolean supportsModification()
    • dataFixer

      @Nullable public @Nullable com.mojang.datafixers.DataFixer dataFixer()
    • version

      @Nullable public @Nullable Integer version()
    • config

      public T config()
      Returns:
      The current config instance with modifications if applicable.
    • configWithSync

      public T configWithSync()
      Returns:
      The current config instance with config sync modifications.
      Since:
      1.5
    • supportsSync

      public boolean supportsSync()
      Returns:
      If the current config supports modification and does not have the UnsyncableConfig annotation.
      Since:
      1.5
    • instance

      public T instance()
      Returns:
      The unmodified current config instance.
    • setConfig

      public void setConfig(T configInstance)
    • defaultInstance

      public T defaultInstance()
    • configClass

      public Class<T> configClass()
    • onSync

      public void onSync(T syncInstance)
    • formattedName

      protected String formattedName()
      Since:
      1.5
    • onSave

      protected abstract void onSave() throws Exception
      Throws:
      Exception
    • onLoad

      protected abstract boolean onLoad() throws Exception
      Throws:
      Exception
    • save

      public final void save()
    • load

      public final boolean load()