Skip to content

Commit 1b3af52

Browse files
committed
Brace ternary and add CRELengthException to throwables.
1 parent 3942d27 commit 1b3af52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/laytonsmith/core/functions/PlayerManagement.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5566,7 +5566,7 @@ public static class pattack_cooldown extends AbstractFunction {
55665566

55675567
@Override
55685568
public Class<? extends CREThrowable>[] thrown() {
5569-
return new Class[] { CREPlayerOfflineException.class };
5569+
return new Class[] { CREPlayerOfflineException.class, CRELengthException.class };
55705570
}
55715571

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

55825582
@Override
55835583
public Mixed exec(Target t, Environment env, Mixed... args) throws ConfigRuntimeException {
5584-
MCHumanEntity he = (args.length == 0)
5585-
? env.getEnv(CommandHelperEnvironment.class).GetPlayer() : Static.GetPlayer(args[0], t);
5584+
MCHumanEntity he;
5585+
if(args.length == 0) {
5586+
he = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
5587+
} else {
5588+
he = Static.GetPlayer(args[0], t);
5589+
}
55865590
return new CDouble(he.getAttackCooldown(), t);
55875591
}
55885592

0 commit comments

Comments
 (0)