From 5af11674cd0b039f6b52580f77cd92f3e395b2de Mon Sep 17 00:00:00 2001 From: zontreck Date: Thu, 25 Apr 2024 00:39:12 -0700 Subject: [PATCH] Prevent null exceptions. Check if no more blocks. --- gradle.properties | 2 +- .../zontreck/libzontreck/memory/world/BlockRestoreRunner.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5773e70..5a3376d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,7 +53,7 @@ mod_name=Zontreck's Library Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPLv3 # The mod version. See https://semver.org/ -mod_version=1201.13.042524.0023 +mod_version=1201.13.042524.0038 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreRunner.java b/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreRunner.java index cfb6c01..23bc9dd 100644 --- a/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreRunner.java +++ b/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreRunner.java @@ -26,6 +26,7 @@ public class BlockRestoreRunner implements Runnable if(queue.getQueuedBlocks() == 0 && !queue.usesDatabase()) return; // We'll be queued back up later PrimitiveBlock prim = queue.getNextBlock(); + if(prim == null)return; // No more blocks. Level level = prim.level;