Skip to content

Commit

Permalink
NPC loads name during load()
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 17, 2014
1 parent 92d5fe9 commit 9717b59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/citizensnpcs/api/npc/AbstractNPC.java
Expand Up @@ -280,6 +280,7 @@ public boolean isSpawned() {

@Override
public void load(final DataKey root) {
name = root.getString("name");
metadata.loadFrom(root.getRelative("metadata"));

String traitNames = root.getString("traitnames");
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/net/citizensnpcs/api/util/MemoryDataKey.java
Expand Up @@ -68,7 +68,7 @@ private String getKeyFor(String key) {
return path;
if (key.charAt(0) == '.')
return path.isEmpty() ? key.substring(1, key.length()) : path + key;
return path.isEmpty() ? key : path + "." + key;
return path.isEmpty() ? key : path + "." + key;
}

@Override
Expand All @@ -81,10 +81,6 @@ public Object getRaw(String key) {
return root.get(getKeyFor(key));
}

public Map<? extends String, ?> getRawTree() {
return root.getValues(true);
}

@Override
public MemoryDataKey getRelative(String relative) {
String key = getKeyFor(relative);
Expand Down

0 comments on commit 9717b59

Please sign in to comment.