From 5ad4442a2479a0a1d1d4713e6fbc29405369c7fa Mon Sep 17 00:00:00 2001 From: LatvianModder Date: Wed, 24 Jul 2024 19:19:16 +0300 Subject: [PATCH] Fixed tags exporting in weird folders --- src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java | 2 +- .../dev/latvian/mods/kubejs/util/RegistryAccessContainer.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java b/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java index 125955bd1..0cfd95bb6 100644 --- a/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java +++ b/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java @@ -81,7 +81,7 @@ public interface TagLoaderKJS { kjs$resources.kjs$getServerScriptManager().getRegistries().cacheTags(reg, map); if (DataExport.export != null) { - var loc = "tags/" + objStorage + "/"; + var loc = "tags/" + objStorage.key.location() + "/"; for (var entry : map.entrySet()) { var list = new ArrayList(); diff --git a/src/main/java/dev/latvian/mods/kubejs/util/RegistryAccessContainer.java b/src/main/java/dev/latvian/mods/kubejs/util/RegistryAccessContainer.java index d863c28e8..25e7ab212 100644 --- a/src/main/java/dev/latvian/mods/kubejs/util/RegistryAccessContainer.java +++ b/src/main/java/dev/latvian/mods/kubejs/util/RegistryAccessContainer.java @@ -97,6 +97,10 @@ public Map itemStackParseCache() { public void cacheTags(Registry registry, Map> map) { var key1 = (ResourceKey) registry.key(); + if (key1 == null) { + return; + } + if (key1 == Registries.ITEM) { cachedItemTags = Cast.to(new CachedItemTagLookup((Registry) registry, map)); cachedRegistryTags.put(key1, Pair.of(registry, cachedItemTags));