OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Unbreaking not working when Old Durability is enabled

27chandler opened this issue · 10 comments

commented

Information

  • Server Version: PaperMC 1.15.2
  • OldCombatMechanics version: 1.8

Problem Description

When the old durability module is enabled unbreaking is ignored when calculating durability decrease.

To Reproduce

Steps to reproduce the behavior:

  1. Enable Old Durability in Config
  2. Log in with 2 accounts
  3. Equip account 1 with a piece of armour with unbreaking 3 on it
  4. Get account 2 to hit them 10 times
  5. Check armor durability amount

Expected Behaviour

Normally the durability should go down by some randomly selected amount between 0 and 10 due to unbreaking being on the armour piece. (With the randomness of the durability decrease differing depending on the unbreaking level)

Actual Behaviour

The durability goes down by exactly 10, meaning the unbreaking enchant is being fully ignored

commented

After some extra testing I've found that elytras no longer have unbreaking affecting them at all with the newest version.

I did not find this to be the case, as the plugin was recalculating the unbreaking probability and applying it itself. However, I have made OCM ignore Elytras in the module entirely, as the maximum damage they'd receive would always be 1 anyway.

commented

I’m absolutely sure that this is caused by this plugin, because many players noticed this, and removing the plugin solved the problem.

commented

I’m absolutely sure that this is caused by this plugin, because many players noticed this, and removing the plugin solved the problem.

Yes that's why there's a Github issue open for it. It's also already been fixed in the development versions.

commented
commented

Is there a build solving it please ? Le lun. 29 juin 2020 à 16:43, kernitus [email protected] a écrit :
I’m absolutely sure that this is caused by this plugin, because many players noticed this, and removing the plugin solved the problem. Yes that's why there's a Github issue open for it. It's also already been fixed in the development versions. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#390 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJ74ONSWI2KROYETZF5Y3DRZCR7LANCNFSM4NF4TJXA .
-- Louis

https://ci.rayzr.dev/job/OldCombatMechanics/

commented

Ah, I knew I'd forgotten something...

commented

Just to add to this, I haven't tested but I know thorns also affects armour durability. So that might have been forgotten too

commented

Ok @27chandler I have added a calculation for unbreaking based on the formula shown here if you'd like to test it.
Unfortunately, working out durability with thorns is quite a bit more complicated as it involves knowing if the thorns enchantment was used, and then applying the durability reduction to a random piece of armour. That may even require integrating this module with some of the other ones.

commented

I've tested and it appears to be working correctly! Thanks

commented

After some extra testing I've found that elytras no longer have unbreaking affecting them at all with the newest version.