mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
fixed mmocore loading issue + added expanded layout default
This commit is contained in:
parent
a3443485e4
commit
ca93b6aa10
@ -111,6 +111,8 @@ public class MMOItems extends JavaPlugin {
|
||||
|
||||
typeManager.reload();
|
||||
|
||||
templateManager.loadCompatibility(); // explained why here in method
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("MMOCore") != null)
|
||||
new MMOCoreMMOLoader();
|
||||
}
|
||||
|
@ -281,6 +281,7 @@ public class ConfigManager {
|
||||
|
||||
// station layouts
|
||||
DEFAULT_LAYOUT("layouts/default.yml", "layouts", "default.yml"),
|
||||
EXPANDED_LAYOUT("layouts/expanded.yml", "layouts", "expanded.yml"),
|
||||
|
||||
// default item config files -> /MMOItems/item
|
||||
ARMOR("item/armor.yml", "item", "armor.yml"),
|
||||
|
@ -1,16 +1,5 @@
|
||||
package net.Indyuce.mmoitems.manager;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.ConfigFile;
|
||||
import net.Indyuce.mmoitems.api.ItemTier;
|
||||
@ -18,6 +7,16 @@ import net.Indyuce.mmoitems.api.Type;
|
||||
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
|
||||
import net.Indyuce.mmoitems.api.item.template.TemplateModifier;
|
||||
import net.Indyuce.mmoitems.api.util.TemplateMap;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class TemplateManager {
|
||||
|
||||
@ -212,4 +211,21 @@ public class TemplateManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
// this loads dummy items for on load so
|
||||
// plugins that enable before mmoitems that use
|
||||
// items (mmocore) don't error out and need
|
||||
// a reload
|
||||
public void loadCompatibility() {
|
||||
templates.clear();
|
||||
|
||||
for (Type type : MMOItems.plugin.getTypes().getAll()) {
|
||||
FileConfiguration config = type.getConfigFile().getConfig();
|
||||
for (String key : config.getKeys(false))
|
||||
try {
|
||||
registerTemplate(new MMOItemTemplate(type, key));
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user