diff --git a/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java b/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java index be6dc8c..fe39430 100644 --- a/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java +++ b/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java @@ -57,12 +57,12 @@ public Backpack(OfflinePlayer owner, int size) this(owner, size, -1); } - public Backpack(OfflinePlayer owner, int Size, int ID) + public Backpack(OfflinePlayer owner, int size, int ID) { this.owner = owner; titleOther = StringUtils.limitLength(String.format(Minepacks.getInstance().backpackTitleOther, owner.getName()), 32); - bp = Bukkit.createInventory(this, Size, titleOther); - size = Size; + bp = Bukkit.createInventory(this, size, titleOther); + this.size = size; ownerID = ID; } diff --git a/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java b/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java index bd4112d..b3e44c5 100644 --- a/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java +++ b/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java @@ -166,7 +166,7 @@ public long getUnCacheDelay() public String getBPTitleOther() { - return ChatColor.translateAlternateColorCodes('&', config.getString("BackpackTitleOther", "{OwnerName} Backpack").replaceAll("%", "%%").replaceAll("\\{OwnerName\\}", "%s")); + return ChatColor.translateAlternateColorCodes('&', config.getString("BackpackTitleOther", "{OwnerName} Backpack").replaceAll("%", "%%").replaceAll("\\{OwnerName}", "%s")); } public String getBPTitle() diff --git a/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java b/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java index 240305a..87fb1f7 100644 --- a/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java +++ b/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java @@ -60,7 +60,7 @@ public class Minepacks extends JavaPlugin implements MinepacksPlugin public final Map cooldowns = new HashMap<>(); - public String backpackTitleOther, backpackTitle; + public String backpackTitleOther = "%s Backpack", backpackTitle = "Backpack"; public Message messageNoPermission, messageInvalidBackpack; private int maxSize; @@ -96,8 +96,14 @@ public void onEnable() lang = new Language(this); lang.load(config.getLanguage(), config.getLanguageUpdateMode()); database = Database.getDatabase(this); - getCommand("backpack").setExecutor(new OnCommand(this)); + maxSize = config.getBackpackMaxSize(); + backpackTitleOther = config.getBPTitleOther(); + backpackTitle = StringUtils.limitLength(config.getBPTitle(), 32); + messageNoPermission = lang.getMessage("Ingame.NoPermission"); + messageInvalidBackpack = lang.getMessage("Ingame.InvalidBackpack"); + getServer().getServicesManager().register(Minepacks.class, this, this, ServicePriority.Normal); + getCommand("backpack").setExecutor(new OnCommand(this)); //region register events PluginManager pluginManager = getServer().getPluginManager(); pluginManager.registerEvents(new EventListener(this), this); @@ -105,19 +111,11 @@ public void onEnable() if(config.isItemFilterEnabled()) pluginManager.registerEvents(new ItemFilter(this), this); if(config.isShulkerboxesDisable()) pluginManager.registerEvents(new DisableShulkerboxes(this), this); //endregion - if(config.getFullInvCollect()) { (new ItemsCollector(this)).runTaskTimer(this, config.getFullInvCheckInterval(), config.getFullInvCheckInterval()); } - maxSize = config.getBackpackMaxSize(); - backpackTitleOther = config.getBPTitleOther(); - backpackTitle = StringUtils.limitLength(config.getBPTitle(), 32); - messageNoPermission = lang.getMessage("Ingame.NoPermission"); - messageInvalidBackpack = lang.getMessage("Ingame.InvalidBackpack"); - getServer().getServicesManager().register(Minepacks.class, this, this, ServicePriority.Normal); - if(config.getAutoUpdate()) // Lets check for updates { getLogger().info("Checking for updates ...");