aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-05-16 22:48:25 +1000
committerGitHub <noreply@github.com>2024-05-16 14:48:25 +0200
commite85db5ed1bacda48f0dd6e8d4b71ef7e9c5996ca (patch)
treecaecf7a699746de1c618bbae54f9e9ec99a5ca2a
parentaffaa482396351a03d8f5034379bf2144ada9105 (diff)
downloadNotEnoughUpdates-e85db5ed1bacda48f0dd6e8d4b71ef7e9c5996ca.tar.gz
NotEnoughUpdates-e85db5ed1bacda48f0dd6e8d4b71ef7e9c5996ca.tar.bz2
NotEnoughUpdates-e85db5ed1bacda48f0dd6e8d4b71ef7e9c5996ca.zip
Fix ruler crashing if item is null somehow (#1174)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java3
1 files changed, 2 insertions, 1 deletions
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 {