Package org.sgrewritten.stargate.util
Class GateFormatReader
java.lang.Object
org.sgrewritten.stargate.util.GateFormatReader
Helper class for reading gate files
-
Method Summary
Modifier and TypeMethodDescriptionstatic Set
<org.bukkit.Material> parseMaterial
(String materialString, String line) Parses a material stringstatic void
readGateFile
(Scanner scanner, Map<Character, Set<org.bukkit.Material>> characterMaterialMap, List<List<Character>> design, Map<String, String> config) Reads a gate file
-
Method Details
-
readGateFile
public static void readGateFile(Scanner scanner, Map<Character, Set<org.bukkit.Material>> characterMaterialMap, List<List<Character>> design, Map<String, throws ParsingErrorExceptionString> config) 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 stringJust 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
-