diff --git a/src/net/TheDgtl/Stargate/Gate.java b/src/net/TheDgtl/Stargate/Gate.java index adbf5e8..7177166 100644 --- a/src/net/TheDgtl/Stargate/Gate.java +++ b/src/net/TheDgtl/Stargate/Gate.java @@ -46,7 +46,6 @@ public class Gate { private String filename; private Character[][] layout; private HashMap types; - private HashMap metadata; private RelativeBlockVector[] entrances = new RelativeBlockVector[0]; private RelativeBlockVector[] border = new RelativeBlockVector[0]; private RelativeBlockVector[] controls = new RelativeBlockVector[0]; @@ -61,10 +60,9 @@ public class Gate { private int destroyCost = -1; private boolean toOwner = false; - public Gate(String filename, Character[][] layout, HashMap types, HashMap metadata) { + public Gate(String filename, Character[][] layout, HashMap types) { this.filename = filename; this.layout = layout; - this.metadata = metadata; this.types = types; populateCoordinates(); @@ -141,12 +139,6 @@ public class Gate { bw.append(type); bw.append('='); bw.append(value.toString()); - Integer mData = metadata.get(type); - // Append metadata - if (mData != null) { - bw.append(':'); - bw.append(mData.toString()); - } bw.newLine(); } @@ -187,10 +179,6 @@ public class Gate { public HashMap getTypes() { return types; } - - public HashMap getMetaData() { - return metadata; - } public RelativeBlockVector[] getEntrances() { return entrances; @@ -293,11 +281,6 @@ public class Gate { Stargate.debug("Gate::Matches", "Block Type Mismatch: " + topleft.modRelative(x, y, 0, modX, 1, modZ).getType() + " != " + id); return false; } - Integer mData = metadata.get(layout[y][x]); - if (mData != null && topleft.modRelative(x, y, 0, modX, 1, modZ).getData() != mData) { - Stargate.debug("Gate::Matches", "Block Data Mismatch: " + topleft.modRelative(x, y, 0, modX, 1, modZ).getData() + " != " + mData); - return false; - } } } } @@ -322,7 +305,6 @@ public class Gate { boolean designing = false; ArrayList> design = new ArrayList<>(); HashMap types = new HashMap<>(); - HashMap metadata = new HashMap<>(); HashMap config = new HashMap<>(); HashSet frameTypes = new HashSet<>(); int cols = 0; @@ -364,15 +346,7 @@ public class Gate { if (key.length() == 1) { Character symbol = key.charAt(0); - // Check for metadata - if (value.contains(":")) { - split = value.split(":"); - value = split[0].trim(); - String mData = split[1].trim(); - metadata.put(symbol, Integer.parseInt(mData)); - } - Material id = Material.valueOf(value); - + Material id = Material.getMaterial(value); types.put(symbol, id); frameTypes.add(id); } else { @@ -405,7 +379,7 @@ public class Gate { layout[y] = result; } - Gate gate = new Gate(file.getName(), layout, types, metadata); + Gate gate = new Gate(file.getName(), layout, types); gate.portalBlockOpen = readConfig(config, gate, file, "portal-open", gate.portalBlockOpen); gate.portalBlockClosed = readConfig(config, gate, file, "portal-closed", gate.portalBlockClosed); @@ -485,9 +459,8 @@ public class Gate { types.put(ANYTHING, Material.AIR); types.put('X', Material.OBSIDIAN); types.put('-', Material.OBSIDIAN); - HashMap metadata = new HashMap<>(); - Gate gate = new Gate("nethergate.gate", layout, types, metadata); + Gate gate = new Gate("nethergate.gate", layout, types); gate.save(gateFolder); registerGate(gate); }