9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-28 03:09:07 +00:00
Files
SakuraMC/patches/server/0044-Allow-explosions-to-destroy-lava.patch

35 lines
1.6 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/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 6adf7e5945dcf8d11b133c7497a2c1eea0990860..0b90b05bd538186f8f1d51376560dd6485fdce57 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -228,6 +228,10 @@ public class Explosion {
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
resistance = Optional.of(material.resistance());
}
+
+ if (this.level.sakuraConfig().cannons.explosion.explodeLava && blockState.is(Blocks.LAVA)) {
+ resistance = Optional.of(0.0f); // 1.0 might be better here, 0.0 seems too much.
+ }
}
// Sakura end - explosion durable blocks
@@ -453,6 +457,12 @@ public class Explosion {
return false;
}
+ // Sakura start - explode lava
+ if (level.sakuraConfig().cannons.explosion.explodeLava && state.is(Blocks.LAVA)) {
+ return true;
+ }
+ // Sakura end
+
float power = radius * 1.3f;
float blockRes = state.getBlock().getExplosionResistance();
float fluidRes = state.getFluidState().getExplosionResistance();