diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java b/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java index ac89ef2..3259ca4 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java @@ -69,10 +69,10 @@ public class CommandCreateDungeonRift extends DDCommandBase } else { - result = findDungeonByPartialName(command[0], dungeonHelper.registeredDungeons); + result = findDungeonByPartialName(command[0], dungeonHelper.getRegisteredDungeons()); if (result == null) { - result = findDungeonByPartialName(command[0], dungeonHelper.customDungeons); + result = findDungeonByPartialName(command[0], dungeonHelper.getUntaggedDungeons()); } //Check if we found any matches if (result != null) diff --git a/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java b/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java index a91b6eb..5d57357 100644 --- a/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java +++ b/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java @@ -6,6 +6,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Random; import java.util.regex.Pattern; @@ -60,8 +61,8 @@ public class DungeonHelper private Random rand = new Random(); - public ArrayList untaggedDungeons = new ArrayList(); - public ArrayList registeredDungeons = new ArrayList(); + private ArrayList untaggedDungeons = new ArrayList(); + private ArrayList registeredDungeons = new ArrayList(); private ArrayList simpleHalls = new ArrayList(); private ArrayList complexHalls = new ArrayList(); @@ -105,17 +106,6 @@ public class DungeonHelper registerCustomDungeons(); } - private void registerCustomDungeons() - { - File file = new File(properties.CustomSchematicDirectory); - if (file.exists() || file.mkdir()) - { - copyfile.copyFile("/mods/DimDoors/text/How_to_add_dungeons.txt", file.getAbsolutePath() + "/How_to_add_dungeons.txt"); - } - importCustomDungeons(properties.CustomSchematicDirectory); - registerBaseDungeons(); - } - public static DungeonHelper initialize() { if (instance == null) @@ -141,6 +131,27 @@ public class DungeonHelper return instance; } + private void registerCustomDungeons() + { + File file = new File(properties.CustomSchematicDirectory); + if (file.exists() || file.mkdir()) + { + copyfile.copyFile("/mods/DimDoors/text/How_to_add_dungeons.txt", file.getAbsolutePath() + "/How_to_add_dungeons.txt"); + } + importCustomDungeons(properties.CustomSchematicDirectory); + registerBaseDungeons(); + } + + public List getRegisteredDungeons() + { + return Collections.unmodifiableList(this.registeredDungeons); + } + + public List getUntaggedDungeons() + { + return Collections.unmodifiableList(this.untaggedDungeons); + } + public LinkData createCustomDungeonDoor(World world, int x, int y, int z) { //Create a link above the specified position. Link to a new pocket dimension.