mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Disable explosion knockback
This commit is contained in:
@@ -102,7 +102,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
double d5 = (1.0D - d0) * (double) f2 * (double) f1;
|
double d5 = (1.0D - d0) * (double) f2 * (double) f1;
|
||||||
@@ -214,6 +256,17 @@
|
@@ -204,7 +246,7 @@
|
||||||
|
if (entity instanceof LivingEntity) {
|
||||||
|
LivingEntity entityliving = (LivingEntity) entity;
|
||||||
|
|
||||||
|
- 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
|
||||||
|
} else {
|
||||||
|
d6 = d5;
|
||||||
|
}
|
||||||
|
@@ -214,11 +256,22 @@
|
||||||
d3 *= d6;
|
d3 *= d6;
|
||||||
Vec3 vec3d = new Vec3(d1, d2, d3);
|
Vec3 vec3d = new Vec3(d1, d2, d3);
|
||||||
|
|
||||||
@@ -120,6 +129,12 @@
|
|||||||
entity.push(vec3d);
|
entity.push(vec3d);
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
Player entityhuman = (Player) entity;
|
Player entityhuman = (Player) entity;
|
||||||
|
|
||||||
|
- 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
|
||||||
|
this.hitPlayers.put(entityhuman, vec3d);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -235,10 +288,62 @@
|
@@ -235,10 +288,62 @@
|
||||||
List<ServerExplosion.StackCollector> list1 = new ArrayList();
|
List<ServerExplosion.StackCollector> list1 = new ArrayList();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user