Class BiomeMapParser<T>

java.lang.Object
io.github.thebusybiscuit.slimefun4.utils.biomes.BiomeMapParser<T>
Type Parameters:
T - The data type of the resulting BiomeMap

public class BiomeMapParser<T> extends Object
The BiomeMapParser allows you to parse json data into a BiomeMap.
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

  • Method Details

    • setLenient

      public void setLenient(boolean isLenient)
      This method sets the "lenient" flag for this parser.

      A lenient parser will not throw a BiomeMapException if the Biome could not be found. The default value is false.

      Parameters:
      isLenient - Whether this parser should be lenient or not.
    • isLenient

      public boolean isLenient()
      This method returns whether this parser is flagged as "lenient".

      A lenient parser will not throw a BiomeMapException if the Biome could not be found. The default value is false.

      Returns:
      Whether this parser is lenient or not.
    • read

      public void read(@Nonnull String json) throws BiomeMapException
      Throws:
      BiomeMapException
    • read

      public void read(@Nonnull com.google.gson.JsonArray json) throws BiomeMapException
      Throws:
      BiomeMapException
    • buildBiomeMap

      @Nonnull public BiomeMap<T> buildBiomeMap()
      This method builds a BiomeMap based on the parsed data.

      Make sure to parse data via read(JsonArray) or read(String) before calling this method! Otherwise the resulting BiomeMap will be empty.

      Returns:
      The resulting BiomeMap