Default type to player if not found

This commit is contained in:
fullwall 2012-04-20 23:19:15 +08:00
parent e60e889775
commit 32b9f4ff2b

View File

@ -280,7 +280,7 @@ public class Citizens extends JavaPlugin {
Messaging.log("Could not find a name for the NPC with ID '" + id + "'."); Messaging.log("Could not find a name for the NPC with ID '" + id + "'.");
continue; continue;
} }
String unparsedEntityType = key.getString("traits.type"); String unparsedEntityType = key.getString("traits.type", "PLAYER");
EntityType type = EntityType.fromName(unparsedEntityType); EntityType type = EntityType.fromName(unparsedEntityType);
if (type == null) { if (type == null) {
try { try {