-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e6c20a
commit 85adf6b
Showing
22 changed files
with
148 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
must-be.player=You must be a player to use this command. | ||
must-be.console=You must be console to use this command. | ||
must-be.op=You must be an operator to use this command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 9 additions & 5 deletions
14
Commander-Core/src/main/java/net/octopvp/commander/exception/CommandException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
public class CommandException extends RuntimeException{ | ||
public CommandException(String message){ | ||
public class CommandException extends RuntimeException { | ||
public CommandException(String message) { | ||
super(message); | ||
} | ||
public CommandException(String message, Throwable cause){ | ||
|
||
public CommandException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
public CommandException(Throwable cause){ | ||
|
||
public CommandException(Throwable cause) { | ||
super(cause); | ||
} | ||
public CommandException() {} | ||
|
||
public CommandException() { | ||
} | ||
} |
8 changes: 5 additions & 3 deletions
8
Commander-Core/src/main/java/net/octopvp/commander/exception/CommandNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
public class CommandNotFoundException extends CommandException { | ||
public CommandNotFoundException(String message) { | ||
super(message); | ||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
public class CommandNotFoundException extends LocalizedCommandException { | ||
public CommandNotFoundException(String key, Object... placeholders) { | ||
super(key, placeholders); | ||
} | ||
|
||
} |
25 changes: 17 additions & 8 deletions
25
Commander-Core/src/main/java/net/octopvp/commander/exception/CommandParseException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
public class CommandParseException extends CommandException{ | ||
public CommandParseException(String message) { | ||
super(message); | ||
} | ||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
public class CommandParseException extends LocalizedCommandException { | ||
public CommandParseException() { | ||
super("parse.fail"); | ||
} | ||
|
||
public CommandParseException(Exception cause) { | ||
super("parse.fail", cause); | ||
} | ||
public CommandParseException(String message, Throwable cause) { | ||
super(message, cause); | ||
|
||
public CommandParseException(Object... placeholders) { | ||
super("parse.fail", placeholders); | ||
} | ||
public CommandParseException(Throwable cause) { | ||
super(cause.getMessage()); | ||
|
||
public CommandParseException(String key) { | ||
super(key); | ||
} | ||
|
||
public CommandParseException(String key, Object... placeholders) { | ||
super(key, placeholders); | ||
} | ||
} |
9 changes: 6 additions & 3 deletions
9
Commander-Core/src/main/java/net/octopvp/commander/exception/CooldownException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
import java.text.DecimalFormat; | ||
import java.text.NumberFormat; | ||
|
||
public class CooldownException extends CommandException { | ||
public class CooldownException extends LocalizedCommandException { | ||
private static final DecimalFormat TWO_DECIMAL_FORMAT = new DecimalFormat("0.00"); | ||
|
||
public CooldownException(double timeLeft) { | ||
super("You must wait " + TWO_DECIMAL_FORMAT.format(timeLeft) + " seconds before using this command again."); | ||
super("cooldown", TWO_DECIMAL_FORMAT.format(timeLeft)); | ||
//super("You must wait " + TWO_DECIMAL_FORMAT.format(timeLeft) + " seconds before using this command again."); | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
Commander-Core/src/main/java/net/octopvp/commander/exception/InvalidArgsException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
import net.octopvp.commander.command.CommandInfo; | ||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
public class InvalidArgsException extends CommandException { | ||
public class InvalidArgsException extends LocalizedCommandException { | ||
public InvalidArgsException(CommandInfo info) { | ||
super("Usage: " + info.getFullUsage()); | ||
super("args.invalid", info.getFullUsage()); | ||
} | ||
|
||
public InvalidArgsException(String usage) { | ||
super("Usage: " + usage); | ||
super("args.invalid", usage); | ||
} | ||
} |
10 changes: 4 additions & 6 deletions
10
Commander-Core/src/main/java/net/octopvp/commander/exception/NoPermissionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
public class NoPermissionException extends CommandException { | ||
public NoPermissionException() { | ||
super("You do not have permission to perform this command."); | ||
} | ||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
public NoPermissionException(String message) { | ||
super(message); | ||
public class NoPermissionException extends LocalizedCommandException { | ||
public NoPermissionException() { | ||
super("no-permission"); | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
...ander-Core/src/main/java/net/octopvp/commander/exception/SubCommandNotFoundException.java
This file was deleted.
Oops, something went wrong.
8 changes: 5 additions & 3 deletions
8
Commander-Core/src/main/java/net/octopvp/commander/exception/ValidateException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package net.octopvp.commander.exception; | ||
|
||
public class ValidateException extends CommandException { | ||
public ValidateException(String message) { | ||
super(message); | ||
import net.octopvp.commander.lang.LocalizedCommandException; | ||
|
||
public class ValidateException extends LocalizedCommandException { | ||
public ValidateException(String key, Object... placeholders) { | ||
super(key, placeholders); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.