diff --git a/src/main/java/me/waterarchery/litsellchest/commands/SellChestCommand.java b/src/main/java/me/waterarchery/litsellchest/commands/SellChestCommand.java index 07134a4..314848f 100644 --- a/src/main/java/me/waterarchery/litsellchest/commands/SellChestCommand.java +++ b/src/main/java/me/waterarchery/litsellchest/commands/SellChestCommand.java @@ -28,7 +28,7 @@ public void mainCommand(CommandSender sender) { SoundManager.sendSound((Player) sender, "DefaultMenuOpened"); } else { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); libs.getLogger().log("You can only use this command on in game."); } } @@ -40,7 +40,7 @@ public void shop(CommandSender sender) { guiHandler.openShop((Player) sender); } else { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); libs.getLogger().log("You can only use this command on in game."); } } diff --git a/src/main/java/me/waterarchery/litsellchest/configuration/gui/ShopMenu.java b/src/main/java/me/waterarchery/litsellchest/configuration/gui/ShopMenu.java index 035e9a9..6609c17 100644 --- a/src/main/java/me/waterarchery/litsellchest/configuration/gui/ShopMenu.java +++ b/src/main/java/me/waterarchery/litsellchest/configuration/gui/ShopMenu.java @@ -30,7 +30,7 @@ public ShopMenu(ConfigManager file, String path, LitLibs litLibs) { public Inventory generateInventory(Player player) { GUIHandler guiHandler = GUIHandler.getInstance(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); MessageHandler mHandler = libs.getMessageHandler(); ChestHandler chestHandler = ChestHandler.getInstance(); ConfigManager configManager = new ConfigManager(libs, "gui", "shop_menu", false); diff --git a/src/main/java/me/waterarchery/litsellchest/configuration/gui/YourChestsMenu.java b/src/main/java/me/waterarchery/litsellchest/configuration/gui/YourChestsMenu.java index e35b63e..a87dc72 100644 --- a/src/main/java/me/waterarchery/litsellchest/configuration/gui/YourChestsMenu.java +++ b/src/main/java/me/waterarchery/litsellchest/configuration/gui/YourChestsMenu.java @@ -22,7 +22,7 @@ public class YourChestsMenu { public static Inventory generateInventory(Player player) { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); MessageHandler mHandler = libs.getMessageHandler(); ChestHandler chestHandler = ChestHandler.getInstance(); NBTAPIHook nbtapiHook = libs.getNBTAPIHook(); diff --git a/src/main/java/me/waterarchery/litsellchest/handlers/ChestHandler.java b/src/main/java/me/waterarchery/litsellchest/handlers/ChestHandler.java index 6528382..36b192f 100644 --- a/src/main/java/me/waterarchery/litsellchest/handlers/ChestHandler.java +++ b/src/main/java/me/waterarchery/litsellchest/handlers/ChestHandler.java @@ -49,7 +49,7 @@ public void startTask() { ConfigHandler configHandler = ConfigHandler.getInstance(); ConfigManager manager = configHandler.getConfig(); int interval = manager.getYml().getInt("DefaultCheckInterval"); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); task = new SellTask(interval, libs); task.runTaskTimer(LitSellChest.getInstance(), 20, interval * 20L); } @@ -69,7 +69,7 @@ public boolean isLocationValid(Location location) { } public void loadChestTypes() { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); ConfigHandler configHandler = ConfigHandler.getInstance(); ConfigManager manager = configHandler.getChests(); FileConfiguration yml = manager.getYml(); @@ -123,7 +123,7 @@ public int getChestCount(OfflinePlayer p) { } public @Nullable SellChestType getType(ItemStack itemStack) { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); String rawType = libs.getNBTAPIHook().getNBT(itemStack, "SellChestType"); if (rawType != null) { return getType(rawType); diff --git a/src/main/java/me/waterarchery/litsellchest/handlers/CommandHandler.java b/src/main/java/me/waterarchery/litsellchest/handlers/CommandHandler.java index d32c0b5..8df45a3 100644 --- a/src/main/java/me/waterarchery/litsellchest/handlers/CommandHandler.java +++ b/src/main/java/me/waterarchery/litsellchest/handlers/CommandHandler.java @@ -87,7 +87,7 @@ public void registerSuggestions(BukkitCommandManager manager) { } public void registerMessages(BukkitCommandManager manager) { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); ConfigHandler configHandler = ConfigHandler.getInstance(); MessageHandler mHandler = libs.getMessageHandler(); ConfigManager lang = configHandler.getLang(); diff --git a/src/main/java/me/waterarchery/litsellchest/handlers/ConfigHandler.java b/src/main/java/me/waterarchery/litsellchest/handlers/ConfigHandler.java index 0785c4c..0313833 100644 --- a/src/main/java/me/waterarchery/litsellchest/handlers/ConfigHandler.java +++ b/src/main/java/me/waterarchery/litsellchest/handlers/ConfigHandler.java @@ -39,7 +39,7 @@ public void load() { // for it. // // It is easier this way. - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); saveDefaultYaml("default_menu", "gui"); saveDefaultYaml("shop_menu", "gui"); saveDefaultYaml("your_chests", "gui"); @@ -92,12 +92,12 @@ public FileConfiguration getGUIYaml(String guiName) { public String getGuiString(String gui, String path){ FileConfiguration yaml = getGUIYaml(gui); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); return libs.getMessageHandler().updateColors(yaml.getString(path, path + "ERROR")); } public void sendMessageLang(CommandSender target, String path) { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); libs.getMessageHandler().sendMessage(target, getMessageLang(path)); } diff --git a/src/main/java/me/waterarchery/litsellchest/handlers/GUIHandler.java b/src/main/java/me/waterarchery/litsellchest/handlers/GUIHandler.java index f41cf2c..4143d60 100644 --- a/src/main/java/me/waterarchery/litsellchest/handlers/GUIHandler.java +++ b/src/main/java/me/waterarchery/litsellchest/handlers/GUIHandler.java @@ -36,7 +36,7 @@ public static synchronized GUIHandler getInstance() { private GUIHandler() { initialize(); } public void initialize() { - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); ConfigManager defaultMenuFile = new ConfigManager(libs, "gui", "default_menu", false); defaultMenu = new DefaultMenu(defaultMenuFile, "default_menu", libs); @@ -55,7 +55,7 @@ public void openShop(Player player) { public ItemStack createItem(String menuName, String path){ ConfigHandler configHandler = ConfigHandler.getInstance(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); MessageHandler messageHandler = libs.getMessageHandler(); NBTAPIHook nbtapiHook = libs.getNBTAPIHook(); diff --git a/src/main/java/me/waterarchery/litsellchest/handlers/SoundManager.java b/src/main/java/me/waterarchery/litsellchest/handlers/SoundManager.java index 334a5f3..3a8fb50 100644 --- a/src/main/java/me/waterarchery/litsellchest/handlers/SoundManager.java +++ b/src/main/java/me/waterarchery/litsellchest/handlers/SoundManager.java @@ -10,7 +10,7 @@ public class SoundManager { public static void sendSound(Player player, String path) { ConfigHandler configHandler = ConfigHandler.getInstance(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); ConfigManager config = configHandler.getConfig(); SoundHandler soundHandler = libs.getSoundHandler(); diff --git a/src/main/java/me/waterarchery/litsellchest/listeners/ChestPlaceListener.java b/src/main/java/me/waterarchery/litsellchest/listeners/ChestPlaceListener.java index c553ad1..3070b81 100644 --- a/src/main/java/me/waterarchery/litsellchest/listeners/ChestPlaceListener.java +++ b/src/main/java/me/waterarchery/litsellchest/listeners/ChestPlaceListener.java @@ -30,7 +30,7 @@ public void onChestPlace(BlockPlaceEvent event) { ChestHandler chestHandler = ChestHandler.getInstance(); SellChestType chestType = chestHandler.getType(itemStack); ConfigHandler configHandler = ConfigHandler.getInstance(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); if (chestType != null) { if (chestHandler.isLocationValid(block.getLocation())) { diff --git a/src/main/java/me/waterarchery/litsellchest/listeners/MainMenuListener.java b/src/main/java/me/waterarchery/litsellchest/listeners/MainMenuListener.java index 26df139..f90c8c7 100644 --- a/src/main/java/me/waterarchery/litsellchest/listeners/MainMenuListener.java +++ b/src/main/java/me/waterarchery/litsellchest/listeners/MainMenuListener.java @@ -30,7 +30,7 @@ public void onMainMenuClick(InventoryClickEvent event) { String title = ConfigHandler.getInstance().getGuiString("default_menu", "default_menu" + ".name"); if (title.equalsIgnoreCase(menuTitle)) event.setCancelled(true); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); NBTAPIHook nbtapiHook = libs.getNBTAPIHook(); GUIHandler guiHandler = GUIHandler.getInstance(); Action action = nbtapiHook.getGUIAction(itemStack); diff --git a/src/main/java/me/waterarchery/litsellchest/listeners/ShopMenuListener.java b/src/main/java/me/waterarchery/litsellchest/listeners/ShopMenuListener.java index 712af48..01c6d82 100644 --- a/src/main/java/me/waterarchery/litsellchest/listeners/ShopMenuListener.java +++ b/src/main/java/me/waterarchery/litsellchest/listeners/ShopMenuListener.java @@ -27,7 +27,7 @@ public void onShopMenuClick(InventoryClickEvent event) { Inventory inventory = event.getClickedInventory(); ItemStack itemStack = event.getCurrentItem(); Player player = (Player) event.getWhoClicked(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); if (inventory != null && itemStack != null && itemStack.getType() != Material.AIR) { String menuTitle = CompatibilityUtil.getTitle(event); diff --git a/src/main/java/me/waterarchery/litsellchest/listeners/YourChestsMenuListener.java b/src/main/java/me/waterarchery/litsellchest/listeners/YourChestsMenuListener.java index 2b165dc..5a3133c 100644 --- a/src/main/java/me/waterarchery/litsellchest/listeners/YourChestsMenuListener.java +++ b/src/main/java/me/waterarchery/litsellchest/listeners/YourChestsMenuListener.java @@ -31,7 +31,7 @@ public void onMainMenuClick(InventoryClickEvent event) { String title = ConfigHandler.getInstance().getGuiString("your_chests", "your_chests" + ".name"); if (title.equalsIgnoreCase(menuTitle)) event.setCancelled(true); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); NBTAPIHook nbtapiHook = libs.getNBTAPIHook(); Action action = nbtapiHook.getGUIAction(itemStack); diff --git a/src/main/java/me/waterarchery/litsellchest/models/SellChest.java b/src/main/java/me/waterarchery/litsellchest/models/SellChest.java index 526e978..21797db 100644 --- a/src/main/java/me/waterarchery/litsellchest/models/SellChest.java +++ b/src/main/java/me/waterarchery/litsellchest/models/SellChest.java @@ -91,7 +91,7 @@ public List getHologramLines() { public String statusToText() { FileConfiguration yml = ConfigHandler.getInstance().getLang().getYml(); - LitLibs libs = LitSellChest.getInstance().getLibs(); + LitLibs libs = LitSellChest.getLibs(); MessageHandler mHandler = libs.getMessageHandler(); String statusText = ""; diff --git a/src/main/java/me/waterarchery/litsellchest/models/SellChestType.java b/src/main/java/me/waterarchery/litsellchest/models/SellChestType.java index bc6a0c0..e64943e 100644 --- a/src/main/java/me/waterarchery/litsellchest/models/SellChestType.java +++ b/src/main/java/me/waterarchery/litsellchest/models/SellChestType.java @@ -39,7 +39,7 @@ public SellChestType(String id) { public ItemStack toItemStack() { ConfigManager manager = ConfigHandler.getInstance().getChests(); FileConfiguration yml = manager.getYml(); - LitLibs lib = LitSellChest.getInstance().getLibs(); + LitLibs lib = LitSellChest.getLibs(); String rawMaterial = yml.getString(getId() + ".item.material", "STONE"); XMaterial material = XMaterial.valueOf(rawMaterial); String name = manager.getString(getId() + ".item.name");