Closed MeFisto94 closed 2 years ago
i'm a little unclear on what to look into here, since it seems you've done a large amount of investigation yourself. can you reproduce this with a minimum setup of just OCM + ViaVersion + your particular configs for the two? if so, could you please share both of those here?
@MeFisto94 the values should be taken server-side, so this seems to be something to do with how ViaVersion is doing things. Also, this plugin was not built for 1.8 and so there is always the possibility of wacky stuff happening there.
So I guess this is reproducable with a default setup of OCM and ViaVersion (that being said ViaVersion needs ViaBackwards and ViaRewind for this to work): The catch is, we want to provide a 1.8 combat experience, where the users even use 1.8 clients (as opposed to more recent ones). We just want the latest API improvements, peformance and other advancements and thus we don't use an 1.8 server, but an 1.15 one.
So to reiterate:
Ideally I'd like to have the 1.8 client behavior also on 1.9+ clients, which means changing the SHIELD modifier somehow. The first priority however is how to get to those magic values/make all clients behave the same, I guess.
OCM recalculates most damages applied to the players, because Bukkit does not provide sufficient APIs to do this kind of thing. So, when blocking with a shield, the damage is reduced as would have happened when sword-blocking in 1.8, and not entirely stopped, as in 1.9. If you find that not to be the case, then it may well be ViaVersion that is interfering.
Also, what exactly do ViaBackwards and ViaRewind do? Could they be the issue?
Information
Problem Description
Sword Blocking with ViaVersion depends on the client version. We've disabled the shield functionality from via-version.
When joining with a 1.8 client, incoming damage is possible (it logs EntityDamageByEntityListener). When joining with an 1.15.2 client, incoming damage is completely absorbed by the armor. When not wearing armor, I get the damage which is exactly 50% of the incoming damage (ShieldDamageReduction applied, but the EntityDamageByEntityListener does not print).
What I guess happens is that for the 1.8 client, the armor is reducing the damage before the shield reduction is applied or anything.
To Reproduce
Steps to reproduce the behavior: Try to hit eachother with 1.8.8 and 1.15.2 while being sword blocked.
Hitting an 1.8 player from 1.15.2:![grafik](https://user-images.githubusercontent.com/12577813/89105739-269dac00-d424-11ea-90b8-e59d005da347.png)
Hitting an 1.15.2 player from 1.8:![grafik](https://user-images.githubusercontent.com/12577813/89105758-52b92d00-d424-11ea-8182-6af0d89adae2.png)
Expected Behaviour
Actual Behaviour
See Problem Description
Sorry for the bad problem description, we try to dig into it ourselves as well.
EDIT: Debugging showed a lot: The incoming EntityDamageEvent has a different final damage. For the 1.15.2 player, the following modificators are present:
For the 1.8.8 player, the following modificators are present:
The problem is now I don't know which modifiers are those that OCM needs, I guess the 1.15.2 ones, but I also don't know if I can hijack the event with reflection.
Edit 2: So blocking is not set for the 1.8.8 player due to via version / our config / something. I need to find out why Armor and Magic are set, though and probably fix that the damage reduction in combination with the armor lead to invulnerability