Disable explosion knockback

This commit is contained in:
Sudzzy 2016-03-02 14:48:03 -06:00
parent 68603a72c5
commit fb3f2c1b8e

View File

@ -102,7 +102,16 @@
}
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;
Vec3 vec3d = new Vec3(d1, d2, d3);
@ -120,6 +129,12 @@
entity.push(vec3d);
if (entity instanceof Player) {
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 @@
List<ServerExplosion.StackCollector> list1 = new ArrayList();