Skip to content

Commit

Permalink
Fix explosions causing an infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Samsuik committed Jan 23, 2024
1 parent f229813 commit 84416d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patches/server/0019-Optimised-Explosions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ index 2bdd46350317a9fadf362b1a341993c92d7a9651..7b5d96670c6818949a0be556b547347e

@Override
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 3cb5306a2ccfc1c53f90ecd56980d17be4042093..9766103797ba9230a63fe11ea441034c0b8a4bd0 100644
index 3cb5306a2ccfc1c53f90ecd56980d17be4042093..88fccb17260c203111147a2a458d81855cf12152 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -55,14 +55,16 @@ public class Explosion {
Expand Down Expand Up @@ -836,7 +836,7 @@ index 3cb5306a2ccfc1c53f90ecd56980d17be4042093..9766103797ba9230a63fe11ea441034c
+ d6 += d2;
+
+ if (blockX == prevX && blockY == prevY && blockZ == prevZ) {
+ f += resistance;
+ f -= resistance;
+ continue;
+ }
+
Expand Down Expand Up @@ -867,7 +867,7 @@ index 3cb5306a2ccfc1c53f90ecd56980d17be4042093..9766103797ba9230a63fe11ea441034c
f -= ((Float) optional.get() + 0.3F) * 0.3F;
}

+ resistance = f; // Sakura
+ resistance = optional.orElse(0.0f); // Sakura
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) {
- set.add(blockposition);
+ found.add(mutableBlockPos.asLong()); // Sakura
Expand Down

0 comments on commit 84416d6

Please sign in to comment.