Skip to content

Commit

Permalink
Fix NBTStorage keyExists
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 8, 2014
1 parent d8204b2 commit bdabb15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/main/java/net/citizensnpcs/api/event/NPCClickEvent.java
Expand Up @@ -11,7 +11,6 @@
*/
public abstract class NPCClickEvent extends NPCEvent implements Cancellable {
private boolean cancelled = false;

private final Player clicker;

protected NPCClickEvent(NPC npc, Player clicker) {
Expand All @@ -21,7 +20,7 @@ protected NPCClickEvent(NPC npc, Player clicker) {

/**
* Gets the player that clicked the NPC.
*
*
* @return Player that clicked the NPC
*/
public Player getClicker() {
Expand All @@ -43,9 +42,9 @@ public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}

private static final HandlerList handlers = new HandlerList();

public static HandlerList getHandlerList() {
return handlers;
}

private static final HandlerList handlers = new HandlerList();
}
6 changes: 3 additions & 3 deletions src/main/java/net/citizensnpcs/api/util/NBTStorage.java
Expand Up @@ -71,7 +71,7 @@ public File getFile() {
}

@Override
public DataKey getKey(String root) {
public NBTKey getKey(String root) {
return new NBTKey(root);
}

Expand Down Expand Up @@ -133,7 +133,7 @@ private String createRelativeKey(String parent, String sub) {
return parent;
if (sub.charAt(0) == '.')
return parent.isEmpty() ? sub.substring(1, sub.length()) : parent + sub;
return parent.isEmpty() ? sub : parent + "." + sub;
return parent.isEmpty() ? sub : parent + "." + sub;
}

@Override
Expand Down Expand Up @@ -181,7 +181,7 @@ private Map<String, Tag> findLastParent(String[] parts) {
Map<String, Tag> map = root;
for (int i = 0; i < parts.length - 1; ++i) {
if (!map.containsKey(parts[i]) || !(map.get(parts[i]) instanceof CompoundTag))
return null;
return Collections.emptyMap();
map = ((CompoundTag) map.get(parts[i])).getValue();
}
return map;
Expand Down

0 comments on commit bdabb15

Please sign in to comment.