From 2f668dbf556da708102e9c8ccb24be8c91a4cd9e Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 27 Oct 2022 13:05:04 +0200 Subject: [PATCH] Remove Unused and obsolet SWActionListInv.java --- .../de/steamwar/inventory/SWActionBar.java | 31 -------- .../steamwar/inventory/SWActionListInv.java | 73 ------------------- 2 files changed, 104 deletions(-) delete mode 100644 SpigotCore_Main/src/de/steamwar/inventory/SWActionBar.java delete mode 100644 SpigotCore_Main/src/de/steamwar/inventory/SWActionListInv.java diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SWActionBar.java b/SpigotCore_Main/src/de/steamwar/inventory/SWActionBar.java deleted file mode 100644 index c824347..0000000 --- a/SpigotCore_Main/src/de/steamwar/inventory/SWActionBar.java +++ /dev/null @@ -1,31 +0,0 @@ -package de.steamwar.inventory; - -public class SWActionBar { - - public enum Slot { - ZERO(0), - ONE(1), - TWO(2), - THREE(3), - FOUR(4), - FIVE(5), - SIX(6); - - private int index; - - Slot(int index) { - this.index = index; - } - - int getIndex() { - return index; - } - } - - SWItem[] actionBar = new SWItem[7]; - - public void setItem(Slot slot, SWItem item) { - actionBar[slot.getIndex()] = item; - } - -} diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SWActionListInv.java b/SpigotCore_Main/src/de/steamwar/inventory/SWActionListInv.java deleted file mode 100644 index 68ef71c..0000000 --- a/SpigotCore_Main/src/de/steamwar/inventory/SWActionListInv.java +++ /dev/null @@ -1,73 +0,0 @@ -package de.steamwar.inventory; - -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; - -import java.util.List; - -public class SWActionListInv extends SWInventory { - - private SWListInv.ListCallback callback; - private List> elements; - private SWActionBar actionBar = null; - private int page; - - public SWActionListInv(Player p, String t, List> l, SWListInv.ListCallback c){ - super(p, 54, t); - callback = c; - elements = l; - page = 0; - } - - public void setActionBar(SWActionBar actionBar) { - this.actionBar = actionBar; - } - - @Override - public void open(){ - inventory.clear(); - setCallback(-999, (ClickType click) -> player.closeInventory()); - if (page != 0) { - setItem(0, SWItem.getDye(10), (byte) 10, "§eSeite zurück", (ClickType click) -> { - page--; - open(); - }); - } else { - setItem(0, SWItem.getDye(8), (byte) 8, "§7Seite zurück", (ClickType click) -> {}); - } - if (page < elements.size() / 45) { - setItem(8, SWItem.getDye(10), (byte) 10, "§eSeite vor", (ClickType click) -> { - page++; - open(); - }); - } else { - setItem(8, SWItem.getDye(8), (byte) 8, "§7Seite vor", (ClickType click) -> {}); - } - - if (actionBar != null) { - for (int i = 0; i < 7; i++) { - setItem(i + 1, actionBar.actionBar[i]); - } - } - - int ipageLimit = elements.size() - page*45; - if(ipageLimit > 45 && elements.size() > 45){ - ipageLimit = 45; - } - int i = page*45; - for(int ipage=0; ipage < ipageLimit; ipage++ ){ - SWItem e = elements.get(i).getItem(); - - final int pos = i; - setItem(ipage + 9, e); - setCallback(ipage, (ClickType click) -> callback.clicked(click, elements.get(pos).getObject())); - i++; - } - super.open(); - } - - public void setCallback(SWListInv.ListCallback c){ - callback = c; - } - -} -- 2.39.5