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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
2024-05-16 02:06:59 +02:00
|
|
|
index 8faa868787d63663cf844a9a6782a13405b30372..da9a9b235d1c8bcab3762134d69dcb112470e55d 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
2024-04-24 01:30:03 +02:00
|
|
|
@@ -284,7 +284,7 @@ public class 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
|
|
|
|
2023-12-05 20:39:26 +01:00
|
|
|
- d13 = ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12);
|
2024-01-24 11:45:17 +01:00
|
|
|
+ d13 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12); // Paper - Option to disable explosion knockback
|
2023-03-14 19:36:39 +01:00
|
|
|
} else {
|
2023-12-05 20:39:26 +01:00
|
|
|
d13 = d12;
|
2023-03-14 19:36:39 +01:00
|
|
|
}
|
2024-04-28 03:00:01 +02:00
|
|
|
@@ -309,7 +309,7 @@ public class 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)) {
|
2024-01-24 11:45:17 +01:00
|
|
|
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig().environment.disableExplosionKnockback) { // Paper - Option to disable explosion knockback
|
2023-03-14 19:36:39 +01:00
|
|
|
this.hitPlayers.put(entityhuman, vec3d1);
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
}
|