Class ModInfoBuilder

java.lang.Object
dev.puzzleshq.mod.info.ModInfoBuilder

public class ModInfoBuilder extends Object
A builder class for ModInfo.
Since:
1.0.0
  • Constructor Details

    • ModInfoBuilder

      public ModInfoBuilder()
  • Method Details

    • setDisplayName

      public void setDisplayName(String displayName)
      Sets the display name.
      Parameters:
      displayName - the new display name.
    • setId

      public void setId(String id)
      Sets the ID.
      Parameters:
      id - the new ID.
    • setVersion

      public void setVersion(String version)
      Sets the version.
      Parameters:
      version - the new version.
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Parameters:
      description - the new description.
    • addAuthor

      public void addAuthor(String... author)
      Adds one or more authors.
      Parameters:
      author - the author to add.
    • addMeta

      public void addMeta(String key, org.hjson.JsonValue value)
      Adds to the meta data map.
      Parameters:
      key - the key of the data.
      value - the value of the data.
    • addMixinConfig

      public void addMixinConfig(MixinConfig config)
      Adds a mixin config.
      Parameters:
      config - the new config to add.
      See Also:
    • addAccessWriter

      public void addAccessWriter(String transformer)
      Adds an Access writer file.
      Parameters:
      transformer - the new access writer file name to add.
    • setLoadableSide

      public void setLoadableSide(String side, Boolean shouldLoadOn)
      Adds what sides the mod should it load on.
      Parameters:
      side - the sides to load on.
      shouldLoadOn - if it should load on.
    • addEntrypoint

      public void addEntrypoint(String key, String value)
      Adds a new entrypoint.
      Parameters:
      key - the entrypoint name.
      value - the entrypoint class.
    • addEntrypoint

      public void addEntrypoint(String key, EntrypointPair value)
      Adds a new entrypoint.
      Parameters:
      key - the entrypoint name.
      value - the new EntrypointPair.
    • addDependency

      public void addDependency(ModDependency dependency)
      Adds a new dependency.
      Parameters:
      dependency - the new ModDependency.
      See Also:
    • setFormat

      public void setFormat(IModFormat format)
      Sets the format of the mod.json.
      Parameters:
      format - the IModFormat.
    • build

      public ModInfo build()
      Builds the modInfo.
      Returns:
      ModInfo
    • getDisplayName

      public String getDisplayName()
      Gets the display name.
    • getId

      public String getId()
      Gets the ID.
    • getVersion

      public String getVersion()
      Gets the version.
    • getDescription

      public String getDescription()
      Gets the description.
    • getAuthors

      public List<String> getAuthors()
      Gets the authors.
    • getMetadata

      public Map<String, org.hjson.JsonValue> getMetadata()
      Gets the MetaData.
    • getEntrypointMap

      public Map<String, List<EntrypointPair>> getEntrypointMap()
      Gets the Entrypoint map.
      Returns:
      a Map the key is the entrypoint name and the value is a List of EntrypointPair.
    • getMixinConfigs

      public List<MixinConfig> getMixinConfigs()
      Gets the MixinConfigs.
      Returns:
      a List of MixinConfig.
    • getAccessWriters

      public List<String> getAccessWriters()
      Gets the access writers.
      Returns:
      a List
    • getLoadableSides

      public Map<String,Boolean> getLoadableSides()
      Gets the loadable sides.
      Returns:
      a Map the key is the side and the value is true if it should load and false if it shouldn't load.
    • getDependencies

      public List<ModDependency> getDependencies()
      Gets the dependencies.
      Returns:
      a List of ModDependency.
    • getFormat

      @Nullable public IModFormat getFormat()
      Gets the format.
      Returns:
      IModFormat