From bea7ccae469940d547e0cf8db8ae7a5d41e0da0c Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 12 Feb 2015 11:59:36 +0100 Subject: [PATCH] MassiveCommandException --> Exception --- .../massivecore/MassiveException.java | 50 ++++++++++++++ .../massivecore/cmd/HelpCommand.java | 3 +- .../massivecore/cmd/MassiveCommand.java | 19 ++--- .../cmd/MassiveCommandException.java | 69 ------------------- .../cmd/arg/ARAbstractPrimitive.java | 6 +- .../massivecore/cmd/arg/ARAbstractSelect.java | 6 +- .../massivecore/cmd/arg/ARList.java | 4 +- .../massivecore/cmd/arg/ARMaterial.java | 6 +- .../massivecore/cmd/arg/ARMillisDiff.java | 6 +- .../massivecore/cmd/arg/ARPermission.java | 6 +- .../cmd/arg/ARSenderIdAbstract.java | 6 +- .../massivecore/cmd/arg/ARSet.java | 4 +- .../massivecore/cmd/arg/ARSound.java | 6 +- .../massivecore/cmd/arg/ARSoundEffect.java | 6 +- .../massivecore/cmd/arg/ARSoundEffects.java | 6 +- .../massivecore/cmd/arg/ARUniverse.java | 6 +- .../massivecore/cmd/arg/ARWorld.java | 6 +- .../massivecore/cmd/arg/ArgReader.java | 10 +-- .../cmd/arg/ArgReaderAbstract.java | 8 +-- .../CmdMassiveCoreBufferWhitespace.java | 4 +- .../massivecore/CmdMassiveCoreHearsound.java | 4 +- .../CmdMassiveCoreStoreListcolls.java | 4 +- .../massivecore/CmdMassiveCoreStoreStats.java | 4 +- .../cmd/massivecore/CmdMassiveCoreTest.java | 4 +- .../CmdMassiveCoreUsysAspectList.java | 4 +- .../CmdMassiveCoreUsysAspectShow.java | 4 +- .../CmdMassiveCoreUsysAspectUse.java | 4 +- .../CmdMassiveCoreUsysMultiverseDel.java | 4 +- .../CmdMassiveCoreUsysMultiverseList.java | 4 +- .../CmdMassiveCoreUsysMultiverseShow.java | 4 +- .../CmdMassiveCoreUsysUniverseClear.java | 4 +- .../CmdMassiveCoreUsysUniverseDel.java | 4 +- .../CmdMassiveCoreUsysUniverseNew.java | 4 +- .../massivecore/CmdMassiveCoreUsysWorld.java | 4 +- .../massivecraft/massivecore/util/Txt.java | 2 +- 35 files changed, 139 insertions(+), 156 deletions(-) create mode 100644 src/com/massivecraft/massivecore/MassiveException.java delete mode 100644 src/com/massivecraft/massivecore/cmd/MassiveCommandException.java diff --git a/src/com/massivecraft/massivecore/MassiveException.java b/src/com/massivecraft/massivecore/MassiveException.java new file mode 100644 index 00000000..ce27a314 --- /dev/null +++ b/src/com/massivecraft/massivecore/MassiveException.java @@ -0,0 +1,50 @@ +package com.massivecraft.massivecore; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import com.massivecraft.massivecore.collections.MassiveList; +import com.massivecraft.massivecore.util.Txt; + + +public class MassiveException extends Exception +{ + // -------------------------------------------- // + // CONSTANTS + // -------------------------------------------- // + + private static final long serialVersionUID = 1L; + + // -------------------------------------------- // + // MESSAGES + // -------------------------------------------- // + + protected List messages = new MassiveList(); + public List getMessages() { return this.messages; } + + @Override + public String getMessage() + { + return Txt.implode(this.getMessages(), "\n"); + } + + public MassiveException setMessage(String message) { this.messages = new MassiveList(message); return this; } + public MassiveException setMsg(String msg) { return this.setMessage(Txt.parse(msg)); } + public MassiveException setMsg(String msg, Object... args) { return this.setMessage(Txt.parse(msg, args)); } + + public MassiveException addMessage(String message) { this.getMessages().add(message); return this; } + public MassiveException addMsg(String msg) { return this.addMessage(Txt.parse(msg)); } + public MassiveException addMsg(String msg, Object... args) { return this.addMessage(Txt.parse(msg, args)); } + + public MassiveException setMessages(Collection messages) { this.messages = new MassiveList(messages); return this; } + public MassiveException setMessages(String... messages) { return this.setMessages(Arrays.asList(messages)); } + public MassiveException setMsgs(Collection msgs) { return this.setMessages(Txt.parse(msgs)); } + public MassiveException setMsgs(String... msgs) { return this.setMsgs(Arrays.asList(msgs)); } + + public MassiveException addMessages(Collection messages) { this.getMessages().addAll(messages); return this; } + public MassiveException addMessages(String... messages) { return this.addMessages(Arrays.asList(messages)); } + public MassiveException addMsgs(Collection messages) { this.getMessages().addAll(messages); return this; } + public MassiveException addMsgs(String... msgs) { return this.addMsgs(Arrays.asList(msgs)); } + +} diff --git a/src/com/massivecraft/massivecore/cmd/HelpCommand.java b/src/com/massivecraft/massivecore/cmd/HelpCommand.java index 864d11c4..9de504b3 100644 --- a/src/com/massivecraft/massivecore/cmd/HelpCommand.java +++ b/src/com/massivecraft/massivecore/cmd/HelpCommand.java @@ -2,6 +2,7 @@ package com.massivecraft.massivecore.cmd; import java.util.ArrayList; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.cmd.arg.ARInteger; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +32,7 @@ public class HelpCommand extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args Integer pagenumber = this.arg(0, ARInteger.get(), 1); diff --git a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java index e6f66f67..1c86255f 100644 --- a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java +++ b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java @@ -16,6 +16,7 @@ import org.bukkit.plugin.Plugin; import com.massivecraft.massivecore.Lang; import com.massivecraft.massivecore.MassiveCore; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.arg.ArgReader; import com.massivecraft.massivecore.cmd.req.Req; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -344,7 +345,7 @@ public class MassiveCommand perform(); } } - catch (MassiveCommandException ex) + catch (MassiveException ex) { // Sometimes ArgReaders (or commands themself) throw exceptions, to stop executing and notify the user. Mixin.messageOne(sender, ex.getMessages()); @@ -373,7 +374,7 @@ public class MassiveCommand } // This is where the command action is performed. - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Per default we just act as the help command! List commandChain = new ArrayList(this.getCommandChain()); @@ -621,13 +622,13 @@ public class MassiveCommand return this.getArgs().get(idx); } - public T arg(int idx, ArgReader argReader) throws MassiveCommandException + public T arg(int idx, ArgReader argReader) throws MassiveException { String str = this.arg(idx); return this.arg(str, argReader); } - public T arg(int idx, ArgReader argReader, T defaultNotSet) throws MassiveCommandException + public T arg(int idx, ArgReader argReader, T defaultNotSet) throws MassiveException { String str = this.arg(idx); return this.arg(str, argReader, defaultNotSet); @@ -644,13 +645,13 @@ public class MassiveCommand return Txt.implode(this.getArgs().subList(from, to), " "); } - public T argConcatFrom(int idx, ArgReader argReader) throws MassiveCommandException + public T argConcatFrom(int idx, ArgReader argReader) throws MassiveException { String str = this.argConcatFrom(idx); return this.arg(str, argReader); } - public T argConcatFrom(int idx, ArgReader argReader, T defaultNotSet) throws MassiveCommandException + public T argConcatFrom(int idx, ArgReader argReader, T defaultNotSet) throws MassiveException { String str = this.argConcatFrom(idx); return this.arg(str, argReader, defaultNotSet); @@ -658,18 +659,18 @@ public class MassiveCommand // Core & Other - public T arg(ArgReader argReader) throws MassiveCommandException + public T arg(ArgReader argReader) throws MassiveException { return this.arg(null, argReader); } - public T arg(String str, ArgReader argReader) throws MassiveCommandException + public T arg(String str, ArgReader argReader) throws MassiveException { T result = argReader.read(str, this.sender); return result; } - public T arg(String str, ArgReader argReader, T defaultNotSet) throws MassiveCommandException + public T arg(String str, ArgReader argReader, T defaultNotSet) throws MassiveException { if (str == null) return defaultNotSet; return this.arg(str, argReader); diff --git a/src/com/massivecraft/massivecore/cmd/MassiveCommandException.java b/src/com/massivecraft/massivecore/cmd/MassiveCommandException.java deleted file mode 100644 index befde354..00000000 --- a/src/com/massivecraft/massivecore/cmd/MassiveCommandException.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.massivecraft.massivecore.cmd; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import com.massivecraft.massivecore.collections.MassiveList; -import com.massivecraft.massivecore.util.Txt; - -public class MassiveCommandException extends Exception -{ - // -------------------------------------------- // - // CONSTANTS - // -------------------------------------------- // - - private static final long serialVersionUID = 1L; - - // -------------------------------------------- // - // CONSTRUCTORS - // -------------------------------------------- // - /* - public MassiveCommandException() - { - - } - - public MassiveCommandException(String msg) - { - this.messages.add(msg); - } - - public MassiveCommandException(Collection msgs) - { - this.messages.addAll(msgs); - } - */ - - // -------------------------------------------- // - // MESSAGES - // -------------------------------------------- // - - private List messages = new MassiveList(); - public List getMessages() { return this.messages; } - - @Override - public String getMessage() - { - return Txt.implode(this.getMessages(), "\n"); - } - - public MassiveCommandException setMessage(String message) { this.messages = new MassiveList(message); return this; } - public MassiveCommandException setMsg(String msg) { return this.setMessage(Txt.parse(msg)); } - public MassiveCommandException setMsg(String msg, Object... args) { return this.setMessage(Txt.parse(msg, args)); } - - public MassiveCommandException addMessage(String message) { this.getMessages().add(message); return this; } - public MassiveCommandException addMsg(String msg) { return this.addMessage(Txt.parse(msg)); } - public MassiveCommandException addMsg(String msg, Object... args) { return this.addMessage(Txt.parse(msg, args)); } - - public MassiveCommandException setMessages(Collection messages) { this.messages = new MassiveList(messages); return this; } - public MassiveCommandException setMessages(String... messages) { return this.setMessages(Arrays.asList(messages)); } - public MassiveCommandException setMsgs(Collection msgs) { return this.setMessages(Txt.parse(msgs)); } - public MassiveCommandException setMsgs(String... msgs) { return this.setMsgs(Arrays.asList(msgs)); } - - public MassiveCommandException addMessages(Collection messages) { this.getMessages().addAll(messages); return this; } - public MassiveCommandException addMessages(String... messages) { return this.addMessages(Arrays.asList(messages)); } - public MassiveCommandException addMsgs(Collection messages) { this.getMessages().addAll(messages); return this; } - public MassiveCommandException addMsgs(String... msgs) { return this.addMsgs(Arrays.asList(msgs)); } - -} diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARAbstractPrimitive.java b/src/com/massivecraft/massivecore/cmd/arg/ARAbstractPrimitive.java index 10a3a64e..2288e5a3 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARAbstractPrimitive.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARAbstractPrimitive.java @@ -2,7 +2,7 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public abstract class ARAbstractPrimitive extends ArgReaderAbstract { @@ -18,7 +18,7 @@ public abstract class ARAbstractPrimitive extends ArgReaderAbstract // -------------------------------------------- // @Override - public T read(String arg, CommandSender sender) throws MassiveCommandException + public T read(String arg, CommandSender sender) throws MassiveException { T result; @@ -28,7 +28,7 @@ public abstract class ARAbstractPrimitive extends ArgReaderAbstract } catch (Exception e) { - throw new MassiveCommandException().addMsg("Invalid %s \"%s\".", this.typename(), arg); + throw new MassiveException().addMsg("Invalid %s \"%s\".", this.typename(), arg); } return result; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARAbstractSelect.java b/src/com/massivecraft/massivecore/cmd/arg/ARAbstractSelect.java index aeda6220..c6f4954c 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARAbstractSelect.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARAbstractSelect.java @@ -4,7 +4,7 @@ import java.util.Collection; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.util.Txt; public abstract class ARAbstractSelect extends ArgReaderAbstract @@ -29,13 +29,13 @@ public abstract class ARAbstractSelect extends ArgReaderAbstract // -------------------------------------------- // @Override - public T read(String arg, CommandSender sender) throws MassiveCommandException + public T read(String arg, CommandSender sender) throws MassiveException { T result = this.select(arg, sender); if (result == null) { - MassiveCommandException exception = new MassiveCommandException(); + MassiveException exception = new MassiveException(); exception.addMsg("No %s matches \"%s\".", this.typename(), arg); if (this.canList(sender)) diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARList.java b/src/com/massivecraft/massivecore/cmd/arg/ARList.java index d4e034e8..66ed523e 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARList.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARList.java @@ -5,7 +5,7 @@ import java.util.List; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public class ARList extends ArgReaderAbstract> { @@ -36,7 +36,7 @@ public class ARList extends ArgReaderAbstract> // NOTE: Must be used with argConcatFrom and setErrorOnTooManyArgs(false). @Override - public List read(String arg, CommandSender sender) throws MassiveCommandException + public List read(String arg, CommandSender sender) throws MassiveException { // Split into inner args String[] innerArgs = arg.split("\\s+"); diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARMaterial.java b/src/com/massivecraft/massivecore/cmd/arg/ARMaterial.java index f84c1be2..282ae314 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARMaterial.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARMaterial.java @@ -3,7 +3,7 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.Material; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public class ARMaterial extends ArgReaderAbstract { @@ -19,12 +19,12 @@ public class ARMaterial extends ArgReaderAbstract // -------------------------------------------- // @Override - public Material read(String arg, CommandSender sender) throws MassiveCommandException + public Material read(String arg, CommandSender sender) throws MassiveException { Material ret = Material.matchMaterial(arg); if (ret == null) { - MassiveCommandException exception = new MassiveCommandException(); + MassiveException exception = new MassiveException(); exception.addMsg("No material matches %s.", arg); exception.addMsg("Suggestion: http://www.minecraftwiki.net/wiki/Data_values"); throw exception; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARMillisDiff.java b/src/com/massivecraft/massivecore/cmd/arg/ARMillisDiff.java index 76e7fcd0..0b196b82 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARMillisDiff.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARMillisDiff.java @@ -2,7 +2,7 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.util.TimeDiffUtil; public class ARMillisDiff extends ArgReaderAbstract @@ -19,7 +19,7 @@ public class ARMillisDiff extends ArgReaderAbstract // -------------------------------------------- // @Override - public Long read(String arg, CommandSender sender) throws MassiveCommandException + public Long read(String arg, CommandSender sender) throws MassiveException { Long ret; try @@ -28,7 +28,7 @@ public class ARMillisDiff extends ArgReaderAbstract } catch (Exception e) { - throw new MassiveCommandException().addMsg("%s", e.getMessage()); + throw new MassiveException().addMsg("%s", e.getMessage()); } return ret; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARPermission.java b/src/com/massivecraft/massivecore/cmd/arg/ARPermission.java index 2ccd25e3..ed3fa868 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARPermission.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARPermission.java @@ -4,7 +4,7 @@ import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.permissions.Permission; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public class ARPermission extends ArgReaderAbstract { @@ -20,7 +20,7 @@ public class ARPermission extends ArgReaderAbstract // -------------------------------------------- // @Override - public Permission read(String arg, CommandSender sender) throws MassiveCommandException + public Permission read(String arg, CommandSender sender) throws MassiveException { Permission ret = null; @@ -33,7 +33,7 @@ public class ARPermission extends ArgReaderAbstract if (ret == null) { - throw new MassiveCommandException().addMsg("No permission with the name \"%s\" was found.", arg); + throw new MassiveException().addMsg("No permission with the name \"%s\" was found.", arg); } return ret; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java b/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java index 20f42298..3f6d0bdf 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java @@ -4,7 +4,7 @@ import java.util.Collection; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.store.SenderIdSource; import com.massivecraft.massivecore.util.IdUtil; @@ -44,7 +44,7 @@ public abstract class ARSenderIdAbstract extends ArgReaderAbstract // -------------------------------------------- // @Override - public T read(String arg, CommandSender sender) throws MassiveCommandException + public T read(String arg, CommandSender sender) throws MassiveException { // Create Ret T ret; @@ -60,7 +60,7 @@ public abstract class ARSenderIdAbstract extends ArgReaderAbstract if (ret == null) { // No alternatives found - throw new MassiveCommandException().addMsg("No player matches \"%s\".", arg); + throw new MassiveException().addMsg("No player matches \"%s\".", arg); } // Return Ret diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSet.java b/src/com/massivecraft/massivecore/cmd/arg/ARSet.java index e0a1ebd8..b1d82e15 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSet.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSet.java @@ -5,7 +5,7 @@ import java.util.Set; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.util.Txt; public class ARSet extends ArgReaderAbstract> @@ -41,7 +41,7 @@ public class ARSet extends ArgReaderAbstract> // NOTE: Must be used with argConcatFrom and setErrorOnTooManyArgs(false). @Override - public Set read(String arg, CommandSender sender) throws MassiveCommandException + public Set read(String arg, CommandSender sender) throws MassiveException { // Split into inner args String[] innerArgs = arg.split("\\s+"); diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSound.java b/src/com/massivecraft/massivecore/cmd/arg/ARSound.java index 640cf20f..6156b4c1 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSound.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSound.java @@ -3,7 +3,7 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.Sound; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public class ARSound extends ArgReaderAbstract { @@ -19,12 +19,12 @@ public class ARSound extends ArgReaderAbstract // -------------------------------------------- // @Override - public Sound read(String arg, CommandSender sender) throws MassiveCommandException + public Sound read(String arg, CommandSender sender) throws MassiveException { Sound result = getSoundFromString(arg); if (result == null) { - MassiveCommandException errors = new MassiveCommandException(); + MassiveException errors = new MassiveException(); errors.addMsg("No sound matches \"%s\".", arg); errors.addMsg("https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/Sound.java"); throw errors; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffect.java b/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffect.java index c28e85d0..e071efc4 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffect.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffect.java @@ -2,8 +2,8 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.command.CommandSender; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.SoundEffect; -import com.massivecraft.massivecore.cmd.MassiveCommandException; public class ARSoundEffect extends ArgReaderAbstract { @@ -19,7 +19,7 @@ public class ARSoundEffect extends ArgReaderAbstract // -------------------------------------------- // @Override - public SoundEffect read(String arg, CommandSender sender) throws MassiveCommandException + public SoundEffect read(String arg, CommandSender sender) throws MassiveException { SoundEffect ret; @@ -29,7 +29,7 @@ public class ARSoundEffect extends ArgReaderAbstract } catch (Exception e) { - throw new MassiveCommandException().addMsg("%s", e.getMessage()); + throw new MassiveException().addMsg("%s", e.getMessage()); } return ret; } diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffects.java b/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffects.java index c376e637..7b277284 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffects.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSoundEffects.java @@ -6,8 +6,8 @@ import java.util.List; import org.bukkit.command.CommandSender; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.SoundEffect; -import com.massivecraft.massivecore.cmd.MassiveCommandException; /** * @deprecated use ARList @@ -27,7 +27,7 @@ public class ARSoundEffects extends ArgReaderAbstract> // -------------------------------------------- // @Override - public List read(String arg, CommandSender sender) throws MassiveCommandException + public List read(String arg, CommandSender sender) throws MassiveException { List ret = new ArrayList(); List result = new ArrayList(); @@ -45,7 +45,7 @@ public class ARSoundEffects extends ArgReaderAbstract> } catch (Exception e) { - throw new MassiveCommandException().addMsg("%s", e.getMessage()); + throw new MassiveException().addMsg("%s", e.getMessage()); } return ret; } diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARUniverse.java b/src/com/massivecraft/massivecore/cmd/arg/ARUniverse.java index e76a6157..6675b04c 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARUniverse.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARUniverse.java @@ -5,8 +5,8 @@ import java.util.Collection; import org.bukkit.command.CommandSender; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.util.Txt; public class ARUniverse extends ArgReaderAbstract @@ -32,7 +32,7 @@ public class ARUniverse extends ArgReaderAbstract // -------------------------------------------- // @Override - public String read(String arg, CommandSender sender) throws MassiveCommandException + public String read(String arg, CommandSender sender) throws MassiveException { String result = new String(); @@ -42,7 +42,7 @@ public class ARUniverse extends ArgReaderAbstract } else { - MassiveCommandException exception = new MassiveCommandException(); + MassiveException exception = new MassiveException(); exception.addMsg("No universe \"%s\" exists in multiverse %s.", arg, this.multiverse.getId()); Collection names = new ArrayList(multiverse.getUniverses()); diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARWorld.java b/src/com/massivecraft/massivecore/cmd/arg/ARWorld.java index 9af12f7c..1a546c8c 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARWorld.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARWorld.java @@ -4,7 +4,7 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public class ARWorld extends ArgReaderAbstract { @@ -20,7 +20,7 @@ public class ARWorld extends ArgReaderAbstract // -------------------------------------------- // @Override - public World read(String arg, CommandSender sender) throws MassiveCommandException + public World read(String arg, CommandSender sender) throws MassiveException { World ret; @@ -32,7 +32,7 @@ public class ARWorld extends ArgReaderAbstract if (ret == null) { - throw new MassiveCommandException().addMsg("The world \"%s\" could not be found.", arg); + throw new MassiveException().addMsg("The world \"%s\" could not be found.", arg); } return ret; diff --git a/src/com/massivecraft/massivecore/cmd/arg/ArgReader.java b/src/com/massivecraft/massivecore/cmd/arg/ArgReader.java index 2409473e..015a7bd8 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ArgReader.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ArgReader.java @@ -2,12 +2,12 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public interface ArgReader { - public T read(String arg, CommandSender sender) throws MassiveCommandException; - public T read(CommandSender sender) throws MassiveCommandException; - public T read(String arg) throws MassiveCommandException; - public T readArg() throws MassiveCommandException; + public T read(String arg, CommandSender sender) throws MassiveException; + public T read(CommandSender sender) throws MassiveException; + public T read(String arg) throws MassiveException; + public T readArg() throws MassiveException; } \ No newline at end of file diff --git a/src/com/massivecraft/massivecore/cmd/arg/ArgReaderAbstract.java b/src/com/massivecraft/massivecore/cmd/arg/ArgReaderAbstract.java index 26ba3e36..e58d2761 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ArgReaderAbstract.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ArgReaderAbstract.java @@ -2,7 +2,7 @@ package com.massivecraft.massivecore.cmd.arg; import org.bukkit.command.CommandSender; -import com.massivecraft.massivecore.cmd.MassiveCommandException; +import com.massivecraft.massivecore.MassiveException; public abstract class ArgReaderAbstract implements ArgReader { @@ -11,19 +11,19 @@ public abstract class ArgReaderAbstract implements ArgReader // -------------------------------------------- // @Override - public T read(CommandSender sender) throws MassiveCommandException + public T read(CommandSender sender) throws MassiveException { return this.read(null, sender); } @Override - public T read(String arg) throws MassiveCommandException + public T read(String arg) throws MassiveException { return this.read(arg, null); } @Override - public T readArg() throws MassiveCommandException + public T readArg() throws MassiveException { return this.read(null, null); } diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreBufferWhitespace.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreBufferWhitespace.java index 3f52d851..c8cceca2 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreBufferWhitespace.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreBufferWhitespace.java @@ -2,8 +2,8 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCoreEngineVariable; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARInteger; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdMassiveCoreBufferWhitespace extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Integer times = this.arg(0, ARInteger.get(), 1); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreHearsound.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreHearsound.java index 28cd137e..85d5cc05 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreHearsound.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreHearsound.java @@ -3,9 +3,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import java.util.List; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.SoundEffect; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARList; import com.massivecraft.massivecore.cmd.arg.ARSoundEffect; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -36,7 +36,7 @@ public class CmdMassiveCoreHearsound extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args List soundEffects = this.argConcatFrom(0, ARList.get(ARSoundEffect.get())); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreListcolls.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreListcolls.java index 60c4e656..bfd042a4 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreListcolls.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreListcolls.java @@ -5,9 +5,9 @@ import java.util.TreeSet; import com.massivecraft.massivecore.ConfServer; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.NaturalOrderComparator; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.store.Coll; @@ -38,7 +38,7 @@ public class CmdMassiveCoreStoreListcolls extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args final String dbAlias = this.arg(0, ARString.get(), ConfServer.dburi); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreStats.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreStats.java index 87d8448e..cd9394da 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreStats.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreStoreStats.java @@ -3,8 +3,8 @@ package com.massivecraft.massivecore.cmd.massivecore; import java.util.Map.Entry; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARColl; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.store.Coll; @@ -35,7 +35,7 @@ public class CmdMassiveCoreStoreStats extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { if (!this.argIsSet(0) || this.arg(0).equalsIgnoreCase(Coll.TOTAL)) { diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreTest.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreTest.java index 2450221d..e477ae9e 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreTest.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreTest.java @@ -4,8 +4,8 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.VisibilityMode; import com.massivecraft.massivecore.cmd.arg.AREnum; import com.massivecraft.massivecore.cmd.arg.ARFloat; @@ -46,7 +46,7 @@ public class CmdMassiveCoreTest extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args ParticleEffect particleEffect = this.arg(0, AREnum.get(ParticleEffect.class)); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectList.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectList.java index b3c1ebdd..73438c20 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectList.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectList.java @@ -6,8 +6,8 @@ import java.util.List; import com.massivecraft.massivecore.Aspect; import com.massivecraft.massivecore.AspectColl; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARInteger; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -35,7 +35,7 @@ public class CmdMassiveCoreUsysAspectList extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectShow.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectShow.java index 1a7a2aca..016c4bc0 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectShow.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectShow.java @@ -2,8 +2,8 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.Aspect; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARAspect; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdMassiveCoreUsysAspectShow extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Aspect aspect = this.arg(0, ARAspect.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectUse.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectUse.java index 228583a7..0aa77000 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectUse.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysAspectUse.java @@ -2,9 +2,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.Aspect; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARAspect; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -33,7 +33,7 @@ public class CmdMassiveCoreUsysAspectUse extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Aspect aspect = this.arg(0, ARAspect.get()); Multiverse multiverse = this.arg(1, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseDel.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseDel.java index 349b82e2..730243fa 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseDel.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseDel.java @@ -2,9 +2,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -31,7 +31,7 @@ public class CmdMassiveCoreUsysMultiverseDel extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(0, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseList.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseList.java index da6a5164..299e77b3 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseList.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseList.java @@ -4,10 +4,10 @@ import java.util.ArrayList; import java.util.List; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.MultiverseColl; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARInteger; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -35,7 +35,7 @@ public class CmdMassiveCoreUsysMultiverseList extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { // Args Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseShow.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseShow.java index 76c2e216..28d7c815 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseShow.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysMultiverseShow.java @@ -6,9 +6,9 @@ import java.util.List; import com.massivecraft.massivecore.Aspect; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -36,7 +36,7 @@ public class CmdMassiveCoreUsysMultiverseShow extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(0, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseClear.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseClear.java index c35483b0..e26a87b0 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseClear.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseClear.java @@ -2,9 +2,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -32,7 +32,7 @@ public class CmdMassiveCoreUsysUniverseClear extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(1, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseDel.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseDel.java index 25af5d2c..66fe86d3 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseDel.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseDel.java @@ -2,9 +2,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -32,7 +32,7 @@ public class CmdMassiveCoreUsysUniverseDel extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(1, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseNew.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseNew.java index 9c1d0991..8484ff75 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseNew.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysUniverseNew.java @@ -1,9 +1,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -31,7 +31,7 @@ public class CmdMassiveCoreUsysUniverseNew extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(1, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysWorld.java b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysWorld.java index 3fe6e126..76a723b9 100644 --- a/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysWorld.java +++ b/src/com/massivecraft/massivecore/cmd/massivecore/CmdMassiveCoreUsysWorld.java @@ -1,9 +1,9 @@ package com.massivecraft.massivecore.cmd.massivecore; import com.massivecraft.massivecore.MassiveCorePerm; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Multiverse; import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.MassiveCommandException; import com.massivecraft.massivecore.cmd.arg.ARMultiverse; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -32,7 +32,7 @@ public class CmdMassiveCoreUsysWorld extends MassiveCommand // -------------------------------------------- // @Override - public void perform() throws MassiveCommandException + public void perform() throws MassiveException { Multiverse multiverse = this.arg(2, ARMultiverse.get()); diff --git a/src/com/massivecraft/massivecore/util/Txt.java b/src/com/massivecraft/massivecore/util/Txt.java index a9f05a43..bbb826ff 100644 --- a/src/com/massivecraft/massivecore/util/Txt.java +++ b/src/com/massivecraft/massivecore/util/Txt.java @@ -375,7 +375,7 @@ public class Txt public static String getNicedEnumString(String str) { List parts = new ArrayList(); - for (String part : str.toLowerCase().split("_")) + for (String part : str.toLowerCase().split("[\\s_]+")) { parts.add(upperCaseFirst(part)); }