1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2024-12-22 22:45:31 +01:00
PaperMC/patches/server/0044-Disable-explosion-knockback.patch

29 lines
1.9 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sudzzy <originmc@outlook.com>
Date: Wed, 2 Mar 2016 14:48:03 -0600
Subject: [PATCH] Disable explosion knockback
2024-10-22 20:04:31 +02:00
diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java
2024-12-03 18:27:11 +01:00
index bbe50f60e653e60c844ca6688e781fa69d67905a..e816e54daff781d54a94a007df5c59051347739d 100644
2024-10-22 20:04:31 +02:00
--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java
+++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java
@@ -246,7 +246,7 @@ public class ServerExplosion implements Explosion {
2021-06-11 14:02:28 +02:00
if (entity instanceof LivingEntity) {
2023-03-14 19:36:39 +01:00
LivingEntity entityliving = (LivingEntity) entity;
2021-06-11 14:02:28 +02:00
2024-10-22 20:04:31 +02:00
- d6 = d5 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE));
+ d6 = entity instanceof Player && this.level.paperConfig().environment.disableExplosionKnockback ? 0 : d5 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); // Paper
2023-03-14 19:36:39 +01:00
} else {
2024-10-22 20:04:31 +02:00
d6 = d5;
2023-03-14 19:36:39 +01:00
}
2024-10-22 20:04:31 +02:00
@@ -271,7 +271,7 @@ public class ServerExplosion implements Explosion {
2021-06-11 14:02:28 +02:00
if (entity instanceof Player) {
Player entityhuman = (Player) entity;
2021-06-12 02:57:04 +02:00
- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig().environment.disableExplosionKnockback) { // Paper - Option to disable explosion knockback
2024-10-22 20:04:31 +02:00
this.hitPlayers.put(entityhuman, vec3d);
2021-06-11 14:02:28 +02:00
}
}