diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java index 7640395..9a90105 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java @@ -450,8 +450,10 @@ public class SchematicNode { if (sws) { s = s.substring(1); } - if(TAB_CACHE.containsKey(user.getId()) && TAB_CACHE.get(user.getId()).containsKey(s)) { - return new ArrayList<>(TAB_CACHE.get(user.getId()).get(s)); + int index = s.lastIndexOf("/"); + String cacheKey = index == -1 ? "" : s.substring(0, index); + if(TAB_CACHE.containsKey(user.getId()) && TAB_CACHE.get(user.getId()).containsKey(cacheKey)) { + return new ArrayList<>(TAB_CACHE.get(user.getId()).get(cacheKey)); } List list = new ArrayList<>(); if (s.contains("/")) { @@ -465,7 +467,7 @@ public class SchematicNode { nodes.forEach(node -> list.add((sws ? "/" : "") + node.getName() + (node.isDir() ? "/" : ""))); } list.remove("//copy"); - Objects.requireNonNull(TAB_CACHE.putIfAbsent(user.getId(), new HashMap<>())).putIfAbsent(s, list); + Objects.requireNonNull(TAB_CACHE.putIfAbsent(user.getId(), new HashMap<>())).putIfAbsent(cacheKey, list); return list; }