Closed pedrodalben closed 1 year ago
Lots of players on my server are still complaining about this. I am under the impression that the statement the last time this was brought up "The attack-frequency does not set hard limits, because you can still be overdamaged by an attack of a higher value than the previous one while immune" does not describe the desired behavior. This was not an issue in 1.8, there was a click limit, and auto clicking many times a second would not insta kill your opponent. This is still reproducible in 1.8 to this day.
I'd like to add to the above comment with a few more technical details about pre1.9 immunity frames(i-frames). The i-frames in pre1.9 caused the player to not take damage for 0.5 seconds, unless the new damage was higher than the damage inflicted at the start of the i-frames. For instance, if someone deals 2 damage to a player, and then another 2 within 0.5 seconds, no extra damage is taken. However, if 3 damage is dealt within 0.5 seconds, 1 damage is added to the player, so that the total damage for the i-frame is 3, but no knockback is sustained. Using OCM, we have found that any damage dealt within this 0.5 seconds does in fact get registered, and fully dealt to the player, without any knockback being sustained.
Gostaria de adicionar ao comentário acima mais alguns detalhes técnicos sobre os quadros de imunidade pré-1.9 (i-quadros). Os i-frames em pré-1.9 faziam com que o jogador não sofresse dano por 0,5 segundos, a menos que o novo dano fosse maior que o dano infligido no início dos i-frames. Por exemplo, se alguém causar 2 danos a um jogador e depois outros 2 em 0,5 segundos, nenhum dano extra será recebido. No entanto, se 3 danos forem causados em 0,5 segundos, 1 dano é adicionado ao jogador, de modo que o dano total para o i-frame é 3, mas nenhum knockback é sustentado. Usando o OCM, descobrimos que qualquer dano causado dentro desses 0,5 segundos é de fato registrado e totalmente causado ao jogador, sem qualquer repulsão.
yes, this is completely game breaking
What @Barny1094875 describes is the correct 1.8 behaviour and what OCM attempts to replicate. In fact, the minecraft code for this pre and post-1.9 is the same, all that changed are the immunity times themselves, from 18 ticks to 20 ticks. When an entity is first hit, their immunity time is set to 20 ticks, i.e. 1 second. Before this number goes past halfway, if they receive damage greater than the last damage they are dealt the difference. The "damage" here includes the weapon damage + weapon enchantments, the strength status/weakness status effects, and critical hits. When the immunity ticks goes down past halfway they are no longer immune, meaning the "immunity" lasts half a second when set to 20.
Now, this behaviour is exactly what OCM is coded to do and what I have observed in all my tests, both manual and automated. Thus, to have any chance of identifying where the problem might lie I will need your collaboration. I will need from all of you:
debug
mode enabled in the config, and the absolute minimal set of plugins and weapons/tools required for the bug to happen. For example, this would be a video with debug mode enabled of a player hitting another with a sword with no enchantments, and no armour involved, on a server with only OCM installed. If the bug shows up in these conditions, it will be a lot easier to identify the problem. If it does not, try to get as close to these conditions as possible.What @Barny1094875 describes is the correct 1.8 behaviour and what OCM attempts to replicate. In fact, the minecraft code for this pre and post-1.9 is the same, all that changed are the immunity times themselves, from 18 ticks to 20 ticks. When an entity is first hit, their immunity time is set to 20 ticks, i.e. 1 second. Before this number goes past halfway, if they receive damage greater than the last damage they are dealt the difference. The "damage" here includes the weapon damage + weapon enchantments, the strength status/weakness status effects, and critical hits. When the immunity ticks goes down past halfway they are no longer immune, meaning the "immunity" lasts half a second when set to 20.
Now, this behaviour is exactly what OCM is coded to do and what I have observed in all my tests, both manual and automated. Thus, to have any chance of identifying where the problem might lie I will need your collaboration. I will need from all of you:
1. A complete list of all plugins running on the server where the bug manifests itself. This is because in order for OCM to register all potential "overdamage" (damage difference during immunity period) it temporarily sets the last damage to 0 before setting it back to the actual value. It is possible some other plugins do not like this and are interfering with it. 2. A "minimal viable example" of the bug happening. This could be a video of the bug happening, like @pedrodalben posted, but with `debug` mode enabled in the config, and the _absolute minimal_ set of plugins and weapons/tools required for the bug to happen. For example, this would be a video with debug mode enabled of a player hitting another with a sword with no enchantments, and no armour involved, on a server with only OCM installed. If the bug shows up in these conditions, it will be a lot easier to identify the problem. If it does not, try to get as close to these conditions as possible.
thinking about what you said... on my server I have mcmmo installed and it may be affecting me, I'm going to do some tests
@pedrodalben @NotAlexNoyle @Barny1094875 @skbeh In the meantime, can you please try dev build 175. I have changed the order in which the OCM listeners do things to take into account modifications made by other plugins. Hopefully this will at least alleviate the issue.
@pedrodalben @NotAlexNoyle @Barny1094875 @skbehEnquanto isso, você pode tentar o dev build 175 . Alterei a ordem em que os ouvintes do OCM fazem as coisas para levar em conta as modificações feitas por outros plugins. Espero que isso pelo menos alivie o problema.
testing..
Will test by Monday.
@pedrodalben @NotAlexNoyle @Barny1094875 @skbeh In the meantime, can you please try dev build 175. I have changed the order in which the OCM listeners do things to take into account modifications made by other plugins. Hopefully this will at least alleviate the issue.
In my opinion this solves the problem. The difference is night-and-day. Duels take 3-4x longer now. It feels much more loyal to 1.8.
@pedrodalben @NotAlexNoyle @Barny1094875 @skbeh In the meantime, can you please try dev build 175. I have changed the order in which the OCM listeners do things to take into account modifications made by other plugins. Hopefully this will at least alleviate the issue.
The problem was solved! thank you for your support
That is good to hear, it seems the problem was conflicts with other plugins. The fix has already been released as part of the 1.12.2 OCM update.
@kernitus I think that there is more things to do. Take 1.12.2 for example.
With OCM loaded, in EntityLiving.java:884 (if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
)
this.lastDamage is always 0.0, which causes the following check to fail and the damage will always be dealt in the immune period. Please check it.
if (f <= this.lastDamage) {
this.forceExplosionKnockback = true; // CraftBukkit - SPIGOT-949 - for vanilla consistency, cooldown does not prevent explosion knockback
return false;
}
f
should mean the current damage that will be dealt.
@kernitus I think that there is more things to do. Take 1.12.2 for example.
With OCM loaded, in EntityLiving.java:884 (
if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
) this.lastDamage is always 0.0, which causes the following check to fail and the damage will always be dealt in the immune period. Please check it.if (f <= this.lastDamage) { this.forceExplosionKnockback = true; // CraftBukkit - SPIGOT-949 - for vanilla consistency, cooldown does not prevent explosion knockback return false; }
f
should mean the current damage that will be dealt.
The last damage is deliberately always set to 0 so that no potential attacks are missed as a consequence of the default weapon damage being lower than that set in the config. OCM then checks whether the attack was actually going to land or not depending on the configured damages, and cancel it or apply it.
Please open a new issue with relevant details if you think there is still a problem with the damage calculations.
Information
config.yml
Problem Description
To Reproduce
Steps to reproduce the behavior: - auto click, delay 0 - hit https://www.youtube.com/watch?v=T5uTR-eNxx4 ### Expected BehaviourThe expected behavior is that the plugin somehow handles these thousands of clicks that end up instantly killing any player, providing some kind of protection.
Actual Behaviour
https://www.youtube.com/watch?v=T5uTR-eNxx4