From b1703fbf85be1d57addf78eb29e811a437ec7daf Mon Sep 17 00:00:00 2001 From: Samsuik Date: Fri, 7 Mar 2025 17:19:17 +0000 Subject: [PATCH] Configure explosions breaking blocks when outside the world border --- ...king-blocks-outside-the-world-border.patch | 22 +++++++++++++++++++ .../configuration/WorldConfiguration.java | 1 + 2 files changed, 23 insertions(+) create mode 100644 sakura-server/minecraft-patches/features/0029-Configure-breaking-blocks-outside-the-world-border.patch diff --git a/sakura-server/minecraft-patches/features/0029-Configure-breaking-blocks-outside-the-world-border.patch b/sakura-server/minecraft-patches/features/0029-Configure-breaking-blocks-outside-the-world-border.patch new file mode 100644 index 0000000..6b3649d --- /dev/null +++ b/sakura-server/minecraft-patches/features/0029-Configure-breaking-blocks-outside-the-world-border.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samsuik +Date: Fri, 7 Mar 2025 17:14:35 +0000 +Subject: [PATCH] Configure breaking blocks outside the world border + + +diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java +index 451cb54da29ad7e6fc74f4a57df8493ce3e43b2d..71401708e65c9b06f30d124757fecf5f61eff957 100644 +--- a/net/minecraft/world/level/ServerExplosion.java ++++ b/net/minecraft/world/level/ServerExplosion.java +@@ -538,6 +538,11 @@ public class ServerExplosion implements Explosion { + return ret; + } + // Sakura end - optimise protected explosions ++ // Sakura start - configure breaking blocks when outside the world border ++ if (!this.level.sakuraConfig().cannons.explosion.breakBlocksWhenOutsideTheWorldBorder && !this.level.getWorldBorder().isWithinBounds(center)) { ++ return ret; ++ } ++ // Sakura end - configure breaking blocks when outside the world border + + // only ~1/3rd of the loop iterations in vanilla will result in a ray, as it is iterating the perimeter of + // a 16x16x16 cube diff --git a/sakura-server/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/sakura-server/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java index 671acdd..012d8e2 100644 --- a/sakura-server/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java +++ b/sakura-server/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java @@ -98,6 +98,7 @@ public final class WorldConfiguration extends ConfigurationPart { public boolean explosionsHurtPlayers = true; public boolean explosionsDropItems = true; public boolean useBlockCacheAcrossExplosions = false; + public boolean breakBlocksWhenOutsideTheWorldBorder = true; } public Mechanics mechanics = new Mechanics();