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.
This commit is contained in:
Andreas Troelsen
2021-07-30 18:21:41 +02:00
parent 72f4d16e6f
commit 4de0ce258b
@@ -25,11 +25,12 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class MACreature public class MACreature {
{
private static Map<String,MACreature> map; private static final Map<String,MACreature> map = new HashMap<>();
private static final List<DyeColor> colors = Arrays.asList(DyeColor.values());
static { static {
map = new HashMap<>();
registerEntityTypeValues(); registerEntityTypeValues();
registerExtraAliases(); registerExtraAliases();
registerTypeVariants(); registerTypeVariants();
@@ -37,14 +38,14 @@ public class MACreature
registerBrokenTypes(); registerBrokenTypes();
} }
private List<DyeColor> colors = Arrays.asList(DyeColor.values()); private final String name;
private String name; private final String plural;
private String plural; private final EntityType type;
private EntityType type;
public MACreature(EntityType type, String name) { public MACreature(EntityType type, String name) {
this.type = type; this.type = type;
this.name = name; this.name = name;
this.plural = null;
} }
/** /**