mirror of
https://github.com/nkomarn/harbor.git
synced 2024-12-19 14:57:38 +01:00
Fix dependencies
This commit is contained in:
commit
cf7d258738
@ -15,9 +15,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import mykyta.Harbor.Config;
|
||||
import mykyta.Harbor.GUIType;
|
||||
import mykyta.Harbor.Holder;
|
||||
import mykyta.Harbor.Util;
|
||||
import mykyta.Harbor.GUI.GUIHolder;
|
||||
import mykyta.Harbor.GUI.GUIType;
|
||||
|
||||
public class Sleeping implements CommandExecutor {
|
||||
|
||||
@ -32,7 +32,7 @@ public class Sleeping implements CommandExecutor {
|
||||
Config config = new Config();
|
||||
ArrayList<Player> sleeping = Util.sleeping.get(w);
|
||||
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 -> {
|
||||
ItemStack item = new ItemStack(Material.PLAYER_HEAD, 1);
|
||||
|
@ -5,14 +5,19 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
|
||||
import mykyta.Harbor.GUIType;
|
||||
import mykyta.Harbor.Holder;
|
||||
import mykyta.Harbor.GUI.GUIType;
|
||||
import mykyta.Harbor.GUI.GUIHolder;
|
||||
|
||||
public class GUIEvent implements Listener {
|
||||
@EventHandler
|
||||
public void onClick(InventoryClickEvent event) {
|
||||
if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) {
|
||||
<<<<<<< HEAD
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -20,7 +25,12 @@ public class GUIEvent implements Listener {
|
||||
@EventHandler
|
||||
public void onDrag(InventoryDragEvent event) {
|
||||
if (event.getInventory().getHolder() != null && event.getInventory().getHolder() instanceof Holder) {
|
||||
<<<<<<< HEAD
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package mykyta.Harbor;
|
||||
package mykyta.Harbor.GUI;
|
||||
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
|
||||
public class Holder implements InventoryHolder {
|
||||
Inventory inv;
|
||||
GUIType type;
|
||||
public class GUIHolder implements InventoryHolder {
|
||||
private Inventory inv;
|
||||
private GUIType type;
|
||||
|
||||
public Holder(GUIType type) {
|
||||
public GUIHolder(GUIType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mykyta.Harbor;
|
||||
package mykyta.Harbor.GUI;
|
||||
|
||||
public enum GUIType {
|
||||
SLEEPING
|
Loading…
Reference in New Issue
Block a user