From 9245e5350930a78c491b91b3954b9ec748f3d68d Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 9 Apr 2020 11:37:30 +0200 Subject: [PATCH] Mark constants in abilities `static`. No need to have instance-local constants. --- .../MobArena/waves/ability/core/ChainLightning.java | 4 ++-- .../MobArena/waves/ability/core/DisorientDistant.java | 2 +- .../MobArena/waves/ability/core/DisorientNearby.java | 2 +- .../MobArena/waves/ability/core/DisorientTarget.java | 2 +- .../MobArena/waves/ability/core/FetchDistant.java | 2 +- .../MobArena/waves/ability/core/FetchNearby.java | 2 +- .../MobArena/waves/ability/core/FetchTarget.java | 2 +- .../garbagemule/MobArena/waves/ability/core/FireAura.java | 4 ++-- .../MobArena/waves/ability/core/LightningAura.java | 2 +- .../garbagemule/MobArena/waves/ability/core/LivingBomb.java | 6 +++--- .../MobArena/waves/ability/core/ObsidianBomb.java | 2 +- .../MobArena/waves/ability/core/PullDistant.java | 2 +- .../garbagemule/MobArena/waves/ability/core/PullNearby.java | 2 +- .../garbagemule/MobArena/waves/ability/core/PullTarget.java | 2 +- .../garbagemule/MobArena/waves/ability/core/RootTarget.java | 4 ++-- .../MobArena/waves/ability/core/ThrowDistant.java | 2 +- .../MobArena/waves/ability/core/ThrowNearby.java | 2 +- .../MobArena/waves/ability/core/ThrowTarget.java | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ChainLightning.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ChainLightning.java index 453e3a4..ece620d 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ChainLightning.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ChainLightning.java @@ -21,13 +21,13 @@ public class ChainLightning implements Ability * How many blocks the chain lightning can spread over. * Must be greater than 0. */ - private final int RADIUS = 4; + private static final int RADIUS = 4; /** * How many server ticks between each lightning strike. * Must be greater than 0. */ - private final int TICKS = 10; + private static final int TICKS = 10; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientDistant.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientDistant.java index 10f4ab1..2bd4b97 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientDistant.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientDistant.java @@ -17,7 +17,7 @@ public class DisorientDistant implements Ability /** * How far away players must be to be affected by the ability. */ - private final int RADIUS = 8; + private static final int RADIUS = 8; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientNearby.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientNearby.java index 7ef806a..abea49a 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientNearby.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientNearby.java @@ -18,7 +18,7 @@ public class DisorientNearby implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientTarget.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientTarget.java index c256d4f..13dfe60 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientTarget.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/DisorientTarget.java @@ -17,7 +17,7 @@ public class DisorientTarget implements Ability /** * If the boss has no target, should a random player be selected? */ - private final boolean RANDOM = false; + private static final boolean RANDOM = false; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchDistant.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchDistant.java index 2d520dd..5647443 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchDistant.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchDistant.java @@ -17,7 +17,7 @@ public class FetchDistant implements Ability /** * How far away players must be to be affected by the ability. */ - private final int RADIUS = 8; + private static final int RADIUS = 8; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchNearby.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchNearby.java index 3a70e02..e476ebf 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchNearby.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchNearby.java @@ -17,7 +17,7 @@ public class FetchNearby implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchTarget.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchTarget.java index 7f8f86c..824b37f 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchTarget.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FetchTarget.java @@ -16,7 +16,7 @@ public class FetchTarget implements Ability /** * If the boss has no target, should a random player be selected? */ - private final boolean RANDOM = true; + private static final boolean RANDOM = true; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FireAura.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FireAura.java index ac5e70c..c828990 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/FireAura.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/FireAura.java @@ -16,12 +16,12 @@ public class FireAura implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; /** * How many ticks the players should be on fire for. */ - private final int TICKS = 20; + private static final int TICKS = 20; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/LightningAura.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/LightningAura.java index ae76c92..9d9ebcb 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/LightningAura.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/LightningAura.java @@ -17,7 +17,7 @@ public class LightningAura implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/LivingBomb.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/LivingBomb.java index 7279773..036fa6f 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/LivingBomb.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/LivingBomb.java @@ -17,17 +17,17 @@ public class LivingBomb implements Ability /** * How many ticks before the bomb goes off. */ - private final int FUSE = 60; + private static final int FUSE = 60; /** * How close players must be to be affected by the bomb. */ - private final int RADIUS = 3; + private static final int RADIUS = 3; /** * How many ticks players affected by the bomb should burn. */ - private final int AFTERBURN = 40; + private static final int AFTERBURN = 40; @Override public void execute(final Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ObsidianBomb.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ObsidianBomb.java index 05dedc9..8e6d4f6 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ObsidianBomb.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ObsidianBomb.java @@ -22,7 +22,7 @@ public class ObsidianBomb implements Ability /** * How many ticks before the bomb goes off. */ - private final int FUSE = 80; + private static final int FUSE = 80; @Override public void execute(final Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullDistant.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullDistant.java index 8cfa269..d7d1cca 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullDistant.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullDistant.java @@ -18,7 +18,7 @@ public class PullDistant implements Ability /** * How far away players must be to be affected by the ability. */ - private final int RADIUS = 8; + private static final int RADIUS = 8; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullNearby.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullNearby.java index 5d9eea0..f0b7a89 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullNearby.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullNearby.java @@ -18,7 +18,7 @@ public class PullNearby implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullTarget.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullTarget.java index 7fc60fb..3a365e4 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullTarget.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/PullTarget.java @@ -18,7 +18,7 @@ public class PullTarget implements Ability /** * If the boss has no target, should a random player be selected? */ - private final boolean RANDOM = false; + private static final boolean RANDOM = false; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/RootTarget.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/RootTarget.java index 703faed..acc582f 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/RootTarget.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/RootTarget.java @@ -39,13 +39,13 @@ public class RootTarget implements Ability * How many times the player will be warped back to his original position. * Must be greater than 0. */ - private final int ITERATIONS = 30; + private static final int ITERATIONS = 30; /** * How many server ticks between each iteration of * Must be greater than 0. */ - private final int TICKS = 1; + private static final int TICKS = 1; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowDistant.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowDistant.java index 16d0692..71d5e19 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowDistant.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowDistant.java @@ -18,7 +18,7 @@ public class ThrowDistant implements Ability /** * How far away players must be to be affected by the ability. */ - private final int RADIUS = 8; + private static final int RADIUS = 8; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowNearby.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowNearby.java index a8401cf..8d213f0 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowNearby.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowNearby.java @@ -18,7 +18,7 @@ public class ThrowNearby implements Ability /** * How close players must be to be affected by the ability. */ - private final int RADIUS = 5; + private static final int RADIUS = 5; @Override public void execute(Arena arena, MABoss boss) { diff --git a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowTarget.java b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowTarget.java index 005b064..d9f75d2 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowTarget.java +++ b/src/main/java/com/garbagemule/MobArena/waves/ability/core/ThrowTarget.java @@ -18,7 +18,7 @@ public class ThrowTarget implements Ability /** * If the boss has no target, should a random player be selected? */ - private final boolean RANDOM = false; + private static final boolean RANDOM = false; @Override public void execute(Arena arena, MABoss boss) {