From 4de0ce258bcfc411a8421362f4b40572e7d2af4e Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 29 Jul 2021 23:50:53 +0200 Subject: [PATCH] Tidy up code style in MACreature. It's K&R style braces in all modern portions of the code base, and IntelliJ keeps complaining about final values, so let's just make it happy. The `plural` field should go away at some point, but for now it's fine to just null it out, since the legacy `register()` method is only ever used by the deprecated-for-removal constructors, both of which actually set it to something non-null. --- .../garbagemule/MobArena/waves/MACreature.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/garbagemule/MobArena/waves/MACreature.java b/src/main/java/com/garbagemule/MobArena/waves/MACreature.java index 295edf2..26d2844 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/MACreature.java +++ b/src/main/java/com/garbagemule/MobArena/waves/MACreature.java @@ -25,11 +25,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class MACreature -{ - private static Map map; +public class MACreature { + + private static final Map map = new HashMap<>(); + private static final List colors = Arrays.asList(DyeColor.values()); + static { - map = new HashMap<>(); registerEntityTypeValues(); registerExtraAliases(); registerTypeVariants(); @@ -37,14 +38,14 @@ public class MACreature registerBrokenTypes(); } - private List colors = Arrays.asList(DyeColor.values()); - private String name; - private String plural; - private EntityType type; + private final String name; + private final String plural; + private final EntityType type; public MACreature(EntityType type, String name) { this.type = type; this.name = name; + this.plural = null; } /**