Class GateFormatReader

java.lang.Object
org.sgrewritten.stargate.util.GateFormatReader

public final class GateFormatReader extends Object
Helper class for reading gate files
  • Method Details

    • readGateFile

      public static void readGateFile(Scanner scanner, Map<Character,Set<org.bukkit.Material>> characterMaterialMap, List<List<Character>> design, Map<String,String> config) throws ParsingErrorException
      Reads a gate file
      Parameters:
      scanner -

      The scanner to read from

      characterMaterialMap -

      The map of characters to store valid symbols in

      design -

      The list to store the loaded design/layout to

      config -

      The map of config values to store to

      Throws:
      ParsingErrorException -

      If the gate file cannot be parsed

    • parseMaterial

      public static Set<org.bukkit.Material> parseMaterial(String materialString, String line) throws ParsingErrorException
      Parses a material string

      Just parses all the materials based from tags or material id (when a string starts with #, it should be a tag). "," resembles a split in items

      Parameters:
      materialString -

      The string describing a material/material class to parse

      line -

      The line currently parsed

      Returns:

      The parsed material

      Throws:
      ParsingErrorException -

      If unable to parse the given material