mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-10-06 11:38:18 +02:00
"Sync" reload command with new features
This commit is contained in:
parent
b080a6ffc2
commit
5042b57fc5
@ -8,6 +8,6 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
<build>
|
||||
<resources>
|
||||
|
@ -31,6 +31,7 @@ import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.game.GameTypes;
|
||||
import io.github.dre2n.dungeonsxl.global.GlobalProtections;
|
||||
import io.github.dre2n.dungeonsxl.listener.*;
|
||||
import io.github.dre2n.dungeonsxl.loottable.DLootTables;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMobTypes;
|
||||
import io.github.dre2n.dungeonsxl.mob.ExternalMobProviders;
|
||||
import io.github.dre2n.dungeonsxl.player.DClasses;
|
||||
@ -73,6 +74,7 @@ public class DungeonsXL extends BRPlugin {
|
||||
public static File SCRIPTS;
|
||||
public static File ANNOUNCERS;
|
||||
public static File CLASSES;
|
||||
public static File LOOT_TABLES;
|
||||
public static File MOBS;
|
||||
public static File SIGNS;
|
||||
|
||||
@ -92,6 +94,7 @@ public class DungeonsXL extends BRPlugin {
|
||||
private DPlayers dPlayers;
|
||||
private Announcers announcers;
|
||||
private DClasses dClasses;
|
||||
private DLootTables dLootTables;
|
||||
private DMobTypes dMobTypes;
|
||||
private SignScripts signScripts;
|
||||
private DWorlds dWorlds;
|
||||
@ -128,32 +131,9 @@ public class DungeonsXL extends BRPlugin {
|
||||
public void onEnable() {
|
||||
super.onEnable();
|
||||
instance = this;
|
||||
initFolders();
|
||||
|
||||
loadCaliburnAPI();
|
||||
// Load Language
|
||||
loadMessageConfig(new File(LANGUAGES, "english.yml"));
|
||||
// Load Config
|
||||
loadGlobalData(new File(getDataFolder(), "data.yml"));
|
||||
loadMainConfig(new File(getDataFolder(), "config.yml"));
|
||||
// Load Language 2
|
||||
loadMessageConfig(new File(LANGUAGES, mainConfig.getLanguage() + ".yml"));
|
||||
DPermissions.register();
|
||||
loadGameTypes();
|
||||
loadRequirementTypes();
|
||||
loadRewardTypes();
|
||||
loadTriggers();
|
||||
loadDSigns();
|
||||
loadDungeons();
|
||||
loadGlobalProtections();
|
||||
loadExternalMobProviders();
|
||||
loadDPlayers();
|
||||
loadAnnouncers(ANNOUNCERS);
|
||||
loadDClasses(CLASSES);
|
||||
loadDMobTypes(MOBS);
|
||||
loadSignScripts(SIGNS);
|
||||
loadDWorlds(MAPS);
|
||||
loadDCommands();
|
||||
initFolders();
|
||||
loadCore();
|
||||
|
||||
manager.registerEvents(new EntityListener(), this);
|
||||
manager.registerEvents(new GUIListener(), this);
|
||||
@ -166,7 +146,7 @@ public class DungeonsXL extends BRPlugin {
|
||||
}
|
||||
|
||||
// Load All
|
||||
loadAll();
|
||||
loadData();
|
||||
|
||||
// Tasks
|
||||
startAnnouncerTask(mainConfig.getAnnouncmentInterval());
|
||||
@ -253,6 +233,11 @@ public class DungeonsXL extends BRPlugin {
|
||||
CLASSES.mkdir();
|
||||
}
|
||||
|
||||
LOOT_TABLES = new File(SCRIPTS, "loottables");
|
||||
if (!LOOT_TABLES.exists()) {
|
||||
LOOT_TABLES.mkdir();
|
||||
}
|
||||
|
||||
MOBS = new File(SCRIPTS, "mobs");
|
||||
if (!MOBS.exists()) {
|
||||
MOBS.mkdir();
|
||||
@ -264,6 +249,34 @@ public class DungeonsXL extends BRPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public void loadCore() {
|
||||
loadCaliburnAPI();
|
||||
// Load Language
|
||||
loadMessageConfig(new File(LANGUAGES, "english.yml"));
|
||||
// Load Config
|
||||
loadGlobalData(new File(getDataFolder(), "data.yml"));
|
||||
loadMainConfig(new File(getDataFolder(), "config.yml"));
|
||||
// Load Language 2
|
||||
loadMessageConfig(new File(LANGUAGES, mainConfig.getLanguage() + ".yml"));
|
||||
DPermissions.register();
|
||||
loadGameTypes();
|
||||
loadRequirementTypes();
|
||||
loadRewardTypes();
|
||||
loadTriggers();
|
||||
loadDSigns();
|
||||
loadDungeons();
|
||||
loadGlobalProtections();
|
||||
loadExternalMobProviders();
|
||||
loadDPlayers();
|
||||
loadAnnouncers(ANNOUNCERS);
|
||||
loadDClasses(CLASSES);
|
||||
loadDLootTables(LOOT_TABLES);
|
||||
loadDMobTypes(MOBS);
|
||||
loadSignScripts(SIGNS);
|
||||
loadDWorlds(MAPS);
|
||||
loadDCommands();
|
||||
}
|
||||
|
||||
// Save and load
|
||||
public void saveData() {
|
||||
protections.saveAll();
|
||||
@ -271,7 +284,7 @@ public class DungeonsXL extends BRPlugin {
|
||||
dWorlds.saveAll();
|
||||
}
|
||||
|
||||
public void loadAll() {
|
||||
public void loadData() {
|
||||
protections.loadAll();
|
||||
dPlayers.loadAll();
|
||||
DSavePlayer.load();
|
||||
@ -507,6 +520,20 @@ public class DungeonsXL extends BRPlugin {
|
||||
dClasses = new DClasses(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loaded instance of DLootTables
|
||||
*/
|
||||
public DLootTables getDLootTables() {
|
||||
return dLootTables;
|
||||
}
|
||||
|
||||
/**
|
||||
* load / reload a new instance of DLootTables
|
||||
*/
|
||||
public void loadDLootTables(File file) {
|
||||
dLootTables = new DLootTables(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loaded instance of DMobTypes
|
||||
*/
|
||||
|
@ -67,25 +67,7 @@ public class ReloadCommand extends BRCommand {
|
||||
plugin.saveData();
|
||||
plugin.getMessageConfig().save();
|
||||
|
||||
// Load Config
|
||||
// Load Language
|
||||
plugin.loadMessageConfig(new File(plugin.getDataFolder(), "languages/en.yml"));
|
||||
// Load Config
|
||||
plugin.loadGlobalData(new File(plugin.getDataFolder(), "data.yml"));
|
||||
plugin.loadMainConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
// Load Language 2
|
||||
plugin.loadMessageConfig(new File(plugin.getDataFolder(), "languages/" + plugin.getMainConfig().getLanguage() + ".yml"));
|
||||
plugin.loadDCommands();
|
||||
plugin.loadGameTypes();
|
||||
plugin.loadRequirementTypes();
|
||||
plugin.loadRewardTypes();
|
||||
plugin.loadTriggers();
|
||||
plugin.loadDSigns();
|
||||
plugin.loadDungeons();
|
||||
plugin.loadAnnouncers(DungeonsXL.ANNOUNCERS);
|
||||
plugin.loadDClasses(DungeonsXL.CLASSES);
|
||||
plugin.loadDMobTypes(DungeonsXL.MOBS);
|
||||
plugin.loadSignScripts(DungeonsXL.SIGNS);
|
||||
plugin.loadCore();
|
||||
|
||||
MessageUtil.sendPluginTag(sender, plugin);
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_RELOAD_DONE.getMessage());
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>DungeonsXL</name>
|
||||
<url>https://dre2n.github.io</url>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.14.3</version>
|
||||
<version>0.14.4</version>
|
||||
</parent>
|
||||
<build>
|
||||
<finalName>dungeonsxl-${project.version}${buildNo}</finalName>
|
||||
|
Loading…
Reference in New Issue
Block a user