GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add atomic player-stack replacement with XP-level debit · Issue #51 · devmogged/moddedMC-rust

Add atomic player-stack replacement with XP-level debit #51

New issue
Copy link
New issue
Copy link
Todo
Todo
Add atomic player-stack replacement with XP-level debit#51
Copy link
Assignees
Noel-Alex

Description

@Noel-Alex
Noel-Alex
opened on Nov 27, 2026
Issue body actions

Proposal (maintainer approval required)

Add an append-only moddedmc:player_stack_data ABI extension that atomically replaces a uniquely identified one-count player item stack's mod data/lodestone target while debiting XP levels exactly once.

Intended contract

  • Preserve the existing V1 prefix and append a size-negotiated V2 function; older hosts must fail closed for paid actions.
  • Match exactly one stack across main inventory and offhand using item ID, count=1 and complete expected mod-data bytes. Missing, duplicate, stale or malformed matches do nothing.
  • Validate the replacement/target before mutation. Debit XP and replace the stack as one host-owned transaction; insufficient levels, stale preimage, lock contention or any failure leave both inventory and XP unchanged. Creative players pay zero.
  • Avoid lock inversion with menu/enchant/anvil XP writers; sync the changed hand slot only after commit.
  • Requires a Pumpkin-fork ry_with_experience_debit primitive or equivalent reviewed transaction fence; this is an engine change and must follow the Pumpkin fork workflow.

Why

Compass paid-search/teleport flows need to charge XP without the old read-then-write race. Clean-main Compass draft PR #45 currently fails compilation because PlayerStackDataDebit and
equire_player_stack_data_debit are absent from origin/main; the shared dirty checkout contains a prototype but it is mixed with unrelated work and must be reconciled.

Acceptance

  • Maintainer approval here before public ABI/engine changes are delivered.
  • Tests for exact single match, duplicate matching stacks, offhand, stale preimage, insufficient XP, creative zero-cost, lock contention and concurrent XP writers.
  • Forced failure at each mutation boundary proves either both stack+XP change or neither.
  • Current-main API/host/Pumpkin build, clippy and paid-search scenario pass; artifact identity and logs recorded.
  • Document the V1/V2 compatibility boundary and ensure the mod checks full table size before calling V2.

No direct push to the Pumpkin fork or ABI merge without approval. Preserve the existing shared dirty checkout; isolate the API/host/Pumpkin slice only after approval.

Activity

  1. Noel-Alex
    self-assigned this
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Noel-Alex
    Noel-Alex

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.