From aa0c30f3aebdc695531376ddcdbc444f193ede34 Mon Sep 17 00:00:00 2001 From: Samsuik Date: Sun, 22 Dec 2024 15:35:19 +0000 Subject: [PATCH] Fix durable blocks being destructable at the bottom of the world This would causes issues if bedrock is configured to be a durable block. --- patches/server/0029-Explosion-Durable-Blocks.patch | 4 ++-- patches/server/0030-Destroy-Waterlogged-Blocks.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/server/0029-Explosion-Durable-Blocks.patch b/patches/server/0029-Explosion-Durable-Blocks.patch index b91a239..4e0bea8 100644 --- a/patches/server/0029-Explosion-Durable-Blocks.patch +++ b/patches/server/0029-Explosion-Durable-Blocks.patch @@ -104,7 +104,7 @@ index a8008c7550488be34b51f4280f5569170b1ebd1d..ccc0e211648a77bb396b8b0e9d3b3984 public String getDescriptionId() { return this.getOrCreateDescriptionId(); diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 4571eca1a595c36791bca12ee1a65e55a4c693ac..ce61d1167c0a956cf461509b7c520c15bae56b0a 100644 +index ceedd8ab94f2f3e2f61b3caf84121dfef4e73bbe..2760075bf3a2f723a0470b559ed2c2e002991d9b 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -145,7 +145,7 @@ public class Explosion { @@ -126,7 +126,7 @@ index 4571eca1a595c36791bca12ee1a65e55a4c693ac..ce61d1167c0a956cf461509b7c520c15 + Block block = blockState.getBlock(); + me.samsuik.sakura.explosion.durable.DurableMaterial material = this.level.localConfig().config(pos).durableMaterials.get(block); + -+ if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) { ++ if (material != null && material.resistance() >= 0.0f && pos.getY() > this.level.getMinBuildHeight() && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) { + return Optional.of(material.resistance()); + } + } diff --git a/patches/server/0030-Destroy-Waterlogged-Blocks.patch b/patches/server/0030-Destroy-Waterlogged-Blocks.patch index 2b74c12..1713e83 100644 --- a/patches/server/0030-Destroy-Waterlogged-Blocks.patch +++ b/patches/server/0030-Destroy-Waterlogged-Blocks.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Destroy Waterlogged Blocks diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 407154670acbec704ef6804a33c320ab9246c16d..b32f377079a7c97840079b0a6b541be936c822dd 100644 +index 2760075bf3a2f723a0470b559ed2c2e002991d9b..e941719d74f46b0bcf6e74c704d1a87f6cb37e4e 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -168,6 +168,11 @@ 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)) { + if (material != null && material.resistance() >= 0.0f && pos.getY() > this.level.getMinBuildHeight() && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) { return Optional.of(material.resistance()); } + // Sakura start - destroy water logged blocks