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:
@@ -29,10 +29,12 @@ public class MACreature
|
|||||||
static {
|
static {
|
||||||
map = new HashMap<>();
|
map = new HashMap<>();
|
||||||
for (EntityType type : EntityType.values()) {
|
for (EntityType type : EntityType.values()) {
|
||||||
|
if (type.isAlive()) {
|
||||||
// Instantiating a new creature registers it
|
// Instantiating a new creature registers it
|
||||||
new MACreature(type);
|
new MACreature(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Default creatures
|
// Default creatures
|
||||||
public static final MACreature ZOMBIE = new MACreature("zombie", EntityType.ZOMBIE);
|
public static final MACreature ZOMBIE = new MACreature("zombie", EntityType.ZOMBIE);
|
||||||
|
|||||||
Reference in New Issue
Block a user