mirror of
https://github.com/songoda/EpicBuckets.git
synced 2024-11-13 05:45:16 +01:00
Fixed shops not loading on start
This commit is contained in:
parent
4d71cd492f
commit
38f0bd5873
@ -44,6 +44,8 @@ public class EpicBuckets extends ExtendedJavaPlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
saveDefaultConfig();
|
||||
|
||||
Locale.init(this);
|
||||
Locale.saveDefaultLocale("en_US");
|
||||
this.locale = Locale.getLocale(getConfig().getString("Locale", "en_US"));
|
||||
@ -51,7 +53,7 @@ public class EpicBuckets extends ExtendedJavaPlugin {
|
||||
debugger = new Debugger();
|
||||
configManager = new ConfigManager();
|
||||
shopManager = new ShopManager();
|
||||
shopManager.init();
|
||||
configManager.setup();
|
||||
genbucketManager = new GenbucketManager();
|
||||
commandManager = new PaperCommandManager(this);
|
||||
|
||||
|
@ -53,17 +53,15 @@ public class ConfigManager {
|
||||
|
||||
public ConfigManager() {
|
||||
this.epicBuckets = EpicBuckets.getInstance();
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
private void setup() {
|
||||
epicBuckets.saveDefaultConfig();
|
||||
public void setup() {
|
||||
configDatabase = new HashMap<>();
|
||||
loadData();
|
||||
createConfig("shops", true);
|
||||
loadData();
|
||||
setupBackButton();
|
||||
setupFillItem();
|
||||
epicBuckets.getShopManager().init();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
@ -91,13 +91,14 @@ public class ShopManager {
|
||||
}
|
||||
|
||||
private void loadShops() {
|
||||
System.out.println("Loading shops..");
|
||||
for (String key : epicBuckets.getConfig().getConfigurationSection(epicBuckets.getConfigManager().getMenuItemsPath()).getKeys(false)) {
|
||||
if (!epicBuckets.getConfig().isConfigurationSection(epicBuckets.getConfigManager().getMenuItemsPath() + "." + key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
shopDatabase.put(key, new Shop(key, epicBuckets.getConfig().getString(epicBuckets.getConfigManager().getMenuItemsPath() + "." + key + ".shop"), epicBuckets.getConfigManager().getMenuItemsPath() + "." + key));
|
||||
}
|
||||
System.out.println("Loaded " + shopDatabase.size() + " shop(s)");
|
||||
}
|
||||
|
||||
public boolean inventoryFull(Player buyer) {
|
||||
|
Loading…
Reference in New Issue
Block a user