From c88bae170f686120d091e4b67c545b11cb2469b7 Mon Sep 17 00:00:00 2001 From: pietro-lopes <97140255+pietro-lopes@users.noreply.github.com> Date: Sat, 19 Oct 2024 20:33:18 -0300 Subject: [PATCH] added null check for module name and logging new recipe count --- .../dev/latvian/mods/kubejs/core/mixin/RecipeManagerMixin.java | 1 + .../java/dev/latvian/mods/kubejs/registry/RegistryType.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/latvian/mods/kubejs/core/mixin/RecipeManagerMixin.java b/src/main/java/dev/latvian/mods/kubejs/core/mixin/RecipeManagerMixin.java index 390ab5d0d..9ecae243e 100644 --- a/src/main/java/dev/latvian/mods/kubejs/core/mixin/RecipeManagerMixin.java +++ b/src/main/java/dev/latvian/mods/kubejs/core/mixin/RecipeManagerMixin.java @@ -137,5 +137,6 @@ private void addServerData(CallbackInfo ci) { } byType = recipesByType.build(); + ConsoleJS.SERVER.info("Loaded " + byType.size() + " recipes"); } } \ No newline at end of file diff --git a/src/main/java/dev/latvian/mods/kubejs/registry/RegistryType.java b/src/main/java/dev/latvian/mods/kubejs/registry/RegistryType.java index be955cf60..2c80ea461 100644 --- a/src/main/java/dev/latvian/mods/kubejs/registry/RegistryType.java +++ b/src/main/java/dev/latvian/mods/kubejs/registry/RegistryType.java @@ -188,7 +188,8 @@ public static synchronized void scan(ResourceLocation registryName, ResourceLoca var stack = Thread.currentThread().getStackTrace(); for (var stackTraceElement : stack) { - if (MODULES_TO_SKIP.contains(stackTraceElement.getModuleName())) { + var moduleName = stackTraceElement.getModuleName(); + if (moduleName != null && MODULES_TO_SKIP.contains(moduleName)) { continue; }