diff options
author | Iaccidentally <coryhuckaby@gmail.com> | 2013-07-13 11:48:05 -0400 |
---|---|---|
committer | Iaccidentally <coryhuckaby@gmail.com> | 2013-07-13 11:48:05 -0400 |
commit | d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a (patch) | |
tree | af4dbf39c37b2a9f3e468a835cf708fa1b3f680e | |
parent | b8c39f13a6d7147c8f096805f746874577a48ea1 (diff) | |
download | Essentials-d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a.tar Essentials-d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a.tar.gz Essentials-d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a.tar.lz Essentials-d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a.tar.xz Essentials-d4e4cbe60ca1a4c184b6941ed1e0a4362908c02a.zip |
[API] Event framework
-rw-r--r-- | Essentials/src/net/ess3/api/events/AfkStatusChangeEvent.java | 10 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/GodStatusChangeEvent.java | 10 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java | 11 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/JailStatusChangeEvent.java | 10 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java | 40 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java | 10 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/events/StatusChangeEvent.java (renamed from Essentials/src/net/ess3/api/events/UserToggleGodmodeEvent.java) | 41 |
7 files changed, 117 insertions, 15 deletions
diff --git a/Essentials/src/net/ess3/api/events/AfkStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/AfkStatusChangeEvent.java new file mode 100644 index 000000000..2d76b46d5 --- /dev/null +++ b/Essentials/src/net/ess3/api/events/AfkStatusChangeEvent.java @@ -0,0 +1,10 @@ +package net.ess3.api.events; + + +public class AfkStatusChangeEvent extends StatusChangeEvent +{ + public AfkStatusChangeEvent() + { + + } +} diff --git a/Essentials/src/net/ess3/api/events/GodStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/GodStatusChangeEvent.java new file mode 100644 index 000000000..857abf818 --- /dev/null +++ b/Essentials/src/net/ess3/api/events/GodStatusChangeEvent.java @@ -0,0 +1,10 @@ +package net.ess3.api.events; + + +public class GodStatusChangeEvent extends StatusChangeEvent +{ + public GodStatusChangeEvent() + { + + } +} diff --git a/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java new file mode 100644 index 000000000..14baf6c4a --- /dev/null +++ b/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java @@ -0,0 +1,11 @@ +package net.ess3.api.events; + + +public class IgnoreStatusChangeEvent extends StatusChangeEvent +{ + public IgnoreStatusChangeEvent() + { + + } + +} diff --git a/Essentials/src/net/ess3/api/events/JailStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/JailStatusChangeEvent.java new file mode 100644 index 000000000..25947f863 --- /dev/null +++ b/Essentials/src/net/ess3/api/events/JailStatusChangeEvent.java @@ -0,0 +1,10 @@ +package net.ess3.api.events; + + +public class JailStatusChangeEvent extends StatusChangeEvent +{ + public JailStatusChangeEvent() + { + + } +}
\ No newline at end of file diff --git a/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java b/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java new file mode 100644 index 000000000..8b3142967 --- /dev/null +++ b/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java @@ -0,0 +1,40 @@ +package net.ess3.api.events; + +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + + +public class LocalChatSpyEvent extends Event implements Cancellable +{ + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + + public LocalChatSpyEvent() + { + + } + + @Override + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + @Override + public boolean isCancelled() + { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) + { + this.cancelled = cancelled; + } +} diff --git a/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java new file mode 100644 index 000000000..f5d4bf866 --- /dev/null +++ b/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java @@ -0,0 +1,10 @@ +package net.ess3.api.events; + + +public class MuteStatusChangeEvent extends StatusChangeEvent +{ + public MuteStatusChangeEvent() + { + + } +} diff --git a/Essentials/src/net/ess3/api/events/UserToggleGodmodeEvent.java b/Essentials/src/net/ess3/api/events/StatusChangeEvent.java index 0b50a92ae..fe65e676a 100644 --- a/Essentials/src/net/ess3/api/events/UserToggleGodmodeEvent.java +++ b/Essentials/src/net/ess3/api/events/StatusChangeEvent.java @@ -6,24 +6,35 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -public class UserToggleGodmodeEvent extends Event implements Cancellable +/** + * This handles common boilerplate for other StatusChangeEvents + * + */ +public class StatusChangeEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancelled; - private User user; - private boolean enabled; - - /** - * Thrown when a user's god mode is toggled. - * - * @param user - the user whose god mode is toggled. - * @param enabled - true if god mode was enabled, false if disabled. - */ - public UserToggleGodmodeEvent (User user, boolean enabled) - { - enabled = this.enabled; - user = this.user; - this.cancelled = false; + User affected; + User controller; + + public User getAffected() + { + return this.affected; + } + + public void setAffected(User user) + { + this.affected = user; + } + + public User getController() + { + return controller; + } + + public void setController(User user) + { + this.controller = user; } @Override |