From e526eafa3916c9c748216f0a9b2675d143ae27cc Mon Sep 17 00:00:00 2001 From: galacticwarrior9 <9055352+galacticwarrior9@users.noreply.github.com> Date: Mon, 21 Aug 2023 05:50:02 +0100 Subject: [PATCH] Determine lava and water fluid explosion resistance by their block explosion resistance (#9482) --- ...nd-water-fluid-explosion-resistance-.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/server/Determine-lava-and-water-fluid-explosion-resistance-.patch diff --git a/patches/server/Determine-lava-and-water-fluid-explosion-resistance-.patch b/patches/server/Determine-lava-and-water-fluid-explosion-resistance-.patch new file mode 100644 index 0000000000..69a075738e --- /dev/null +++ b/patches/server/Determine-lava-and-water-fluid-explosion-resistance-.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: galacticwarrior9 +Date: Thu, 13 Jul 2023 21:32:13 +0100 +Subject: [PATCH] Determine lava and water fluid explosion resistance by their + block explosion resistance + +When selecting which explosion resistance to use for lava and water, vanilla selects the highest value between their block explosion resistance and fluid explosion resistance. + +Problems emerge when we want to reduce the explosion resistance of water or lava, since the fluid explosion resistance is hardcoded to return 100.0F and can't be changed by a plugin. This simply makes the fluid explosion resistance the same as the block explosion resistance, which allows plugin to change the value. Since both are the same in vanilla, this has no side effects on servers that do not need to do this. + +diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java ++++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java +@@ -0,0 +0,0 @@ public abstract class LavaFluid extends FlowingFluid { + + @Override + protected float getExplosionResistance() { +- return 100.0F; ++ return Blocks.LAVA.getExplosionResistance(); // Paper + } + + @Override +diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java ++++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java +@@ -0,0 +0,0 @@ public abstract class WaterFluid extends FlowingFluid { + + @Override + protected float getExplosionResistance() { +- return 100.0F; ++ return Blocks.WATER.getExplosionResistance(); // Paper + } + + @Override