From 12356fbe77ad36de67405dec7bc914a139d0d1a3 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 12 Jul 2024 08:16:03 +0100 Subject: [PATCH] Fix explosions calculation getting stuck (#11061) Co-authored-by: Nassim Jahnke --- patches/server/Moonrise-optimisation-patches.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/server/Moonrise-optimisation-patches.patch b/patches/server/Moonrise-optimisation-patches.patch index 7e3196eff..398647202 100644 --- a/patches/server/Moonrise-optimisation-patches.patch +++ b/patches/server/Moonrise-optimisation-patches.patch @@ -31176,13 +31176,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - set.add(blockposition.relative(direction.getOpposite())); + // Paper end - collision optimisations + BlockState iblockdata = cachedBlock.blockState; // Paper - optimise collisions -+ if (!iblockdata.isDestroyable()) continue; // Paper - Protect Bedrock and End Portal/Frames from being destroyed + // Paper - collision optimisations + + // Paper start - collision optimisations + power -= cachedBlock.resistance; + -+ if (power > 0.0f && cachedBlock.shouldExplode == null) { ++ if (power > 0.0f && cachedBlock.shouldExplode == null && iblockdata.isDestroyable()) { // Paper - Protect Bedrock and End Portal/Frames from being destroyed + // note: we expect shouldBlockExplode to be pure with respect to power, as Vanilla currently is. + // basically, it is unused, which allows us to cache the result + final boolean shouldExplode = this.damageCalculator.shouldBlockExplode((Explosion)(Object)this, this.level, cachedBlock.immutablePos, cachedBlock.blockState, power);