Skip to content

Commit

Permalink
Fix NPE in clipsAnything at world height
Browse files Browse the repository at this point in the history
If the block is out of bounds, then the block state may
be null.
  • Loading branch information
Spottedleaf committed Sep 13, 2023
1 parent ab06dbb commit 259f2da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0029-Actually-optimise-explosions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The results indicate that this logic is 5 times faster than Vanilla
and 2.3 times faster than Lithium.

diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index e8c4815960ab144298d4352f393b9670e7004e62..905602f0535ba899057a8bdfe165670944daa271 100644
index e8c4815960ab144298d4352f393b9670e7004e62..744b9e4666aade8d84f84807900d4ee31afef7b6 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -96,6 +96,271 @@ public class Explosion {
Expand Down Expand Up @@ -209,7 +209,7 @@ index e8c4815960ab144298d4352f393b9670e7004e62..905602f0535ba899057a8bdfe1656709
+ }
+
+ final BlockState blockState = cachedBlock.blockState;
+ if (!blockState.emptyCollisionShape()) {
+ if (blockState != null && !blockState.emptyCollisionShape()) {
+ net.minecraft.world.phys.shapes.VoxelShape collision = cachedBlock.cachedCollisionShape;
+ if (collision == null) {
+ collision = blockState.getConstantCollisionShape();
Expand Down

0 comments on commit 259f2da

Please sign in to comment.