From f0f16e377909a8768ff45bd1311d41714904cf2e Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 20 Jul 2016 19:09:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8DYum=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../BukkitInjectedTools/YumTestCommand.java | 2 +- .../BukkitInjectedTools/YumTestListener.java | 3 ++- .../event/YumTestEvent.java | 26 +------------------ 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/main/java/pw/yumc/BukkitInjectedTools/YumTestCommand.java b/src/main/java/pw/yumc/BukkitInjectedTools/YumTestCommand.java index e685845..6dcd32b 100644 --- a/src/main/java/pw/yumc/BukkitInjectedTools/YumTestCommand.java +++ b/src/main/java/pw/yumc/BukkitInjectedTools/YumTestCommand.java @@ -37,7 +37,7 @@ public class YumTestCommand implements HandlerCommands { @HandlerCommand(name = "event") public void event(final InvokeCommandEvent e) { - Bukkit.getPluginManager().callEvent(new YumTestEvent(downloading)); + Bukkit.getPluginManager().callEvent(new YumTestEvent()); } @HandlerCommand(name = "inject") diff --git a/src/main/java/pw/yumc/BukkitInjectedTools/YumTestListener.java b/src/main/java/pw/yumc/BukkitInjectedTools/YumTestListener.java index 6b78e93..494306d 100644 --- a/src/main/java/pw/yumc/BukkitInjectedTools/YumTestListener.java +++ b/src/main/java/pw/yumc/BukkitInjectedTools/YumTestListener.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import cn.citycraft.PluginHelper.kit.PKit; +import pw.yumc.BukkitInjectedTools.event.YumTestEvent; /** * @@ -17,7 +18,7 @@ public class YumTestListener implements Listener { } @EventHandler - public void onCommand(final YumTestListener e) { + public void onTest(final YumTestEvent e) { throw new IllegalArgumentException("Yum事件监控测试!"); } } diff --git a/src/main/java/pw/yumc/BukkitInjectedTools/event/YumTestEvent.java b/src/main/java/pw/yumc/BukkitInjectedTools/event/YumTestEvent.java index abca3c0..3a318a2 100644 --- a/src/main/java/pw/yumc/BukkitInjectedTools/event/YumTestEvent.java +++ b/src/main/java/pw/yumc/BukkitInjectedTools/event/YumTestEvent.java @@ -1,6 +1,5 @@ package pw.yumc.BukkitInjectedTools.event; -import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -10,14 +9,8 @@ import org.bukkit.event.HandlerList; * @since 2016年7月18日 下午7:07:37 * @author 喵♂呜 */ -public class YumTestEvent extends Event implements Cancellable { +public class YumTestEvent extends Event { private static final HandlerList handlers = new HandlerList(); - private final boolean value; - private boolean cancel = false; - - public YumTestEvent(final boolean value) { - this.value = value; - } public static HandlerList getHandlerList() { return handlers; @@ -27,21 +20,4 @@ public class YumTestEvent extends Event implements Cancellable { public HandlerList getHandlers() { return handlers; } - - @Override - public boolean isCancelled() { - return cancel; - } - - /** - * @return value - */ - public boolean isValue() { - return value; - } - - @Override - public void setCancelled(final boolean arg0) { - cancel = arg0; - } }