Fix loading order; resolves #156

This commit is contained in:
Daniel Saukel 2016-09-11 14:35:52 +02:00
parent 941831643c
commit 6224c931db
4 changed files with 9 additions and 12 deletions

View File

@ -266,7 +266,8 @@ public class DungeonsXL extends BRPlugin {
loadRewardTypes(); loadRewardTypes();
loadTriggers(); loadTriggers();
loadDSigns(); loadDSigns();
loadDungeons(); loadDWorlds(MAPS);
loadDungeons(DUNGEONS);
loadGlobalProtections(); loadGlobalProtections();
loadExternalMobProviders(); loadExternalMobProviders();
loadDPlayers(); loadDPlayers();
@ -275,7 +276,6 @@ public class DungeonsXL extends BRPlugin {
loadDLootTables(LOOT_TABLES); loadDLootTables(LOOT_TABLES);
loadDMobTypes(MOBS); loadDMobTypes(MOBS);
loadSignScripts(SIGNS); loadSignScripts(SIGNS);
loadDWorlds(MAPS);
loadDCommands(); loadDCommands();
} }
@ -446,8 +446,8 @@ public class DungeonsXL extends BRPlugin {
/** /**
* load / reload a new instance of Dungeons * load / reload a new instance of Dungeons
*/ */
public void loadDungeons() { public void loadDungeons(File file) {
dungeons = new Dungeons(); dungeons = new Dungeons(file);
} }
/** /**

View File

@ -20,7 +20,6 @@ import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.config.DungeonConfig;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.game.Game;

View File

@ -157,7 +157,8 @@ public enum DMessages implements Messages {
GROUP_PLAYER_JOINED("Group_PlayerJoined", "&6Player &4&v1&6 has joined the group!"), GROUP_PLAYER_JOINED("Group_PlayerJoined", "&6Player &4&v1&6 has joined the group!"),
GROUP_WAVE_FINISHED("Group_WaveFinished", "&6Your group finished wave no. &4&v1&6. The next one is going to start in &4&v2&6 seconds."), GROUP_WAVE_FINISHED("Group_WaveFinished", "&6Your group finished wave no. &4&v1&6. The next one is going to start in &4&v2&6 seconds."),
LOG_DISABLED_TWEAKS("Log_DisabledTweaks", "&4Disabled performance tweaks because there is no support for this server software."), LOG_DISABLED_TWEAKS("Log_DisabledTweaks", "&4Disabled performance tweaks because there is no support for this server software."),
LOG_ERROR_MOB_ENCHANTMENT("Log_Error_MobEnchantment", "&4Error at loading mob.yml: Enchantment &6&v1&4 doesn't exist!"), LOG_ERROR_DUNGEON_SETUP("Log_Error_DungeonSetup", "&4The setup of dungeon &6&v1&4 is incorrect. See https://github.com/DRE2N/DungeonsXL/wiki/dungeon-configuration for reference."),
LOG_ERROR_MOB_ENCHANTMENT("Log_Error_MobEnchantment", "&4An error occurred while loading mob.yml: Enchantment &6&v1&4 doesn't exist!"),
LOG_ERROR_MOBTYPE("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!"), LOG_ERROR_MOBTYPE("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!"),
LOG_ERROR_NO_CONSOLE_COMMAND("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as console!"), LOG_ERROR_NO_CONSOLE_COMMAND("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as console!"),
LOG_ERROR_SIGN_SETUP("Log_Error_SignSetup", "&4A sign at &6&v1&4 is erroneous!"), LOG_ERROR_SIGN_SETUP("Log_Error_SignSetup", "&4A sign at &6&v1&4 is erroneous!"),

View File

@ -16,7 +16,8 @@
*/ */
package io.github.dre2n.dungeonsxl.dungeon; package io.github.dre2n.dungeonsxl.dungeon;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.config.DMessages;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -30,10 +31,6 @@ public class Dungeons {
private List<Dungeon> dungeons = new ArrayList<>(); private List<Dungeon> dungeons = new ArrayList<>();
public Dungeons() {
this(DungeonsXL.DUNGEONS);
}
public Dungeons(File folder) { public Dungeons(File folder) {
if (!folder.exists()) { if (!folder.exists()) {
folder.mkdir(); folder.mkdir();
@ -46,7 +43,7 @@ public class Dungeons {
dungeons.add(dungeon); dungeons.add(dungeon);
} else { } else {
// debug MessageUtil.log(DMessages.LOG_ERROR_DUNGEON_SETUP.getMessage(file.getName()));
} }
} }
} }