From e1ff3542aec0de802f6a848c8a1dbe944dd65df2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 5 Oct 2013 02:41:08 +0100 Subject: [PATCH] Cleanup --- .../essentials/commands/Commandext.java | 5 ----- .../essentials/commands/Commandmsg.java | 2 +- .../essentials/commands/Commandpay.java | 2 +- .../api/events/IgnoreStatusChangeEvent.java | 1 - .../api/events/MuteStatusChangeEvent.java | 2 -- .../net/ess3/api/events/NickChangeEvent.java | 22 ++++++++++--------- .../net/ess3/api/events/StateChangeEvent.java | 15 +++++++------ .../ess3/api/events/StatusChangeEvent.java | 22 ++++++++++--------- 8 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandext.java b/Essentials/src/com/earth2me/essentials/commands/Commandext.java index 5f174298a..338a214cf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandext.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandext.java @@ -35,11 +35,6 @@ public class Commandext extends EssentialsLoopCommand return; } - if (args[0].trim().length() < 2) - { - throw new PlayerNotFoundException(); - } - loopOnlinePlayers(server, user.getBase(), true, args[0], null); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 2668f70c5..5749bb667 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -56,7 +56,7 @@ public class Commandmsg extends EssentialsLoopCommand return; } - loopOnlinePlayers(server, sender, true, args[0], new String[]{message}); + loopOnlinePlayers(server, sender, false, args[0], new String[]{message}); } @Override diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java index 9c10c7be0..c229d1a2b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java @@ -26,7 +26,7 @@ public class Commandpay extends EssentialsLoopCommand } amount = new BigDecimal(args[1].replaceAll("[^0-9\\.]", "")); - loopOnlinePlayers(server, user.getBase(), true, args[0], args); + loopOnlinePlayers(server, user.getBase(), false, args[0], args); } @Override diff --git a/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java index 27c23b50c..2ea76228f 100644 --- a/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java +++ b/Essentials/src/net/ess3/api/events/IgnoreStatusChangeEvent.java @@ -9,5 +9,4 @@ public class IgnoreStatusChangeEvent extends StatusChangeEvent { super(affected, controller, value); } - } diff --git a/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java b/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java index 3eb8885b2..428883d76 100644 --- a/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java +++ b/Essentials/src/net/ess3/api/events/MuteStatusChangeEvent.java @@ -5,10 +5,8 @@ import net.ess3.api.IUser; public class MuteStatusChangeEvent extends StatusChangeEvent { - public MuteStatusChangeEvent(IUser affected, IUser controller, boolean value) { super(affected, controller, value); } - } diff --git a/Essentials/src/net/ess3/api/events/NickChangeEvent.java b/Essentials/src/net/ess3/api/events/NickChangeEvent.java index 61222ca04..7ee3578dc 100644 --- a/Essentials/src/net/ess3/api/events/NickChangeEvent.java +++ b/Essentials/src/net/ess3/api/events/NickChangeEvent.java @@ -3,23 +3,25 @@ package net.ess3.api.events; import net.ess3.api.IUser; import org.bukkit.event.Cancellable; + public class NickChangeEvent extends StateChangeEvent implements Cancellable { private String newValue; - - public NickChangeEvent(IUser affected, IUser controller, String value) { + + public NickChangeEvent(IUser affected, IUser controller, String value) + { super(affected, controller); - this.newValue = value; - } - - public NickChangeEvent(boolean isAsync, IUser affected, IUser controller, String value) { + this.newValue = value; + } + + public NickChangeEvent(boolean isAsync, IUser affected, IUser controller, String value) + { super(isAsync, affected, controller); - this.newValue = value; - } - + this.newValue = value; + } + public String getValue() { return newValue; } - } diff --git a/Essentials/src/net/ess3/api/events/StateChangeEvent.java b/Essentials/src/net/ess3/api/events/StateChangeEvent.java index db7576d31..fc958b4a8 100644 --- a/Essentials/src/net/ess3/api/events/StateChangeEvent.java +++ b/Essentials/src/net/ess3/api/events/StateChangeEvent.java @@ -16,18 +16,20 @@ public class StateChangeEvent extends Event implements Cancellable private boolean cancelled = false; IUser affected; IUser controller; - - public StateChangeEvent(IUser affected, IUser controller) { + + public StateChangeEvent(IUser affected, IUser controller) + { super(); this.affected = affected; this.controller = controller; - } - - public StateChangeEvent(boolean isAsync, IUser affected, IUser controller) { + } + + public StateChangeEvent(boolean isAsync, IUser affected, IUser controller) + { super(isAsync); this.affected = affected; this.controller = controller; - } + } public IUser getAffected() { @@ -61,5 +63,4 @@ public class StateChangeEvent extends Event implements Cancellable { this.cancelled = cancelled; } - } diff --git a/Essentials/src/net/ess3/api/events/StatusChangeEvent.java b/Essentials/src/net/ess3/api/events/StatusChangeEvent.java index 8fc1316c4..d8d43a042 100644 --- a/Essentials/src/net/ess3/api/events/StatusChangeEvent.java +++ b/Essentials/src/net/ess3/api/events/StatusChangeEvent.java @@ -3,6 +3,7 @@ package net.ess3.api.events; import net.ess3.api.IUser; import org.bukkit.event.Cancellable; + /** * This handles common boilerplate for other StatusChangeEvents * @@ -10,20 +11,21 @@ import org.bukkit.event.Cancellable; public class StatusChangeEvent extends StateChangeEvent implements Cancellable { private boolean newValue; - - public StatusChangeEvent(IUser affected, IUser controller, boolean value) { + + public StatusChangeEvent(IUser affected, IUser controller, boolean value) + { super(affected, controller); - this.newValue = value; - } - - public StatusChangeEvent(boolean isAsync, IUser affected, IUser controller, boolean value) { + this.newValue = value; + } + + public StatusChangeEvent(boolean isAsync, IUser affected, IUser controller, boolean value) + { super(isAsync, affected, controller); - this.newValue = value; - } - + this.newValue = value; + } + public boolean getValue() { return newValue; } - }