From e03c0812ff61bfcc30977485a6072d464b5ccafa Mon Sep 17 00:00:00 2001 From: montlikadani Date: Tue, 29 Oct 2019 14:54:00 +0100 Subject: [PATCH] Remove unnecessarry class register for browse --- .../com/gamingmesh/jobs/Gui/GuiManager.java | 3 +- .../jobs/Gui/JobsInventoryHolder.java | 28 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 src/main/java/com/gamingmesh/jobs/Gui/JobsInventoryHolder.java diff --git a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java index 6c658e0d..bee69158 100644 --- a/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java +++ b/src/main/java/com/gamingmesh/jobs/Gui/GuiManager.java @@ -164,8 +164,7 @@ public class GuiManager { } public void openJobsBrowseGUI(Player player, Job job) { - - Inventory tempInv = Bukkit.createInventory(new JobsInventoryHolder(player), 54, ""); + Inventory tempInv = Bukkit.createInventory(player, 54, ""); ItemStack GuiItem = job.getGuiItem(); JobsPlayer JPlayer = Jobs.getPlayerManager().getJobsPlayer(player); diff --git a/src/main/java/com/gamingmesh/jobs/Gui/JobsInventoryHolder.java b/src/main/java/com/gamingmesh/jobs/Gui/JobsInventoryHolder.java deleted file mode 100644 index 83f9ce3a..00000000 --- a/src/main/java/com/gamingmesh/jobs/Gui/JobsInventoryHolder.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.gamingmesh.jobs.Gui; - -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.InventoryView; - -public class JobsInventoryHolder implements InventoryHolder { - - private Player player = null; - - public JobsInventoryHolder(Player player) { - this.player = player; - } - - @Override - public Inventory getInventory() { - return player.getOpenInventory().getTopInventory(); - } - - public InventoryView getOpenInventory() { - return player.getOpenInventory(); - } - - public Player getPlayer() { - return player; - } -}