From 6eec237feece6e9f48d3ce925d629d92f61b2471 Mon Sep 17 00:00:00 2001 From: Teteros Date: Tue, 4 Nov 2025 00:49:34 +0000 Subject: [PATCH] Add null guards to BlockUtil reflections to prevent NullPointerExceptions --- src/main/java/forestry/core/utils/BlockUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/forestry/core/utils/BlockUtil.java b/src/main/java/forestry/core/utils/BlockUtil.java index 499906020..bf4310db1 100644 --- a/src/main/java/forestry/core/utils/BlockUtil.java +++ b/src/main/java/forestry/core/utils/BlockUtil.java @@ -268,11 +268,11 @@ public abstract class BlockUtil { } while (stillInside.test(tile)); block = world.getBlock(x, y - depth, z); - if (bw && BW_MetaGenerated_WerkstoffBlocksClass.isInstance(block)) { + if (bw && BW_MetaGenerated_WerkstoffBlocksClass != null && BWBlocks != null && BW_MetaGenerated_WerkstoffBlocksClass.isInstance(block)) { return new ItemStack(BWBlocks, 1, block.getDamageValue(world, x, y - depth, z)); } - if (gt && GTBlockMachines_Class.isInstance(block)) { + if (gt && GTBlockMachines_Class != null && GTBlockMachines != null && GTBlockMachines_Class.isInstance(block)) { return new ItemStack(GTBlockMachines, 1, block.getDamageValue(world, x, y - depth, z)); }