Skip to content
Permalink
Browse files
Brace ternary and add CRELengthException to throwables.
  • Loading branch information
Lildirt committed Oct 23, 2020
1 parent 3942d27 commit 1b3af52
Showing 1 changed file with 7 additions and 3 deletions.
@@ -5566,7 +5566,7 @@ public static class pattack_cooldown extends AbstractFunction {

@Override
public Class<? extends CREThrowable>[] thrown() {
return new Class[] { CREPlayerOfflineException.class };
return new Class[] { CREPlayerOfflineException.class, CRELengthException.class };
}

@Override
@@ -5581,8 +5581,12 @@ public Boolean runAsync() {

@Override
public Mixed exec(Target t, Environment env, Mixed... args) throws ConfigRuntimeException {
MCHumanEntity he = (args.length == 0)
? env.getEnv(CommandHelperEnvironment.class).GetPlayer() : Static.GetPlayer(args[0], t);
MCHumanEntity he;
if(args.length == 0) {
he = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
} else {
he = Static.GetPlayer(args[0], t);
}
return new CDouble(he.getAttackCooldown(), t);
}

0 comments on commit 1b3af52

Please sign in to comment.