diff --git a/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java b/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java index ba3ddbf..438346e 100644 --- a/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java +++ b/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java @@ -11,11 +11,9 @@ import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Scanner; -import java.util.Set; import static net.knarcraft.stargate.utility.GateReader.generateLayoutMatrix; import static net.knarcraft.stargate.utility.GateReader.readGateConfig; @@ -134,7 +132,6 @@ public class GateHandler { Map characterMaterialMap = new HashMap<>(); Map> characterTagMap = new HashMap<>(); Map config = new HashMap<>(); - Set frameTypes = new HashSet<>(); //Initialize character to material map characterMaterialMap.put(ENTRANCE, Material.AIR); @@ -142,7 +139,7 @@ public class GateHandler { characterMaterialMap.put(ANYTHING, Material.AIR); //Read the file into appropriate lists and maps - int columns = readGateFile(scanner, characterMaterialMap, characterTagMap, fileName, design, frameTypes, config); + int columns = readGateFile(scanner, characterMaterialMap, characterTagMap, fileName, design, config); if (columns < 0) { return null; } diff --git a/src/main/java/net/knarcraft/stargate/utility/GateReader.java b/src/main/java/net/knarcraft/stargate/utility/GateReader.java index ed2120f..de5901f 100644 --- a/src/main/java/net/knarcraft/stargate/utility/GateReader.java +++ b/src/main/java/net/knarcraft/stargate/utility/GateReader.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Scanner; -import java.util.Set; /** * Helper class for reading gate files @@ -29,13 +28,12 @@ public final class GateReader { * @param materialTagMap

The map of characters to store valid tag symbols in

* @param fileName

The filename of the loaded gate config file

* @param design

The list to store the loaded design/layout to

- * @param frameTypes

The set to store frame/border materials to

* @param config

The map of config values to store to

* @return

The column count/width of the loaded gate

*/ public static int readGateFile(Scanner scanner, Map characterMaterialMap, Map> materialTagMap, String fileName, - List> design, Set frameTypes, Map config) { + List> design, Map config) { boolean designing = false; int columns = 0; try { @@ -51,7 +49,7 @@ public final class GateReader { } else { if (!line.isEmpty() && !line.startsWith("#")) { //Read a normal config value - readGateConfigValue(line, characterMaterialMap, materialTagMap, frameTypes, config); + readGateConfigValue(line, characterMaterialMap, materialTagMap, config); } else if ((line.isEmpty()) || (!line.contains("=") && !line.startsWith("#"))) { //An empty line marks the start of the gate's layout/design designing = true; @@ -115,12 +113,11 @@ public final class GateReader { * @param line

The line to read

* @param characterMaterialMap

The character to material map to store to

* @param materialTagMap

The character to material tag map to store to

- * @param frameTypes

The set to store gate frame/border types to

* @param config

The config value map to store to

* @throws Exception

If an invalid material is encountered

*/ private static void readGateConfigValue(String line, Map characterMaterialMap, - Map> materialTagMap, Set frameTypes, + Map> materialTagMap, Map config) throws Exception { String[] split = line.split("="); String key = split[0].trim(); @@ -143,8 +140,6 @@ public final class GateReader { if (material != null) { //Register the map between the read symbol and the corresponding material characterMaterialMap.put(symbol, material); - //Save the material as one of the frame materials used for this kind of gate - frameTypes.add(material); return; } }