mirror of
https://github.com/aikar/commands.git
synced 2026-06-02 07:12:18 +00:00
Condition handlers wasnt meant to return boolean.
Sorry if anyone wrote one already, remove the return type please. Really don't want to bump version when very low chance anyones using this system yet.
This commit is contained in:
@@ -68,7 +68,7 @@ public final class ACFExample extends JavaPlugin {
|
||||
// 5: Register Command Conditions
|
||||
commandManager.getCommandConditions().addCondition(SomeObject.class, "limits", (c, exec, value) -> {
|
||||
if (value == null) {
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
if (c.hasConfig("min") && c.getConfigValue("min", 0) > value.getValue()) {
|
||||
throw new ConditionFailedException("Min value must be " + c.getConfigValue("min", 0));
|
||||
@@ -76,7 +76,6 @@ public final class ACFExample extends JavaPlugin {
|
||||
if (c.hasConfig("max") && c.getConfigValue("max", 3) < value.getValue()) {
|
||||
throw new ConditionFailedException("Max value must be " + c.getConfigValue("max", 3));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// 6: Register your commands - This first command demonstrates adding an exception handler to that command
|
||||
|
||||
Reference in New Issue
Block a user