mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-01-18 08:52:10 +01:00
Fixed default skill configs not loading
This commit is contained in:
parent
25ca6e32a4
commit
fa40f3707d
@ -57,15 +57,13 @@ public class SkillManager implements MMOCoreManager {
|
|||||||
|
|
||||||
// Save default files if necessary
|
// Save default files if necessary
|
||||||
final File skillFolder = FileUtils.getFile(MMOCore.plugin, "skills");
|
final File skillFolder = FileUtils.getFile(MMOCore.plugin, "skills");
|
||||||
if (!skillFolder.exists())
|
if (!skillFolder.exists()) try {
|
||||||
try {
|
|
||||||
skillFolder.mkdir();
|
skillFolder.mkdir();
|
||||||
|
|
||||||
for (SkillHandler handler : MythicLib.plugin.getSkills().getHandlers()) {
|
for (SkillHandler<?> handler : MythicLib.plugin.getSkills().getHandlers()) {
|
||||||
final InputStream res = MMOCore.plugin.getResource("default/skills/default_mmo_skills/" + handler.getLowerCaseId() + ".yml");
|
final InputStream res = MMOCore.plugin.getResource("default/skills/" + handler.getLowerCaseId() + ".yml");
|
||||||
MMOCore.plugin.getLogger().log(Level.INFO, ("default/skills/default_mmo_skills/" + handler.getLowerCaseId() + ".yml") + " => " + (res != null));
|
|
||||||
if (res != null)
|
if (res != null)
|
||||||
Files.copy(res, new File(MMOCore.plugin.getDataFolder() + "/skills/default_mmo_skills/" + handler.getLowerCaseId() + ".yml").getAbsoluteFile().toPath());
|
Files.copy(res, new File(MMOCore.plugin.getDataFolder() + "/skills/" + handler.getLowerCaseId() + ".yml").getAbsoluteFile().toPath());
|
||||||
}
|
}
|
||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
MMOCore.plugin.getLogger().log(Level.WARNING, "Could not save default skill configs: " + exception.getMessage());
|
MMOCore.plugin.getLogger().log(Level.WARNING, "Could not save default skill configs: " + exception.getMessage());
|
||||||
|
Loading…
Reference in New Issue
Block a user