PaperMC/patches/server/0664-Don-t-apply-cramming-damage-to-players.patch

26 lines
1.5 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Phoenix616 <max@themoep.de>
Date: Sun, 20 Jun 2021 16:35:42 +0100
Subject: [PATCH] Don't apply cramming damage to players
It does not make a lot of sense to damage players if they get crammed,
especially as the usecase of teleporting lots of players to the same
location isn't too uncommon and killing all those players isn't
really what one would expect to happen.
For those who really want it a config option is provided.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2022-11-10 01:05:46 +01:00
index e505fa3a6f90efec32e408a08a31295ae829ac2c..b335d10dcc2f23c6b7b9976b33af5ab2f221f15c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2022-11-10 01:05:46 +01:00
@@ -1433,7 +1433,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
- return super.isInvulnerableTo(damageSource) || this.isChangingDimension() || this.getAbilities().invulnerable && damageSource == DamageSource.WITHER;
+ return super.isInvulnerableTo(damageSource) || this.isChangingDimension() || this.getAbilities().invulnerable && damageSource == DamageSource.WITHER || !level.paperConfig().collisions.allowPlayerCrammingDamage && damageSource == DamageSource.CRAMMING; // Paper - disable player cramming
}
@Override