-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
None
-
Affects Version/s: None
Same issue as SPIGOT-1680
The blocking modifier code is being applied multiple times. There is some shield code found in EntityLiving:
if (f > 0.0F && this.d(damagesource)) { this.k(f); if (damagesource.a()) { f = 0.0F; } else { f *= 0.33F; if (damagesource.i() instanceof EntityLiving) { ((EntityLiving) damagesource.i()).a(this, 0.5F, this.locX - damagesource.i().locX, this.locZ - damagesource.i().locZ); } } flag = true; }
This is the new NMS code for handling blocking. Arrows do no damage to shields, regular attacks do 1/3 of the damage when they are blocking.
Then there is the code found in the Modifier section:
Function<Double, Double> blocking = new Function<Double, Double>() { @Override public Double apply(Double f) { if (human) { if (!damagesource.ignoresArmor() && ((EntityHuman) EntityLiving.this).isBlocking() && f > 0.0F) { return -(f - ((1.0F + f) * 0.5F)); } } return -0.0; } };
As a result there is two sections of code modifying blocking damage. Solution is to move the correct blocking damage modifier into the CraftBukkit method.