Class ForgeConfigSpec

java.lang.Object
com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<com.electronwill.nightconfig.core.UnmodifiableConfig>
net.minecraftforge.common.ForgeConfigSpec
All Implemented Interfaces:
com.electronwill.nightconfig.core.UnmodifiableConfig, IConfigSpec<ForgeConfigSpec>

public class ForgeConfigSpec extends com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<com.electronwill.nightconfig.core.UnmodifiableConfig> implements IConfigSpec<ForgeConfigSpec>
Like ConfigSpec except in builder format, and extended to accept comments, language keys, and other things Forge configs would find useful.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
    private static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig

    com.electronwill.nightconfig.core.UnmodifiableConfig.Entry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private com.electronwill.nightconfig.core.Config
     
    private static final com.google.common.base.Joiner
     
    private static final com.google.common.base.Splitter
     
    private boolean
     
    private final Map<List<String>,String>
     
    private final Map<List<String>,String>
     
    private static final com.google.common.base.Joiner
     
    private static final org.apache.logging.log4j.Logger
     
    private final com.electronwill.nightconfig.core.UnmodifiableConfig
     
    private static final Pattern
     

    Fields inherited from class com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper

    config
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    ForgeConfigSpec(com.electronwill.nightconfig.core.UnmodifiableConfig storage, com.electronwill.nightconfig.core.UnmodifiableConfig values, Map<List<String>,String> levelComments, Map<List<String>,String> levelTranslationKeys)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acceptConfig(com.electronwill.nightconfig.core.CommentedConfig data)
     
    void
     
    int
    correct(com.electronwill.nightconfig.core.CommentedConfig config)
     
    int
    correct(com.electronwill.nightconfig.core.CommentedConfig config, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener)
     
    int
    correct(com.electronwill.nightconfig.core.CommentedConfig config, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener commentListener)
     
    private int
    correct(com.electronwill.nightconfig.core.UnmodifiableConfig spec, com.electronwill.nightconfig.core.CommentedConfig config, LinkedList<String> parentPath, List<String> parentPathUnmodifiable, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener commentListener, boolean dryRun)
     
     
     
    com.electronwill.nightconfig.core.UnmodifiableConfig
     
    com.electronwill.nightconfig.core.UnmodifiableConfig
     
    boolean
    isCorrect(com.electronwill.nightconfig.core.CommentedConfig config)
     
    boolean
     
    boolean
     
    private void
    resetCaches(Iterable<Object> configValues)
     
    void
     
    void
    setConfig(com.electronwill.nightconfig.core.CommentedConfig config)
     
    private static List<String>
    split(String path)
     
    private boolean
    stringsMatchIgnoringNewlines(@Nullable String string1, @Nullable String string2)
     

    Methods inherited from class com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper

    configFormat, contains, entrySet, equals, getRaw, hashCode, isEmpty, size, valueMap

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraftforge.fml.config.IConfigSpec

    self

    Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig

    apply, apply, configFormat, contains, contains, entrySet, get, get, getByte, getByte, getByteOrElse, getByteOrElse, getChar, getChar, getCharOrElse, getCharOrElse, getEnum, getEnum, getEnum, getEnum, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getInt, getInt, getIntOrElse, getIntOrElse, getIntOrElse, getIntOrElse, getLong, getLong, getLongOrElse, getLongOrElse, getLongOrElse, getLongOrElse, getOptional, getOptional, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalInt, getOptionalInt, getOptionalLong, getOptionalLong, getOrElse, getOrElse, getOrElse, getOrElse, getRaw, getRaw, getShort, getShort, getShortOrElse, getShortOrElse, isEmpty, isNull, isNull, size, valueMap
  • Field Details

    • levelComments

      private final Map<List<String>,String> levelComments
    • levelTranslationKeys

      private final Map<List<String>,String> levelTranslationKeys
    • values

      private final com.electronwill.nightconfig.core.UnmodifiableConfig values
    • childConfig

      private com.electronwill.nightconfig.core.Config childConfig
    • isCorrecting

      private boolean isCorrecting
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • WINDOWS_NEWLINE

      private static final Pattern WINDOWS_NEWLINE
    • LINE_JOINER

      private static final com.google.common.base.Joiner LINE_JOINER
    • DOT_JOINER

      private static final com.google.common.base.Joiner DOT_JOINER
    • DOT_SPLITTER

      private static final com.google.common.base.Splitter DOT_SPLITTER
  • Constructor Details

    • ForgeConfigSpec

      private ForgeConfigSpec(com.electronwill.nightconfig.core.UnmodifiableConfig storage, com.electronwill.nightconfig.core.UnmodifiableConfig values, Map<List<String>,String> levelComments, Map<List<String>,String> levelTranslationKeys)
  • Method Details

    • getLevelComment

      public String getLevelComment(List<String> path)
    • getLevelTranslationKey

      public String getLevelTranslationKey(List<String> path)
    • setConfig

      public void setConfig(com.electronwill.nightconfig.core.CommentedConfig config)
    • acceptConfig

      public void acceptConfig(com.electronwill.nightconfig.core.CommentedConfig data)
      Specified by:
      acceptConfig in interface IConfigSpec<ForgeConfigSpec>
    • isCorrecting

      public boolean isCorrecting()
      Specified by:
      isCorrecting in interface IConfigSpec<ForgeConfigSpec>
    • isLoaded

      public boolean isLoaded()
    • getSpec

      public com.electronwill.nightconfig.core.UnmodifiableConfig getSpec()
    • getValues

      public com.electronwill.nightconfig.core.UnmodifiableConfig getValues()
    • afterReload

      public void afterReload()
      Specified by:
      afterReload in interface IConfigSpec<ForgeConfigSpec>
    • resetCaches

      private void resetCaches(Iterable<Object> configValues)
    • save

      public void save()
    • isCorrect

      public boolean isCorrect(com.electronwill.nightconfig.core.CommentedConfig config)
      Specified by:
      isCorrect in interface IConfigSpec<ForgeConfigSpec>
    • correct

      public int correct(com.electronwill.nightconfig.core.CommentedConfig config)
      Specified by:
      correct in interface IConfigSpec<ForgeConfigSpec>
    • correct

      public int correct(com.electronwill.nightconfig.core.CommentedConfig config, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener)
    • correct

      public int correct(com.electronwill.nightconfig.core.CommentedConfig config, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener commentListener)
    • correct

      private int correct(com.electronwill.nightconfig.core.UnmodifiableConfig spec, com.electronwill.nightconfig.core.CommentedConfig config, LinkedList<String> parentPath, List<String> parentPathUnmodifiable, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener listener, com.electronwill.nightconfig.core.ConfigSpec.CorrectionListener commentListener, boolean dryRun)
    • stringsMatchIgnoringNewlines

      private boolean stringsMatchIgnoringNewlines(@Nullable @Nullable String string1, @Nullable @Nullable String string2)
    • split

      private static List<String> split(String path)