9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-29 20:09:23 +00:00

feat: old wet tnt explode behavior(#514)

This commit is contained in:
MC_XiaoHei
2025-07-04 08:56:44 +08:00
parent e0a2cbc21f
commit 3e96b23774
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MC_XiaoHei <xor7xiaohei@gmail.com>
Date: Fri, 4 Jul 2025 08:55:31 +0800
Subject: [PATCH] Old wet tnt explode behavior
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
index 07e4025ca6c9c31905db2e6921138a0ded479dde..87635f6db2f1e77edc7ba6a26e9818d070a9faf7 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -729,6 +729,7 @@ public class ServerExplosion implements Explosion {
public boolean shouldAffectBlocklikeEntities() {
boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
boolean flag = this.source == null || this.source.getType() != EntityType.BREEZE_WIND_CHARGE && this.source.getType() != EntityType.WIND_CHARGE;
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.tntWetExplosionNoItemDamage) flag = flag && (this.source == null || !this.source.isInWater()); // Leaves - Old MC TNT wet explosion no item damage
return _boolean ? flag : this.blockInteraction.shouldAffectBlocklikeEntities() && flag;
}

View File

@@ -352,6 +352,9 @@ public final class LeavesConfig {
@GlobalConfig("keep-leash-connect-when-use-firework")
public boolean keepLeashConnectWhenUseFirework = false;
@GlobalConfig("tnt-wet-explosion-no-item-damage")
public boolean tntWetExplosionNoItemDamage = false;
}
public ElytraAeronauticsConfig elytraAeronautics = new ElytraAeronauticsConfig();