More Refactoring and Fix the InventoryListener
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
1e68437e0c
Commit
1b93548623
@ -31,7 +31,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
public class BauSystem extends JavaPlugin implements Listener {
|
public class BauSystem extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
package de.steamwar.bausystem.features.autostart;
|
package de.steamwar.bausystem.features.autostart;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
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.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
@ -31,8 +31,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@Linked(LinkageType.GUI_ITEM)
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class AutoStartGuiItem extends GuiItem {
|
public class AutoStartGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public AutoStartGuiItem() {
|
public AutoStartGuiItem() {
|
||||||
super(24);
|
super(24);
|
||||||
|
@ -21,20 +21,20 @@ package de.steamwar.bausystem.features.countingwand;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
import de.steamwar.bausystem.config.ColorConfig;
|
||||||
import de.steamwar.bausystem.features.gui.BauGUI;
|
import de.steamwar.bausystem.linkage.BauGuiItem;
|
||||||
import de.steamwar.bausystem.linkage.GuiItem;
|
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import java.util.Arrays;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
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() {
|
public CountingwandGuiItem() {
|
||||||
super(22);
|
super(22);
|
||||||
|
@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.redstonetester;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
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.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
@ -32,8 +32,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@Linked(LinkageType.GUI_ITEM)
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class RedstoneTesterGuiItem extends GuiItem {
|
public class RedstoneTesterGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public RedstoneTesterGuiItem() {
|
public RedstoneTesterGuiItem() {
|
||||||
super(23);
|
super(23);
|
||||||
|
@ -19,8 +19,9 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.world;
|
package de.steamwar.bausystem.features.world;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -29,12 +30,12 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
//@Linked(LinkageType.LISTENER)
|
@Linked(LinkageType.LISTENER)
|
||||||
public class InventoryListener implements Listener {
|
public class InventoryListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(InventoryClickEvent e) {
|
public void onInventoryClick(InventoryClickEvent e) {
|
||||||
ItemStack stack = e.getCursor();
|
ItemStack stack = e.getCurrentItem();
|
||||||
if (stack == null || !stack.hasItemMeta()) {
|
if (stack == null || !stack.hasItemMeta()) {
|
||||||
return;
|
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) {
|
if (Core.getVersion() < 15) {
|
||||||
e.setCurrentItem(stack);
|
e.setCurrentItem(stack);
|
||||||
return;
|
return;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren