Skip to content

Changes

Started 2 days 6 hr ago
Took 1 min 42 sec on Builder

Summary

  1. Verify multi-block plants actually break before paying Herbalism XP (commit: 3a71157) (details)
Commit 3a711577530dc539787bfaf68770717b515018f1 by nossr50
Verify multi-block plants actually break before paying Herbalism XP

Vanilla destroys the rest of a bamboo, sugar cane, kelp, cactus,
chorus, or hanging vine plant with scheduled block ticks on later
ticks, cascading one block per tick. XP for the whole plant was paid
during the BlockBreakEvent, so breaking a segment and instantly
replacing it collected XP for blocks that never broke.

The rest of the plant is now claimed by a per-tick verification task
that only pays XP for blocks that are verifiably gone (air, or water
for waterlogged plants) once the collapse window elapses. Positions
can only be claimed by one task at a time and claims are revoked when
a new break event takes over a position, so no block is paid twice.

This also revives XP for cactus and chorus columns: their traversal
was aborting immediately because the origin block pre-seeded the
visited set, so connected blocks never paid XP at all.

Fixes #5311
(commit: 3a71157)
The file was modifiedsrc/main/java/com/gmail/nossr50/runnables/skills/DelayedHerbalismXPCheckTask.java (diff)
The file was modifiedChangelog.txt (diff)
The file was modifiedsrc/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java (diff)
The file was modifiedsrc/main/java/com/gmail/nossr50/mcMMO.java (diff)
The file was addedsrc/test/java/com/gmail/nossr50/skills/herbalism/HerbalismMultiBlockPlantXpTest.java
The file was addedsrc/main/java/com/gmail/nossr50/runnables/skills/PlantCollapseXpTask.java