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-29 23:50:53 +02:00
parent 72f4d16e6f
commit 4de0ce258b

View File

@ -25,11 +25,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MACreature
{
private static Map<String,MACreature> map;
public class MACreature {
private static final Map<String,MACreature> map = new HashMap<>();
private static final List<DyeColor> colors = Arrays.asList(DyeColor.values());
static {
map = new HashMap<>();
registerEntityTypeValues();
registerExtraAliases();
registerTypeVariants();
@ -37,14 +38,14 @@ public class MACreature
registerBrokenTypes();
}
private List<DyeColor> 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;
}
/**