Guard against non-living entities in MACreature.

This should prevent runtime errors where MobArena tries to spawn non-living entities, causing arenas to get locked up.

Fixes #438
This commit is contained in:
Andreas Troelsen
2018-08-05 23:30:03 +02:00
parent cd82a89626
commit 060a395213
@@ -29,10 +29,12 @@ public class MACreature
static {
map = new HashMap<>();
for (EntityType type : EntityType.values()) {
if (type.isAlive()) {
// Instantiating a new creature registers it
new MACreature(type);
}
}
}
// Default creatures
public static final MACreature ZOMBIE = new MACreature("zombie", EntityType.ZOMBIE);