Caltinor / Project-MMO-2.0

A continuation of Harmony's Project MMO project
38 stars 22 forks source link

1.18.2 - Autovalue XP Gain Events Aren't Scaled on First Gain Attempt (Server) #524

Closed MattB70 closed 4 months ago

MattB70 commented 4 months ago

Describe the bug When performing an action that rewards autovalue generated XP, the given XP is not scaled by the given skill's "Skill Modifiers" multiplier on the first attempt per player connected session. For example: The first time breaking a mod block after joining the server, the player will receive the raw autogenerated XP value, in this example it is 487 mining XP. Breaking the block again rewards the correctly scaled XP value, in this case 611 mining XP, as it has been scaled by the mining "Skill Modifiers" XP scalar. This happens with a clean mod-less install, and with default generated configs. I haven't read PMMO 2.0 yet, so I'm not sure where this bug might be, but I'm sure it's probably already fixed in the later versions.

Expected behavior The "Skill Modifiers" scalar should apply immediately on player join, rather than after the first update of a given autogenerated xp gain event.

To Reproduce Steps to reproduce the behavior:

  1. Install mentioned versions
  2. Set a non 1 multiplier to a skill
  3. perform an action to gain xp related to that skill with an autovalue generated value
  4. repeat the same action as before again

Screenshots image

Versions:

Additional context This is related to the "no XP gain after first block break" issue I mentioned in discord.

Caltinor commented 4 months ago

So, i'm getting a different behavior. I'm getting the exact amount from autovalues on the first iteration then a multiplier on the ones that follow. here are my reproduction steps

  1. new world
  2. disable default data
  3. set mining multiplier to 10
  4. break a coal or copper ore block. received 100 (expected 1 basic block break xp 10 rarities xp 10 skill modifier)
  5. break another block of the same type. received 1000xp.

I am getting consistent behavior where the first break is lower and all subsequent breaks are the same, but it can't pinpoint why it's happening.

MattB70 commented 4 months ago

I just did the same test, and confirmed the same thing.

I also did a test with a 0.5 skill multiplier, and it's clear that the [Levels."Skill Modifiers"] is applied twice on all auto-generated values on the player's subsequent iterations. If it doesn't happen in the later versions of the mod, then it was probably some double call somewhere that will be a pain to find. image

I'm just going to not use the multipliers for now, and just override the vanilla data in my pack.