From cf9c3d3ece93d858770e70174d5cc2136c81eeba Mon Sep 17 00:00:00 2001 From: dentych Date: Mon, 7 Sep 2015 00:32:41 +0200 Subject: [PATCH] Fixed custom name bug --- src/me/tychsen/enchantgui/EshopConfig.java | 2 +- src/me/tychsen/enchantgui/EshopEventManager.java | 2 +- src/me/tychsen/enchantgui/EshopSystem.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/me/tychsen/enchantgui/EshopConfig.java b/src/me/tychsen/enchantgui/EshopConfig.java index 1300344..e43e045 100644 --- a/src/me/tychsen/enchantgui/EshopConfig.java +++ b/src/me/tychsen/enchantgui/EshopConfig.java @@ -9,7 +9,7 @@ public class EshopConfig { private static EshopConfig instance; - private JavaPlugin plugin; + private Main plugin; private FileConfiguration config; public EshopConfig() { diff --git a/src/me/tychsen/enchantgui/EshopEventManager.java b/src/me/tychsen/enchantgui/EshopEventManager.java index 30a41bd..45709e3 100644 --- a/src/me/tychsen/enchantgui/EshopEventManager.java +++ b/src/me/tychsen/enchantgui/EshopEventManager.java @@ -20,7 +20,7 @@ public EshopEventManager() { /* Public methods */ public void handleInventoryClickEvent(InventoryClickEvent e) { - boolean correctEvent = e.getInventory().getName().toLowerCase().startsWith("enchantgui"); + boolean correctEvent = e.getInventory().getName().toLowerCase().startsWith(EshopConfig.getInstance().getMenuName().toLowerCase()); Player p; if (correctEvent && e.getWhoClicked() instanceof Player) { diff --git a/src/me/tychsen/enchantgui/EshopSystem.java b/src/me/tychsen/enchantgui/EshopSystem.java index 33ca05f..a028805 100644 --- a/src/me/tychsen/enchantgui/EshopSystem.java +++ b/src/me/tychsen/enchantgui/EshopSystem.java @@ -44,7 +44,7 @@ public void showEnchantPage(Player p, ItemStack item) { playerNavigation.put(p.getName(), 1); Inventory inv = p.getServer().createInventory(p, inventorySize, - "EnchantGUI"); + config.getMenuName()); generateEnchantPage(p, inv, item); p.openInventory(inv);