From 6f24ca0f181331b5f1d729301622375f91212ca1 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 3 May 2021 08:08:58 +0200 Subject: [PATCH] Some refactoring Signed-off-by: Chaoscaot --- ...nfoGuiItem.java => BauInfoBauGuiItem.java} | 8 ++-- ...rGuiItem.java => DetonatorBauGuiItem.java} | 8 ++-- .../bausystem/features/gui/BauGUI.java | 6 +-- ...uGuiGuiItem.java => BauGuiBauGuiItem.java} | 8 ++-- .../features/gui/editor/BauGuiEditor.java | 46 +++++++++---------- .../features/gui/editor/TempClass.java | 4 +- ...aderGuiItem.java => LoaderBauGuiItem.java} | 8 ++-- ...rtGuiItem.java => TeleportBauGuiItem.java} | 8 ++-- ...ColorGuiItem.java => ColorBauGuiItem.java} | 8 ++-- .../{FireGuiItem.java => FireBauGuiItem.java} | 8 ++-- ...eezeGuiItem.java => FreezeBauGuiItem.java} | 8 ++-- ...ectGuiItem.java => ProtectBauGuiItem.java} | 8 ++-- ...ResetGuiItem.java => ResetBauGuiItem.java} | 8 ++-- ...kGuiItem.java => TestblockBauGuiItem.java} | 8 ++-- .../{TntGuiItem.java => TntBauGuiItem.java} | 8 ++-- ...GuiItem.java => ScriptBookBauGuiItem.java} | 8 ++-- ...rGuiItem.java => SimulatorBauGuiItem.java} | 8 ++-- ...itGuiItem.java => TPSLimitBauGuiItem.java} | 8 ++-- ...acerGuiItem.java => TracerBauGuiItem.java} | 8 ++-- ...GuiItem.java => DebugstickBauGuiItem.java} | 8 ++-- ...uiItem.java => NightVisionBauGuiItem.java} | 8 ++-- ...lectGuiItem.java => SelectBauGuiItem.java} | 8 ++-- ...SkullGuiItem.java => SkullBauGuiItem.java} | 8 ++-- ...SpeedGuiItem.java => SpeedBauGuiItem.java} | 8 ++-- ...uiItem.java => WaterVisionBauGuiItem.java} | 8 ++-- .../bausystem/linkage/BauGuiItem.java | 38 +++++++++++++++ .../steamwar/bausystem/linkage/GuiItem.java | 14 ------ .../bausystem/linkage/LinkageType.java | 2 +- 28 files changed, 155 insertions(+), 131 deletions(-) rename BauSystem_Main/src/de/steamwar/bausystem/features/bau/{BauInfoGuiItem.java => BauInfoBauGuiItem.java} (94%) rename BauSystem_Main/src/de/steamwar/bausystem/features/detonator/{DetonatorGuiItem.java => DetonatorBauGuiItem.java} (89%) rename BauSystem_Main/src/de/steamwar/bausystem/features/gui/{BauGuiGuiItem.java => BauGuiBauGuiItem.java} (91%) rename BauSystem_Main/src/de/steamwar/bausystem/features/loader/{LoaderGuiItem.java => LoaderBauGuiItem.java} (96%) rename BauSystem_Main/src/de/steamwar/bausystem/features/other/items/{TeleportGuiItem.java => TeleportBauGuiItem.java} (91%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{ColorGuiItem.java => ColorBauGuiItem.java} (96%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{FireGuiItem.java => FireBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{FreezeGuiItem.java => FreezeBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{ProtectGuiItem.java => ProtectBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{ResetGuiItem.java => ResetBauGuiItem.java} (94%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{TestblockGuiItem.java => TestblockBauGuiItem.java} (94%) rename BauSystem_Main/src/de/steamwar/bausystem/features/region/items/{TntGuiItem.java => TntBauGuiItem.java} (96%) rename BauSystem_Main/src/de/steamwar/bausystem/features/script/{ScriptBookGuiItem.java => ScriptBookBauGuiItem.java} (90%) rename BauSystem_Main/src/de/steamwar/bausystem/features/simulator/{SimulatorGuiItem.java => SimulatorBauGuiItem.java} (90%) rename BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/{TPSLimitGuiItem.java => TPSLimitBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/tracer/{TracerGuiItem.java => TracerBauGuiItem.java} (91%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{DebugstickGuiItem.java => DebugstickBauGuiItem.java} (90%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{NightVisionGuiItem.java => NightVisionBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{SelectGuiItem.java => SelectBauGuiItem.java} (96%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{SkullGuiItem.java => SkullBauGuiItem.java} (91%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{SpeedGuiItem.java => SpeedBauGuiItem.java} (92%) rename BauSystem_Main/src/de/steamwar/bausystem/features/util/items/{WaterVisionGuiItem.java => WaterVisionBauGuiItem.java} (91%) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/linkage/BauGuiItem.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java similarity index 94% rename from BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java index 024df347..d7166cd8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java @@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.bau; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; @@ -36,10 +36,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class BauInfoGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class BauInfoBauGuiItem extends BauGuiItem { - public BauInfoGuiItem() { + public BauInfoBauGuiItem() { super(7); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java similarity index 89% rename from BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java index 65633e94..d047fc63 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorBauGuiItem.java @@ -20,17 +20,17 @@ package de.steamwar.bausystem.features.detonator; import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class DetonatorGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class DetonatorBauGuiItem extends BauGuiItem { - public DetonatorGuiItem() { + public DetonatorBauGuiItem() { super(8); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java index 710d2695..94e29ef3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java @@ -24,7 +24,7 @@ import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.gui.editor.BauGuiMapping; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.inventory.SWInventory; import lombok.Getter; import lombok.experimental.UtilityClass; @@ -39,7 +39,7 @@ import java.util.*; public class BauGUI { @Getter - private static final HashMap ITEMS = new HashMap<>(); + private static final HashMap ITEMS = new HashMap<>(); private static final Set OPEN_INVS = new HashSet<>(); private static boolean updating = false; @@ -54,7 +54,7 @@ public class BauGUI { GUI_ITEM.setItemMeta(meta); } - public static void addItem(GuiItem item) { + public static void addItem(BauGuiItem item) { ITEMS.put(item.getId(), item); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java similarity index 91% rename from BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java index d4f8792c..a7ce138c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.gui; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -32,10 +32,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class BauGuiGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class BauGuiBauGuiItem extends BauGuiItem { - public BauGuiGuiItem() { + public BauGuiBauGuiItem() { super(14); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java index c1697c6b..6b32acda 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java @@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.gui.editor; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.gui.BauGUI; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -45,10 +45,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataType; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Linked(LinkageType.LISTENER) public class BauGuiEditor implements Listener { @@ -74,7 +71,8 @@ public class BauGuiEditor implements Listener { inv.setItem(mapping.getSize() + 3, new SWItem(mapping.getSize() == 9 * 5 ? Material.GRAY_STAINED_GLASS_PANE : Material.LIME_STAINED_GLASS_PANE, ColorConfig.HIGHLIGHT + "+1 Zeile").getItemStack()); inv.setItem(mapping.getSize() + 2, new SWItem(mapping.getSize() == 9 ? Material.GRAY_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE, ColorConfig.HIGHLIGHT + "-1 Zeile").getItemStack()); - inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, ColorConfig.ERROR + "Trashcan").getItemStack()); + inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, ColorConfig.ERROR + "Trashcan", Arrays.asList(ColorConfig.BASE + "Item hier rein Legen"), false, clickType -> { + }).getItemStack()); inv.setItem(mapping.getSize() + 6, new SWItem(Material.SCUTE, ColorConfig.HIGHLIGHT + "Mehr Items").getItemStack()); p.openInventory(inv); @@ -116,28 +114,34 @@ public class BauGuiEditor implements Listener { return; } - switch (i.getType()) { - case RED_STAINED_GLASS_PANE: - event.setCancelled(true); + if (event.getSlot() - mapping.getSize() >= 0) { + event.setCancelled(true); + } + + switch (event.getSlot() - mapping.getSize()) { + case 2: + if (mapping.getSize() == 9) { + return; + } saveMapping(p); mapping.setSize(mapping.getSize() - 9); openGuiEditor(p, event.getCursor()); break; - case LIME_STAINED_GLASS_PANE: - event.setCancelled(true); + case 3: + if (mapping.getSize() == 9 * 5) { + return; + } saveMapping(p); mapping.setSize(mapping.getSize() + 9); openGuiEditor(p, event.getCursor()); break; - case BARRIER: - event.setCancelled(true); + case 5: event.getView().setCursor(new SWItem().getItemStack()); break; - case SCUTE: - event.setCancelled(true); + case 6: saveMapping(p); - List> items = new ArrayList<>(); - for (GuiItem item : BauGUI.getITEMS().values()) { + List> items = new ArrayList<>(); + for (BauGuiItem item : BauGUI.getITEMS().values()) { if (mapping.isShown(item.getId())) { continue; } @@ -148,15 +152,11 @@ public class BauGuiEditor implements Listener { if (items.isEmpty()) { return; } - SWListInv inv = new SWListInv<>(p, "Item auswählen", items, (clickType, item) -> { + SWListInv inv = new SWListInv<>(p, "Item auswählen", items, (clickType, item) -> { openGuiEditor(p, addId(item.getItem(p), item.getId())); }); inv.open(); break; - case WHITE_STAINED_GLASS_PANE: - case GRAY_STAINED_GLASS_PANE: - event.setCancelled(true); - break; default: } } @@ -202,7 +202,7 @@ public class BauGuiEditor implements Listener { newMapping.put(getId(itemStack), i); } - for (Map.Entry e : BauGUI.getITEMS().entrySet()) { + for (Map.Entry e : BauGUI.getITEMS().entrySet()) { if (!newMapping.containsKey(e.getKey())) { newMapping.put(e.getKey(), -1); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/TempClass.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/TempClass.java index 95ba462a..bf1588f6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/TempClass.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/TempClass.java @@ -20,7 +20,7 @@ package de.steamwar.bausystem.features.gui.editor; import de.steamwar.bausystem.features.gui.BauGUI; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import java.util.HashMap; import java.util.Random; @@ -37,7 +37,7 @@ public class TempClass { Random rnd = new Random(); int size = (rnd.nextInt(5) + 1) * 9; HashMap mapping = new HashMap<>(); - for (GuiItem item : BauGUI.getITEMS().values()) { + for (BauGuiItem item : BauGUI.getITEMS().values()) { int slot; int i = 0; do { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderBauGuiItem.java similarity index 96% rename from BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderBauGuiItem.java index 72146653..883f1e00 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.loader; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWAnvilInv; @@ -34,10 +34,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class LoaderGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class LoaderBauGuiItem extends BauGuiItem { - public LoaderGuiItem() { + public LoaderBauGuiItem() { super(9); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java similarity index 91% rename from BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java index 7cff9862..e66e1798 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.other.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWAnvilInv; @@ -31,10 +31,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class TeleportGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class TeleportBauGuiItem extends BauGuiItem { - public TeleportGuiItem() { + public TeleportBauGuiItem() { super(10); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java similarity index 96% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java index 63964374..86830beb 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Color; @@ -39,10 +39,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -@Linked(LinkageType.GUI_ITEM) -public class ColorGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class ColorBauGuiItem extends BauGuiItem { - public ColorGuiItem() { + public ColorBauGuiItem() { super(2); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java index d7e95a8e..466ea5fe 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; @@ -33,10 +33,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class FireGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class FireBauGuiItem extends BauGuiItem { - public FireGuiItem() { + public FireBauGuiItem() { super(3); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java index e1be375f..7d01aee9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; @@ -33,10 +33,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class FreezeGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class FreezeBauGuiItem extends BauGuiItem { - public FreezeGuiItem() { + public FreezeBauGuiItem() { super(1); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java index e205d078..79f6721e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; @@ -33,10 +33,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class ProtectGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class ProtectBauGuiItem extends BauGuiItem { - public ProtectGuiItem() { + public ProtectBauGuiItem() { super(4); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java similarity index 94% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java index 320da440..93162bc6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -36,10 +36,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -@Linked(LinkageType.GUI_ITEM) -public class ResetGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class ResetBauGuiItem extends BauGuiItem { - public ResetGuiItem() { + public ResetBauGuiItem() { super(6); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java similarity index 94% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java index d05151a5..88069553 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -36,10 +36,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -@Linked(LinkageType.GUI_ITEM) -public class TestblockGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class TestblockBauGuiItem extends BauGuiItem { - public TestblockGuiItem() { + public TestblockBauGuiItem() { super(5); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java similarity index 96% rename from BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java index af9e7a6c..85255759 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.region.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; @@ -34,10 +34,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class TntGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class TntBauGuiItem extends BauGuiItem { - public TntGuiItem() { + public TntBauGuiItem() { super(0); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookBauGuiItem.java similarity index 90% rename from BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookBauGuiItem.java index 696918cf..0345724b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptBookBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.script; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -30,10 +30,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class ScriptBookGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class ScriptBookBauGuiItem extends BauGuiItem { - public ScriptBookGuiItem() { + public ScriptBookBauGuiItem() { super(15); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorBauGuiItem.java similarity index 90% rename from BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorBauGuiItem.java index 97b46d2d..ab6f1fd6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.simulator; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -30,10 +30,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class SimulatorGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class SimulatorBauGuiItem extends BauGuiItem { - public SimulatorGuiItem() { + public SimulatorBauGuiItem() { super(20); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitBauGuiItem.java index 2cd1924a..ec97d98c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.tpslimit; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWAnvilInv; @@ -33,10 +33,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class TPSLimitGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class TPSLimitBauGuiItem extends BauGuiItem { - public TPSLimitGuiItem() { + public TPSLimitBauGuiItem() { super(19); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java similarity index 91% rename from BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java index 6b9d61d0..ce273409 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java @@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.tracer; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.tracer.record.RecordStateMachine; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -33,10 +33,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class TracerGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class TracerBauGuiItem extends BauGuiItem { - public TracerGuiItem() { + public TracerBauGuiItem() { super(21); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java similarity index 90% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java index b187f728..ba4d20e3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -30,10 +30,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class DebugstickGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class DebugstickBauGuiItem extends BauGuiItem { - public DebugstickGuiItem() { + public DebugstickBauGuiItem() { super(12); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java index b168e336..4c9f448c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -33,10 +33,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.PotionEffectType; -@Linked(LinkageType.GUI_ITEM) -public class NightVisionGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class NightVisionBauGuiItem extends BauGuiItem { - public NightVisionGuiItem() { + public NightVisionBauGuiItem() { super(11); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java similarity index 96% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java index 24d8c304..75894a2e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SelectBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.utils.RegionExtensionType; @@ -40,12 +40,12 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -@Linked(LinkageType.GUI_ITEM) -public class SelectGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class SelectBauGuiItem extends BauGuiItem { private static final Map LAST_SELECT_MAP = new HashMap<>(); - public SelectGuiItem() { + public SelectBauGuiItem() { super(13); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java similarity index 91% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java index e14f4c2f..de26862c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWAnvilInv; @@ -31,10 +31,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@Linked(LinkageType.GUI_ITEM) -public class SkullGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class SkullBauGuiItem extends BauGuiItem { - public SkullGuiItem() { + public SkullBauGuiItem() { super(16); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedBauGuiItem.java similarity index 92% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedBauGuiItem.java index d2139886..1d58911f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SpeedBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWAnvilInv; @@ -33,10 +33,10 @@ import org.bukkit.inventory.ItemStack; import java.util.Arrays; -@Linked(LinkageType.GUI_ITEM) -public class SpeedGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class SpeedBauGuiItem extends BauGuiItem { - public SpeedGuiItem() { + public SpeedBauGuiItem() { super(17); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionBauGuiItem.java similarity index 91% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionGuiItem.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionBauGuiItem.java index c6a8999d..1ac79af1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WaterVisionBauGuiItem.java @@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.GuiItem; +import de.steamwar.bausystem.linkage.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.inventory.SWItem; @@ -31,10 +31,10 @@ import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; -@Linked(LinkageType.GUI_ITEM) -public class WaterVisionGuiItem extends GuiItem { +@Linked(LinkageType.BAU_GUI_ITEM) +public class WaterVisionBauGuiItem extends BauGuiItem { - public WaterVisionGuiItem() { + public WaterVisionBauGuiItem() { super(18); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/BauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/linkage/BauGuiItem.java new file mode 100644 index 00000000..8193d412 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/linkage/BauGuiItem.java @@ -0,0 +1,38 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2021 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.linkage; + +import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.features.gui.BauGUI; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public abstract class BauGuiItem extends GuiItem { + + @Getter + private final int id; + + public void update() { + BauGUI.update(); + } + + public abstract Permission permission(); +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/GuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/linkage/GuiItem.java index 5981da75..d7d9de28 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/linkage/GuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/linkage/GuiItem.java @@ -19,27 +19,13 @@ package de.steamwar.bausystem.linkage; -import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.features.gui.BauGUI; -import lombok.AllArgsConstructor; -import lombok.Getter; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -@AllArgsConstructor public abstract class GuiItem { - @Getter - private final int id; - public abstract ItemStack getItem(Player player); public abstract boolean click(ClickType click, Player p); - - public void update() { - BauGUI.update(); - } - - public abstract Permission permission(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java b/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java index 32f2d4ae..e70107ee 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java @@ -46,7 +46,7 @@ public enum LinkageType { PLAIN(1, false, clazz -> true), LISTENER(2, false, Listener.class::isAssignableFrom, o -> Bukkit.getPluginManager().registerEvents((Listener) o, BauSystem.getInstance())), UNLINK_LISTENER(2, true, Listener.class::isAssignableFrom, o -> HandlerList.unregisterAll((Listener) o)), - GUI_ITEM(3, false, GuiItem.class::isAssignableFrom, o -> BauGUI.addItem((GuiItem) o)), + BAU_GUI_ITEM(3, false, BauGuiItem.class::isAssignableFrom, o -> BauGUI.addItem((BauGuiItem) o)), SCRIPT_COMMAND(4, false, SpecialCommand.class::isAssignableFrom, o -> ScriptExecutor.SPECIAL_COMMANDS.add((SpecialCommand) o)), CONFIG_CONVERTER(5, false, ConfigConverter.class::isAssignableFrom, o -> ConfigUpdater.addConfigConverter((ConfigConverter) o));