Skip to content

fix: log armor stand equipment before it is dropped on break - #395

Open
ShortByte wants to merge 22 commits into
QuiltServerTools:masterfrom
ShortByte:master
Open

ShortByte wants to merge 22 commits into
QuiltServerTools:masterfrom
ShortByte:master

Conversation

@ShortByte

Copy link
Copy Markdown

fix: log armor stand equipment before it is dropped on break

Vanilla calls brokenByAnything, which drops all equipment and empties
every slot, before it calls kill. Logging at the kill call therefore
stored an armor stand whose equipment tag was omitted entirely, so a
rollback brought back an empty stand and the items were lost.

Log at the head of brokenByAnything instead, while the equipment is
still attached, and guard the existing kill hooks so the break is not
recorded twice. The kill hooks still cover the paths that skip
brokenByAnything (creative players, damage bypassing invulnerability).

@ShortByte
ShortByte requested a review from a team as a code owner September 6, 2026 11:33
Leon Enneken and others added 13 commits September 27, 2026 16:39
Inventory#dropAll and EntityEquipment#dropAll spawn the death drops
directly via Level#addFreshEntity instead of going through Player#drop,
so they were never logged. Hook both and log them as regular item drops.
Each result line read from the database gets a clickable [R] that rolls
back just that action. The click is handled server-side and re-checks
the ledger.commands.rollback permission.
Items that reach the end of their lifetime are now logged as item-despawn
with the source @DeSpawn. Rolling one back respawns the item with its age
reset, so it does not despawn again on the next tick; restoring removes
it again.
Rolling back item-despawn actions now needs
ledger.commands.rollback.item-despawn (default level 4). Without it,
despawns are excluded from rollbacks and rollback previews, and asking
for action:item-despawn explicitly fails with an error.
# Conflicts:
#	src/main/resources/data/ledger/lang/de_de.json
#	src/main/resources/data/ledger/lang/en_us.json
When a player's tool, weapon or worn armor runs out of durability it is
logged as item-break. Rolling it back drops the item where it broke with
one durability left; restoring removes it again.
# Conflicts:
#	docs/actions.md
#	src/main/kotlin/com/github/quiltservertools/ledger/actionutils/ActionFactory.kt
#	src/main/kotlin/com/github/quiltservertools/ledger/registry/ActionRegistry.kt
#	src/main/resources/data/ledger/lang/de_de.json
#	src/main/resources/data/ledger/lang/en_us.json
Leon Enneken and others added 8 commits October 14, 2026 21:57
The [R] button on search and inspect results is now only appended when
the viewer has ledger.commands.rollback. The click handler still checks
the permission on its own.
Despawn entries only get the [R] button when the viewer also has
ledger.commands.rollback.item-despawn.
Taking a renamed item out of an anvil is logged as item-rename at the
anvil's position, with the item's name before and after. Repairs and
enchantments that keep the name are not logged. The action is log-only:
the item can be anywhere by now, so it has no rollback or restore.
Lava flowing down into water turns it into stone through
LavaFluid#spreadTo, which skips LiquidBlock#shouldSpreadLiquid where
cobblestone and obsidian are logged. Log it there as a fluid block place
as well.
The player stored on use was never cleared, and LeverBlock/ButtonBlock
are shared by every placed lever and button. A later pull or press
without a player, e.g. by a wind charge, was logged as the player who
last used any lever or button.
Wind charges open doors, trapdoors and fence gates, flip levers, press
buttons and blow out candles. Each hit that leaves the block in a
different state is now logged as a block change with the charge as
source and its thrower as player. The trapdoor and candle hooks skip
these hits so they are not logged twice.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant