1
0
mirror of https://github.com/nkomarn/harbor.git synced 2024-12-24 01:07:34 +01:00

Fix dependencies

This commit is contained in:
BuildTools 2019-05-08 07:22:10 -07:00
commit cf7d258738
4 changed files with 21 additions and 11 deletions

View File

@ -15,9 +15,9 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import mykyta.Harbor.Config; import mykyta.Harbor.Config;
import mykyta.Harbor.GUIType;
import mykyta.Harbor.Holder;
import mykyta.Harbor.Util; import mykyta.Harbor.Util;
import mykyta.Harbor.GUI.GUIHolder;
import mykyta.Harbor.GUI.GUIType;
public class Sleeping implements CommandExecutor { public class Sleeping implements CommandExecutor {
@ -32,7 +32,7 @@ public class Sleeping implements CommandExecutor {
Config config = new Config(); Config config = new Config();
ArrayList<Player> sleeping = Util.sleeping.get(w); ArrayList<Player> sleeping = Util.sleeping.get(w);
int slots = Math.min(54, ((sleeping.size() - 1) / 9 + 1) * 9); int slots = Math.min(54, ((sleeping.size() - 1) / 9 + 1) * 9);
gui = Bukkit.createInventory(new Holder(GUIType.SLEEPING), slots, config.getString("gui.sleeping")); gui = Bukkit.createInventory(new GUIHolder(GUIType.SLEEPING), slots, config.getString("gui.sleeping"));
if (sleeping.size() > 0) sleeping.forEach(pl -> { if (sleeping.size() > 0) sleeping.forEach(pl -> {
ItemStack item = new ItemStack(Material.PLAYER_HEAD, 1); ItemStack item = new ItemStack(Material.PLAYER_HEAD, 1);

View File

@ -5,14 +5,19 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.event.inventory.InventoryDragEvent;
import mykyta.Harbor.GUIType; import mykyta.Harbor.GUI.GUIType;
import mykyta.Harbor.Holder; import mykyta.Harbor.GUI.GUIHolder;
public class GUIEvent implements Listener { public class GUIEvent implements Listener {
@EventHandler @EventHandler
public void onClick(InventoryClickEvent event) { public void onClick(InventoryClickEvent event) {
if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) { if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) {
<<<<<<< HEAD
GUIType t = ((Holder) event.getInventory().getHolder()).getType(); GUIType t = ((Holder) event.getInventory().getHolder()).getType();
=======
Player p = ((Player) event.getWhoClicked());
GUIType t = ((GUIHolder) event.getInventory().getHolder()).getType();
>>>>>>> 0f80c831f481f11d5588813b6391b9162173782a
if (t.equals(GUIType.SLEEPING)) event.setCancelled(true); if (t.equals(GUIType.SLEEPING)) event.setCancelled(true);
} }
} }
@ -20,7 +25,12 @@ public class GUIEvent implements Listener {
@EventHandler @EventHandler
public void onDrag(InventoryDragEvent event) { public void onDrag(InventoryDragEvent event) {
if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) { if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) {
<<<<<<< HEAD
GUIType t = ((Holder) event.getInventory().getHolder()).getType(); GUIType t = ((Holder) event.getInventory().getHolder()).getType();
=======
Player p = ((Player) event.getWhoClicked());
GUIType t = ((GUIHolder) event.getInventory().getHolder()).getType();
>>>>>>> 0f80c831f481f11d5588813b6391b9162173782a
if (t.equals(GUIType.SLEEPING)) event.setCancelled(true); if (t.equals(GUIType.SLEEPING)) event.setCancelled(true);
} }
} }

View File

@ -1,13 +1,13 @@
package mykyta.Harbor; package mykyta.Harbor.GUI;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;
public class Holder implements InventoryHolder { public class GUIHolder implements InventoryHolder {
Inventory inv; private Inventory inv;
GUIType type; private GUIType type;
public Holder(GUIType type) { public GUIHolder(GUIType type) {
this.type = type; this.type = type;
} }

View File

@ -1,4 +1,4 @@
package mykyta.Harbor; package mykyta.Harbor.GUI;
public enum GUIType { public enum GUIType {
SLEEPING SLEEPING