Make `syn`, `quote`, and `proc-macro2` optional in pumpkin-util,
exposing them via a new `codegen` feature. `pumpkin-codegen` opts in
explicitly, so downstream consumers no longer pay the proc-macro
build cost when they don't need `ToTokens` impls.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* to be completed
* removed block state parser for now
* gamemode argument type
* plugin wit submodules
* fixed submodules
---------
Co-authored-by: Missing_Love <42416195+Q2297045667@users.noreply.github.com>
remaining() and remaining_lowercase() at suggestions.rs:39,45 perform an
unbounded slice &self.input[self.start..], which panics with:
'start byte index N is out of bounds for string of length M'
when the start position exceeds the input string length.
This was reachable via:
- The console completer passing cursor position unadjusted for the
stripped '/' prefix
- create_offset() constructing a builder with start > input.len()
- entity_selector parser's builder.start - 1 underflowing when
start == 0
Changes:
- Clamp start to input.len() in remaining() and remaining_lowercase()
so an empty string is returned instead of panicking
- Use saturating_sub(1) in entity_selector parser to prevent
debug-mode underflow when start is already 0
* fix: broadcast item pickup packet instead of only sending it to the collector player
* fix it for shot arrows too.
* fix: clippy warning
---------
Co-authored-by: Missing_Love <42416195+Q2297045667@users.noreply.github.com>
* fix(protocol): remap item/block state IDs and entity metadata for older Java clients
The server was using reversed ViaVersion mappings (designed for old→new)
to downgrade packets for older clients, which produced ID collisions and
incorrect fallbacks for 26.1-exclusive items and block states.
Changes:
- Replace ViaVersion with ViaBackwards mapping files for item ID and
block state remapping, which provide the correct new→old direction
with proper closest-item fallbacks for 26.1-exclusive content
- Fix CSetEntityMetadata to remap ItemStack item IDs per client version,
matching the version-aware handling already done for inventory packets
and block state metadata
- Fix TrackedData codegen to resolve Java JSON keys correctly by trying
both bare names and DATA_-prefixed names, and iterate the union of all
version keys instead of only the latest (Bedrock) version
- Fix LootCondition::MatchTool to default to false instead of true,
preventing silk-touch loot table branches from always winning and
causing ores to drop themselves instead of their correct items
Fixes: block drops invisible on older Java clients
Fixes: leather showing as milk bucket on 1.21.11
Fixes: coal ore dropping coal ore instead of coal
Fixes: 26.1-exclusive blocks showing as wrong blocks on older clients
* fix(codegen): remove #[must_use] from trait impl methods in generated code
* fix(codegen): switch entity, sound and block state remapping to ViaBackwards mappings
---------
Co-authored-by: Missing_Love <42416195+Q2297045667@users.noreply.github.com>
changed return value from `String` to `Box<str>` which is smaller and makes more sense since we don't mutate packet data
String — 24 bytes (ptr + len + capacity)
Box<str> — 16 bytes (ptr + len)
* Fix chunk save/load corruption and generation stage progression
- Fix serde rename mismatch: ChunkSectionNBT now uses PascalCase
to match serialization, restoring block_states and biomes on load.
- Correct generation stage order: Biomes before StructureStart,
add missing Carvers stage.
- Add stage guards in Cache::advance to avoid re-running completed
stages, preventing assertion panics.
- Set ProtoChunk::stage from saved ChunkStatus in from_chunk_data,
ensuring loaded chunks start at correct stage.
* using propper asserts instead of silent skips
* using StagedChunkEnum::Empty instead of None
* feat(plugin-api): add ServerTickEndEvent
Add a non-cancellable event fired at the end of every server tick,
carrying the 0-indexed tick number and the tick duration in nanoseconds.
Wires through all five layers: WIT contract, plugin-api guest binding,
runtime host struct, WASM bridge, and the ticker fire site.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix ci/ fmt
* chore: point pumpkin-plugin-wit submodule to fork with server-tick-end-event
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Revert submodule
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>