9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-30 12:19:08 +00:00
Files
SakuraMC/sakura-server/minecraft-patches/features/0029-Configure-breaking-blocks-outside-the-world-border.patch

23 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
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 49dabe47bda4237df9799d3c673a40cab9f2d03e..cf8f4203c06030e36a5a5bfe210ba65582c204cb 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -540,6 +540,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