From e85db5ed1bacda48f0dd6e8d4b71ef7e9c5996ca Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Thu, 16 May 2024 22:48:25 +1000 Subject: Fix ruler crashing if item is null somehow (#1174) --- .../moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index 11a8393b..24cc45a3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -483,6 +483,7 @@ public class CustomItemEffects { if (!Minecraft.getMinecraft().thePlayer.isSneaking()) matchStack = getFirstItemInRuler(); match = Blocks.dirt.getDefaultState(); if (matchStack == null) return; + if (matchStack.getItem() == null) return; getBuildersRulerCandidates( Minecraft.getMinecraft().thePlayer, @@ -1478,7 +1479,7 @@ public class CustomItemEffects { matchStack = firstItemInRuler; } int itemCount; - if (matchStack != null) { + if (matchStack != null && matchStack.getItem() != null) { if (match.getBlock() == Blocks.dirt && matchStack.getItemDamage() == 0 && hasDirtWand()) { itemCount = candidatesOld.size(); } else { -- cgit