mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-24 01:09:16 +00:00
36 lines
2.0 KiB
Diff
36 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Sat, 25 Nov 2023 21:14:45 +0000
|
|
Subject: [PATCH] Allow explosions to destroy lava
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java
|
|
index bdc3ff8cbe4e5eaa9d9a34f38fdd150f7368e33b..e857fd02a5e341a1a701da71874dbd850e3c5a5d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java
|
|
@@ -407,6 +407,11 @@ public class ServerExplosion implements Explosion {
|
|
return Optional.of(ZERO_RESISTANCE);
|
|
}
|
|
// Sakura end - destroy water logged blocks
|
|
+ // Sakura start - allow explosions to destroy lava
|
|
+ if (blockState.is(Blocks.LAVA) && this.level.sakuraConfig().cannons.explosion.explodeLava) {
|
|
+ return Optional.of(ZERO_RESISTANCE);
|
|
+ }
|
|
+ // Sakura end - allow explosions to destroy lava
|
|
}
|
|
|
|
return this.damageCalculator.getBlockExplosionResistance(this, this.level, pos, blockState, fluidState);
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
index 99fd67a78539133adf78d65e2c520ff3dd260301..37ea7f464d6ea691fb0ec08319d03f89bb41cfee 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
@@ -198,7 +198,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
|
});
|
|
}
|
|
|
|
- world.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
|
|
+ world.setBlock(pos, Blocks.AIR.defaultBlockState(), world.sakuraConfig().cannons.explosion.explodeLava && state.is(Blocks.LAVA) ? 2 : 3); // Sakura - allow explosions to destroy lava
|
|
block.wasExploded(world, pos, explosion);
|
|
}
|
|
}
|