Fixed Message Config and reloading
This commit is contained in:
parent
064595475f
commit
b677ebace8
|
|
@ -1,5 +1,8 @@
|
|||
package com.alttd.playershops.commands;
|
||||
|
||||
import com.alttd.playershops.PlayerShops;
|
||||
import com.alttd.playershops.config.Config;
|
||||
import com.alttd.playershops.config.MessageConfig;
|
||||
import com.alttd.playershops.gui.HomeGui;
|
||||
import com.alttd.playershops.gui.ShopManagementGui;
|
||||
import com.alttd.playershops.shop.PlayerShop;
|
||||
|
|
@ -24,6 +27,7 @@ public class ShopCommand implements CommandExecutor, TabCompleter {
|
|||
}
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "reload":
|
||||
PlayerShops.getInstance().reloadConfigs();
|
||||
break;
|
||||
case "open":
|
||||
HomeGui gui = new HomeGui(player.getUniqueId());
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class MessageConfig extends AbstractConfiguration {
|
|||
version = config.getInt("config-version", 1);
|
||||
config.set("config-version", 1);
|
||||
|
||||
config.readConfig(Config.class, null);
|
||||
config.readConfig(MessageConfig.class, null);
|
||||
}
|
||||
|
||||
public static String SHOP_ALREADY_EXISTS = "<red>This block is already a Shop</red>";
|
||||
|
|
@ -25,15 +25,15 @@ public class MessageConfig extends AbstractConfiguration {
|
|||
public static String SHOP_LIMIT_REACHED = "<red>You cannot create this shop as you already have reached the limit (<limit>).</red>";
|
||||
public static String BREAK_SHOP_WHILE_CONVERSING = "<red>You can not break shop signs while editing them.</red>";
|
||||
|
||||
void loadErrorMessages() {
|
||||
SHOP_ALREADY_EXISTS = getString("errors.shop-already-exists", SHOP_ALREADY_EXISTS);
|
||||
NO_SHOP_CREATE_PERMISSION = getString("errors.no-shop-create-permission", NO_SHOP_CREATE_PERMISSION);
|
||||
SHOP_LIMIT_REACHED = getString("errors.shop-limit-reached", SHOP_LIMIT_REACHED);
|
||||
BREAK_SHOP_WHILE_CONVERSING = getString("errors.break-shop-while-conversing", BREAK_SHOP_WHILE_CONVERSING);
|
||||
private static void loadErrorMessages() {
|
||||
SHOP_ALREADY_EXISTS = config.getString("errors.shop-already-exists", SHOP_ALREADY_EXISTS);
|
||||
NO_SHOP_CREATE_PERMISSION = config.getString("errors.no-shop-create-permission", NO_SHOP_CREATE_PERMISSION);
|
||||
SHOP_LIMIT_REACHED = config.getString("errors.shop-limit-reached", SHOP_LIMIT_REACHED);
|
||||
BREAK_SHOP_WHILE_CONVERSING = config.getString("errors.break-shop-while-conversing", BREAK_SHOP_WHILE_CONVERSING);
|
||||
}
|
||||
|
||||
public static String SHOP_INFO = "This shop <action> <amount> <blue><item></blue> for <price>.";
|
||||
void otherMessages() {
|
||||
SHOP_INFO = getString("messages.shop-info", SHOP_INFO);
|
||||
public static String SHOP_INFO = "This shop <action> <amount> <item> for <price>.";
|
||||
private static void otherMessages() {
|
||||
SHOP_INFO = config.getString("messages.shop-info", SHOP_INFO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user