SteamWar/BauSystem2.0
Archiviert
12
0

More Refactoring and Fix the InventoryListener

Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-05-03 09:23:10 +02:00
Ursprung 1e68437e0c
Commit 1b93548623
5 geänderte Dateien mit 17 neuen und 22 gelöschten Zeilen

Datei anzeigen

@ -31,7 +31,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.logging.Level;
public class BauSystem extends JavaPlugin implements Listener {

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.bausystem.features.autostart;
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 de.steamwar.inventory.SWItem;
@ -31,8 +31,8 @@ import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
@Linked(LinkageType.GUI_ITEM)
public class AutoStartGuiItem extends GuiItem {
@Linked(LinkageType.BAU_GUI_ITEM)
public class AutoStartGuiItem extends BauGuiItem {
public AutoStartGuiItem() {
super(24);

Datei anzeigen

@ -21,20 +21,20 @@ package de.steamwar.bausystem.features.countingwand;
import de.steamwar.bausystem.Permission;
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;
import java.util.Arrays;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
@Linked(LinkageType.GUI_ITEM)
public class CountingwandGuiItem extends GuiItem {
@Linked(LinkageType.BAU_GUI_ITEM)
public class CountingwandGuiItem extends BauGuiItem {
public CountingwandGuiItem() {
super(22);
@ -43,8 +43,8 @@ public class CountingwandGuiItem extends GuiItem {
@Override
public ItemStack getItem(Player player) {
return new SWItem(Material.STICK,
ColorConfig.HIGHLIGHT + "Counting Wand",
Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 1. Position",
ColorConfig.HIGHLIGHT + "Counting Wand",
Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 1. Position",
ColorConfig.HIGHLIGHT + "Rechtsklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 2. Position"),
false, clickType -> {
}).getItemStack();

Datei anzeigen

@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.redstonetester;
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,8 +32,8 @@ import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
@Linked(LinkageType.GUI_ITEM)
public class RedstoneTesterGuiItem extends GuiItem {
@Linked(LinkageType.BAU_GUI_ITEM)
public class RedstoneTesterGuiItem extends BauGuiItem {
public RedstoneTesterGuiItem() {
super(23);

Datei anzeigen

@ -19,8 +19,9 @@
package de.steamwar.bausystem.features.world;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.core.Core;
import org.bukkit.Material;
import org.bukkit.attribute.Attribute;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.EventHandler;
@ -29,12 +30,12 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
//@Linked(LinkageType.LISTENER)
@Linked(LinkageType.LISTENER)
public class InventoryListener implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
ItemStack stack = e.getCursor();
ItemStack stack = e.getCurrentItem();
if (stack == null || !stack.hasItemMeta()) {
return;
}
@ -47,11 +48,6 @@ public class InventoryListener implements Listener {
}
}
Material material = stack.getType();
if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) {
stack.setType(Material.MILK_BUCKET);
}
if (Core.getVersion() < 15) {
e.setCurrentItem(stack);
return;