1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-16 18:31:53 +01:00

Fix explosions calculation getting stuck ()

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
This commit is contained in:
Shane Freeder 2024-07-12 08:16:03 +01:00
parent 467c178970
commit 12356fbe77

View file

@ -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);