Greatly refactors gate loading

This commit is contained in:
2021-02-28 21:53:27 +01:00
parent 504ef1b52f
commit 44dfa2a10d
3 changed files with 210 additions and 93 deletions

View File

@ -23,7 +23,7 @@ public class Gate {
private final String filename;
private final GateLayout layout;
private final HashMap<Character, Material> types;
private final Map<Character, Material> types;
//Gate materials
private Material portalOpenBlock;
@ -50,7 +50,7 @@ public class Gate {
* @param destroyCost <p>The cost of destroying a portal with this gate layout (-1 to disable)</p>
* @param toOwner <p>Whether any payment should go to the owner of the gate, as opposed to just disappearing</p>
*/
public Gate(String filename, GateLayout layout, HashMap<Character, Material> types, Material portalOpenBlock,
public Gate(String filename, GateLayout layout, Map<Character, Material> types, Material portalOpenBlock,
Material portalClosedBlock, Material portalButton, int useCost, int createCost, int destroyCost,
boolean toOwner) {
this.filename = filename;
@ -79,7 +79,7 @@ public class Gate {
*
* @return <p>The material types each layout character represents</p>
*/
public HashMap<Character, Material> getTypes() {
public Map<Character, Material> getTypes() {
return types;
}