kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics from 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
160 stars 70 forks source link

Gold apple consuming while in combat #662

Closed xph11 closed 6 months ago

xph11 commented 1 year ago

Information

Problem Description

Whenever a player plays on 1.8 client and gets hit by someone, they cannot consume a gold apple - the eating animation just lasts infinitely.

To Reproduce

Steps to reproduce the behavior: 1. Fight someone with 1.8 client 2. Try to consume gold apple after getting hit ### Expected Behaviour

The gold apple should be consumed properly.

Actual Behaviour

The gold apple doesn't get consumed, just continues eating infinitely.

kernitus commented 1 year ago
  1. "Latest dev" doesn't mean anything to us, this could change from one day to the next. Please post the Jenkins build number of the commit hash.
  2. Why do you have 1.8 clients in first place? The plugin only supports 1.9 - 1.19, anything else can lead to undefined behaviour
kernitus commented 1 year ago

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

xph11 commented 1 year ago

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

Thank you, v151 did fix it, but partially. It seems I am able to eat it more times now, however, now the eating process gets cancelled completely if I try to eat while getting hit, so I can only hit every now and then properly, while many times the eating gets cancelled.

kernitus commented 1 year ago

@xph11 I have now changed the module to not cancel the event nor modify the inventory, but rather directly manipulate the potion effects that are applied to the player. Can you try dev build 152 and see if it is any better?

xph11 commented 1 year ago

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

Thank you, v151 did fix it, but partially. It seems I am able to eat it more times now, however, now the eating process gets cancelled completely if I try to eat while getting hit, so I can only hit every now and then properly, while many times the eating gets cancelled.

So the initial bug is fixed now thankfully. However, now instead of adding just 2 golden hearts max, it adds up to 8 hearts max.. could you maybe fix that or add a golden heart extra limit setting?

kernitus commented 1 year ago

@xph11 Ok, I have resorted to just nuking all of a player's potion effects and adding only the ones they should have. This means the status effect icons will briefly flash on the screen but that is an acceptable tradeoff. Please try test build 155.

xph11 commented 1 year ago

@xph11 Ok, I have resorted to just nuking all of a player's potion effects and adding only the ones they should have. This means the status effect icons will briefly flash on the screen but that is an acceptable tradeoff. Please try test build 155.

So it almost works now, I just noticed however, that if I get hit and try to eat the gapple when looking at a nearby block, it still won't work. If I get hit and try to eat it while looking at a player or just the air, it does work.

kernitus commented 1 year ago

Can you elaborate on the sequence of actions you are taking? You get hit, then try to eat the apple? Or were you eating it already?

xph11 commented 1 year ago

Can you elaborate on the sequence of actions you are taking? You get hit, then try to eat the apple? Or were you eating it already?

Basically I got someone else to keep hitting me, while I eat a gapples over and over (got a stack) while getting constantly hit. The sword I get his by is a diamond sword with sharpness II and fire aspect II

kernitus commented 1 year ago

What do you mean by "still won't work". I just tried this with a 1.8 client on a 1.12 server and a 1.8 client on a 1.19 server, with ViaVersion, ViaBackwards, and ViaRewind. I can eat gapples and enchanted gapples just fine while being damaged.

With the newest dev build, have you tried disabling just the old-golden-apples module? Does it affect the behaviour in-game?