feat(plugin-api): add item stack persistent data container v1#1991
feat(plugin-api): add item stack persistent data container v1#1991CompileRider wants to merge 3 commits intoPumpkin-MC:masterfrom
Conversation
this is the first shippable slice of Pumpkin-MC#635 it adds a reusable pdc foundation it exposes ItemStack as the first public owner through v0.2.0 future owners such as Entity remain follow-up work
|
Switching this back to draft for now. After revisiting the implementation, I think there’s a better way to structure parts of this PR, so I want to clean that up before putting it up for full review. |
|
This is a disaster, time for coffee |
The public ItemStack PDC goal does not change in this pass. Reuse the unchanged v0.1.0 host bindings from the v0.2.0 world instead of keeping duplicated v0_2_0 host modules for commands, events, context, gui, scoreboard, text, world, and other unchanged interfaces. This keeps v0.1.0 compatibility intact, leaves ItemStack as the only real owner in v0.2.0, and removes the oversized wrapper churn without adding typed helpers or new owners.
|
~6k lines are going to be a hell to review in one pr, wouldnt it be better to split this up into multiple pr's? |
|
That was a fair concern for the earlier ~6k-line version, and I agreed with it there. After the reduction, I don’t think splitting it further would help much. The remaining size is mostly the additive So I’m keeping it as one draft PR and focusing on making the remaining shape easier to review. |
This keeps the ItemStack PDC feature goal unchanged. It extracts the duplicated player host implementation into a shared internal layer, leaves v0.1.0 and v0.2.0 as thin wrappers, and keeps only the ItemStack resource access delta in v0.2.0. No new owners or typed helpers are added, and the public PDC slice remains Foundation + ItemStack only.
|
I did one more structural reduction pass before taking this out of draft. The main remaining weakness in the reduced branch was that That has now been refactored so the shared player host logic lives in
So although the total diff vs
At this point, the remaining heaviness is mostly the shared implementation itself and the versioned API surface, not duplicated wrapper churn. |
|
There will be no v0.2.0 since there isn't even an official v0.1 release |
I understand |
Problem
Pumpkin plugins currently have no persistent data container support. Issue
#635asks for broad owner coverage, but the current plugin/WASM surface only cleanly exposesItemStackas a first real public owner.This PR ships the first usable slice instead of a foundation-only refactor:
v0.2.0Foundation + ItemStack onlyEntityowner yetWhat changed
pumpkin-data/src/item_stack/mod.rs: adds ItemStack-owned plugin PDC storage and NBT round-trip persistence underpumpkin:plugin_datapumpkin-plugin-wit/v0.2.0/*: adds the additivev0.2.0guest surface plus the newitem-stackresource and PDC methodspumpkin-plugin-api/{Cargo.toml,src/lib.rs}: moves the guest crate onto the new versioned surfacepumpkin/src/plugin/loader/wasm/wasm_host/*: addsv0.2.0host/version dispatch and the ItemStack resource backingCargo.lock: refreshes the workspace lockfile used by this branchTesting
cargo fmt --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p pumpkin-data pdc_ -- --nocapturecargo test -p pumpkin-data item_stack_serialization_round_trips_plugin_data -- --nocapturecargo test -p pumpkin item_stack_resource_mutates_real_owner --no-runitem_stack_resource_mutates_real_ownertest binarycargo audit, lolScope
v0.1.0workingv0.2.0ItemStackEntityand the broader owner matrix for later workPart of #635