9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-27 02:39:06 +00:00
Files
SakuraMC/patches/server/0054-Option-to-disable-explosions-hurting-players.patch
Samsuik 7fafdbf3cb Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@dc3ef2a Fix vanilla components not being translated (#9893)
PaperMC/Paper@7e15d97 Remove no longer needed diff from adventure patch
PaperMC/Paper@f1820dc Fix incorrect border collision detection
PaperMC/Paper@de04cbc Updated Upstream (Bukkit/CraftBukkit) (#10034)
PaperMC/Paper@ff26d54 send sound and particle packets immediately even if off main (#10033)
PaperMC/Paper@e3140fb hotfix spawning item/xp in wrong spot
PaperMC/Paper@0b95298 Make worldborder collisions consistent with Vanilla
PaperMC/Paper@47b2c18 Don't fire the drop event on player deaths (#10046)
PaperMC/Paper@8c007d9 properly read and store sus effect duration (#10050)
PaperMC/Paper@5385b21 [ci skip] Make test results viewable in-browser and downloadable (#10055)
PaperMC/Paper@086ca61 Fix world border edge collision (#10053)
PaperMC/Paper@45e01a2 Use correct max stack size in crafter (#10057)
PaperMC/Paper@d11a588 Remove duplicate code in chunk tick iteration (#10056)
PaperMC/Paper@b4c9e7e add missing Experimental annotations (#10012)
2023-12-22 11:11:22 +00:00

20 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
Date: Sat, 9 Dec 2023 00:25:11 +0000
Subject: [PATCH] Option to disable explosions hurting players
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index d0742bbf6f94705e378972e3bc0fab4682f3d78f..9b6359b67b5840739dffdb174e591ea76601626c 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -933,7 +933,7 @@ public abstract class Player extends LivingEntity {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
- return super.isInvulnerableTo(damageSource) ? true : (damageSource.is(DamageTypeTags.IS_DROWNING) ? !this.level().getGameRules().getBoolean(GameRules.RULE_DROWNING_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FALL) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FALL_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FIRE) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FIRE_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FREEZING) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FREEZE_DAMAGE) : false))));
+ return super.isInvulnerableTo(damageSource) ? true : (damageSource.is(DamageTypeTags.IS_DROWNING) ? !this.level().getGameRules().getBoolean(GameRules.RULE_DROWNING_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FALL) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FALL_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FIRE) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FIRE_DAMAGE) : (damageSource.is(DamageTypeTags.IS_FREEZING) ? !this.level().getGameRules().getBoolean(GameRules.RULE_FREEZE_DAMAGE) : (damageSource.is(DamageTypeTags.IS_EXPLOSION) ? !level().sakuraConfig().cannons.explosion.explosionsHurtPlayers : false))))); // Sakura
}
@Override