mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-19 14:59:30 +00:00
Configure explosions breaking blocks when outside the world border
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
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 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
|
||||||
@@ -98,6 +98,7 @@ public final class WorldConfiguration extends ConfigurationPart {
|
|||||||
public boolean explosionsHurtPlayers = true;
|
public boolean explosionsHurtPlayers = true;
|
||||||
public boolean explosionsDropItems = true;
|
public boolean explosionsDropItems = true;
|
||||||
public boolean useBlockCacheAcrossExplosions = false;
|
public boolean useBlockCacheAcrossExplosions = false;
|
||||||
|
public boolean breakBlocksWhenOutsideTheWorldBorder = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mechanics mechanics = new Mechanics();
|
public Mechanics mechanics = new Mechanics();
|
||||||
|
|||||||
Reference in New Issue
Block a user