9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-29 19:59:08 +00:00
Files
SakuraMC/patches/server/0044-Allow-explosions-to-destroy-lava.patch
Samsuik ae970e6a71 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly
2023-12-07 16:00:45 +00:00

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 7bef41c62d6c96062532233c80b96d6e65a523c8..505ccb379c074cfe87a47523ecfe048cbb89b55e 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
@@ -443,6 +447,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();