Skip to content

Changes

Started 1 day 0 hr ago
Took 49 sec on Builder

Summary

  1. Fix melee attack strength scale after Paper fixed attack cooldown bug in 26.1.2 (commit: 8e1b6de) (details)
  2. Refactor diminished returns tracking into DiminishedReturnsCache/State (commit: 3fb1369) (details)
  3. Fix pre-existing test failures and improve Docker test skip mechanism (commit: 3a69634) (details)
Commit 8e1b6deaa5a81fabe92b362e8ef58adfe8e354f8 by nossr50
Fix melee attack strength scale after Paper fixed attack cooldown bug in 26.1.2

Paper 26.1.2 fixed a bug where the player attack cooldown ticker was not
resetting at the correct point during melee hits. mcMMO relied on the old
(incorrect) order, reading the cooldown during the damage event, which
always returned near-zero after Paper's fix. Attack strength scale is
now back-derived from the raw event damage divided by the player's
GENERIC_ATTACK_DAMAGE attribute value and clamped to [0.0, 1.0].

AttributeMapper now survives test environments where Bukkit registries
are absent (catch Throwable in the registry reflection path).

Fixes #5287.
(commit: 8e1b6de)
The file was modifiedsrc/main/java/com/gmail/nossr50/util/AttributeMapper.java (diff)
The file was modifiedChangelog.txt (diff)
The file was modifiedsrc/test/java/com/gmail/nossr50/util/skills/CombatUtilsTest.java (diff)
The file was modifiedsrc/main/java/com/gmail/nossr50/util/skills/CombatUtils.java (diff)
Commit 3fb13694441fa58f02f464cebf02cc9c40b10d5d by nossr50
Refactor diminished returns tracking into DiminishedReturnsCache/State

Extracts per-player DR data out of PlayerProfile into two new classes:
- DiminishedReturnsState: thread-safe XP gain queue and rolling totals
- DiminishedReturnsCache: UUID-keyed server-side cache that keeps DR
  state alive across disconnect/reconnect to prevent window bypass

Fixes a bug where evictExpired() would remove fresh states that had
never registered any XP, orphaning the PlayerProfile reference and
allowing reconnects to bypass the DR window.

DR tracking is now skipped entirely (no state mutation) when the
diminished returns config option is disabled.

Fixes #3475. Fixes #3814.
(commit: 3fb1369)
The file was addedsrc/main/java/com/gmail/nossr50/datatypes/experience/DiminishedReturnsState.java
The file was modifiedsrc/main/java/com/gmail/nossr50/datatypes/experience/SkillXpGain.java (diff)
The file was modifiedsrc/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java (diff)
The file was addedsrc/main/java/com/gmail/nossr50/datatypes/experience/DiminishedReturnsCache.java
The file was modifiedsrc/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java (diff)
The file was addedsrc/test/java/com/gmail/nossr50/datatypes/experience/DiminishedReturnsCacheTest.java
Commit 3a69634a3392781d22b3fcb63ef223b9d139c3df by nossr50
Fix pre-existing test failures and improve Docker test skip mechanism

- FishingTreasureConfig.fixMooshroomEntityId was a public static method that
  called mcMMO.p.getLogger() directly, causing NPE when tests invoked it without
  a live plugin instance. Add a private static Logger field and use it in the
  static method instead.
- TridentsTest.impaleDamageBonusShouldMatchRankOneBaseDamage had a stale expected
  value (1.0) left over from before commit 71868d9d fixed the Impale formula to
  use rank * multiplier. The correct expectation for rank 1 is
  base + 1 * multiplier = 1.5. Rename the test to match the new semantic.
- Add @Tag(docker) to FlatFileDatabaseManagerTest so the existing
  skip-docker-tests Maven profile (-DskipDockerTests=true) excludes it alongside
  SQLDatabaseManagerTest.
- Add generated config file names (experience.yml, config.yml, etc.) to
  .gitignore to prevent accidental staging when tests run without a properly
  mocked getDataFolder().
(commit: 3a69634)
The file was modified.gitignore (diff)
The file was modifiedsrc/test/java/com/gmail/nossr50/skills/tridents/TridentsTest.java (diff)
The file was modifiedsrc/main/java/com/gmail/nossr50/config/treasure/FishingTreasureConfig.java (diff)
The file was modifiedsrc/test/java/com/gmail/nossr50/database/FlatFileDatabaseManagerTest.java (diff)