Commit Graph

305 Commits

Author SHA1 Message Date
TheDarkSword
2d7cf40761 feat: persist item components that were only set at runtime (#2426)
* feat: persist runtime-set item components

They serialized to nothing before; give the remaining ones a read/write so
their data survives a save/load. Predicate-based ones keep raw NBT for now.

* refactor: remove Cow where unnecessary

Copied it over from ItemModelImpl, but it makes no sense for base_color,
note_block_sound and tooltip_style: they're only ever built at runtime, so a
plain String is enough.
2026-07-25 09:29:46 +02:00
Megalith
f676bdd222 fix(protocol): remap particle IDs for older clients (#2451)
* feat(protocol): generate particle ID remap tables

Generate version-specific particle registry mappings from the existing ViaBackwards data for every supported Java protocol version.\n\nExpose the generated remapper through pumpkin-data and enable it for pumpkin-protocol so packet serializers can translate current registry IDs for older clients.

* fix(protocol): remap explosion particles for older clients

Translate the explosion particle registry ID for each client's negotiated Java version before serializing the explode packet.\n\nWithout this remap, 1.21.11 interpreted the 26.2 explosion-emitter ID as falling dust, consumed the following bytes as particle data, and disconnected with a decoder exception. Add packet-level coverage for both 1.21.11 and 26.2 encodings.

* fix(protocol): remap particle IDs for older clients

Level-particle packets and particle entity metadata still encoded raw 26.2 registry IDs, causing older clients to decode the wrong particle schema and disconnect. Route every active outbound particle path through the version remapper, preserve metadata payloads, and cover 1.21.11 and 26.2 encodings with regression tests.
2026-07-24 18:14:18 +02:00
Alexander Medvedev
37bed1c8b5 feat(command): add fillbiome command 2026-07-14 19:19:03 +02:00
Alexander Medvedev
486f8d2cfe feat(command): add attributes 2026-07-13 18:43:45 +02:00
BitForge
f13736def9 fix(loot): animals drop cooked food without fire or Fire Aspect (#2391)
* fix(loot): animals drop cooked food without fire or Fire Aspect

Fix issue #2366 where farm animals dropped cooked meat instead of raw
when killed, regardless of fire state or weapon enchantments.

Root cause: LootCondition::EntityProperties lacked predicate fields for
is_on_fire and equipment enchantments, codegen discarded predicate data,
and the evaluator did not resolve 'direct_attacker'.

- Add is_on_fire and mainhand_enchantment_tag to EntityProperties
- Add predicate structs to codegen with correct serde renames
- Fix evaluator to resolve direct_attacker and check fire/enchantments
- Fix pre-existing v[0] panic on empty StringOrVec arrays
- Add 18 unit tests

* fix(loot): add backticks to doc comment for clippy

* fix(data): update block.rs generated loot tables with new EntityProperties fields

* fix(loot): merge match arms and collapse if for clippy
2026-07-11 18:17:19 +02:00
Alexander Medvedev
af3376e68e feat: Implement missing data components 2026-07-11 11:04:51 +02:00
Alexander Medvedev
9eab7581fd feat: Implement Profile data component 2026-07-10 18:16:30 +02:00
Alexander Medvedev
47fe060665 fix: rust 1.97 lints 2026-07-09 20:39:01 +02:00
Alexander Medvedev
339d9dde5b feat: add bedrock biome mappings 2026-07-08 17:30:55 +02:00
Alexander Medvedev
44fd621294 fix: bedrock block mappings 2026-07-06 21:49:42 +02:00
ChocoDev
da2401d07d feat: aquifer sample and top material in cave carver (#2242)
* sin/cos util

* 4 nieghbor check

* formating

* air helper

* carver wrapper

* fmt

* clippy

* clipp2

* remove local y

* out of bound guard

* fluid tick

* surface rule

* wire up

* math correct

* start fix

* bring back xoroshiro oops

* scheduler guard

* simplify test

* clean test

* comment

* crash fix

* clippy

* clippy

* i hate you codex

* sin cos

* im stupid f32
2026-07-05 15:55:43 +02:00
Red
28d6450426 fix: Made (CUSTOM_)NAME_VISIBLE work across versions (#2332) 2026-07-04 12:14:29 +02:00
Niclas
0800ed8878 feat(plugin-api): add namespaced custom item data (#2324)
* feat(plugin-api): add namespaced custom item data

* modified: pumpkin-plugin-wit

* feat(plugin-api): add NBT custom item data

* fix(plugin-api): satisfy clippy for NBT tree conversion

* feat(plugin-api): add NBT custom item data

* test(plugin-api): use neutral custom data fixtures

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-07-04 09:50:06 +02:00
Alexander Medvedev
a9f69fea01 chore: enforce clippy lints in pumpkin-world 2026-07-03 18:51:47 +02:00
PigTurtle
7bfc6a6737 refactor(data) BlockId and BlockStateId wrapper types (#2328)
* refactor: less manual BlockMetadata impls

* refactor: added BlockId type

BlockId is a wrapper for u16: it is valid for any u16 that is the id of a Block.
- Changed the Block.id field type to BlockId
- added named BlockId constants
- BlockMetadata::ids() now returns Box<[BlockId]>
- adjusted pumpkin-macros to use BlockId constants
- fixed some methods that were comparing blockstate ids or item ids (u16) against block ids (previously u16)

TODO: check if unsafe blocks can be removed; The compiler might understand that BlockId is always a valid index into mappings::TYPE_FROM_RAW_ID

* refactor: added BlockStateId type

A BlockStateId is a safe wrapper around the numerical index of a BlockState in pumpkin-data. They help avoiding validity checks (outside of IO and, currently, plugins), and make it easier for other contributors to reason about what they're comparing; BlockStateIds, BlockIds or Item ids (still u16).
pumpkin-data::BlockStateId replaces RawBlockState and BlockStateId from pumpkin-world.

- added the BlockStateId wrapper type
- made (almost; plugins) every function interacting with block states or block state ids use the wrapper type
- changed codegen logic to create/work with BlockStateIds
- made ChunkPalette parsing check BlockStateId validity (pumpkin-world::chunk::format::ChunkSectionBlockStates)

TODO: check if unsafe blocks can be removed; The compiler might understand that BlockStateId is always a valid index into mappings::BLOCK_ID_FROM_STATE_ID and mappings::STATE_FROM_STATE_ID

* refactor: imports
changed every use pumpkin_world::BlockStateId to pumpkin_data::BlockStateId

* refactor: Block- & BlockStateId

finishing touches;
- rebased on latest mater
- ensure there are no bound checks on Block(State)Id conversions, making them extremely cheap
  - this required unsafe std::hint::assert_unchecked annotations because the compiler is (occasionally) stupid
  - on debug builds the bound checks still exist because of ub_checks (see rust unstable book for the feature of the same name)
- added Safety notes to hopefully prevent anyone from enabling the creation of invalid Block(State)Ids in the future

- fixed a benchmark
2026-07-01 18:05:05 +02:00
ZlordHUN
395c4aa36b feat(generation): implement ancient city jigsaw structures (#2329) 2026-07-01 09:11:47 +02:00
ZlordHUN
5eb7cc0e81 feat: Add Overworld Fossil Generation (#2319) 2026-06-30 19:08:44 +02:00
Alexander Medvedev
efa97ad174 fix: https://github.com/Pumpkin-MC/Pumpkin/issues/2283 2026-06-28 16:18:49 +02:00
kedor
0eb7cb1a79 fix(advancement): Fix advancement tree and visibility (#2304)
* fix visibility evaluator

* fix a small issue with the placement of advancement
2026-06-27 20:42:35 +02:00
Alexander Medvedev
03a90a40b1 chore: expand loot table 2026-06-27 10:35:46 +02:00
Alexander Medvedev
322b7af6ae chore: made tnt explosion bit faster 2026-06-26 21:43:00 +02:00
kedor
39596c1b9f feat: Advancement command (#2282)
* starting implementing the advancement command

* implementing globally of the advancement command

* fixing lib.rs

* implementing the new Advancement argument and updating the AdvancementArgs lifetime

* updating wit by adding advancement as command arg

* cargo fmt

* fixing the advancement
hooking the saving
spawn blocking task for IO task

* fixing the update of load to be async

* adding await to load for a test

* fix when save is disable

* making save_enable check first

* fix conflict

* update hash

* fix wit change

* fix column_pos

* adding rust documentation

* typos fix

* removing example

* invalid advancement packet

* fix itemstack parsing to use ItemStack Template ones

* changing enum type from i32 to VarInt

* fix packet by switching up the frame type and flags

* fixing packet and loading of the advancement

* cargo clippy

* update wit
2026-06-26 09:23:54 +02:00
Niclas
2fa7a1829b fix(protocol): encode and decode renamed item names (#2301) 2026-06-25 17:44:11 +02:00
kedor
ed0bf820f7 feat: Add the display position calculation of the advancements (#2256)
* generate the placement of the advancements to be display rightfully for the client

* fix typos with appropriate naming
2026-06-24 18:20:12 +02:00
PigTurtle
eaf1bf3cbe fix(compile-times) replaced const arrays with statics (#2281)
the const [&T; 29873]s for block(state) mapping were being inlined ~300 times just to be deduplicated by LLVM.
They are now statics but are accessed via const fns.
This improves compile times by roughly 12 minutes.
2026-06-24 18:11:37 +02:00
Alexander Medvedev
d0d760de6a fix: bedrock 26.30 2026-06-24 18:03:08 +02:00
Alexander Medvedev
5f60d23804 feat: villager Professions 2026-06-21 21:54:10 +02:00
Alexander Medvedev
23e7992b2d Port to 26.2 2026-06-20 20:07:31 +02:00
Alexander Medvedev
8ce76261ac feat(bedrock): add creative content 2026-06-19 18:52:50 +02:00
kedor
fb3b146fdd feat: add advancement progress (#2261)
* implementing the advancement progress so each advancement has certain requirements to be mark has complete

* cargo fmt

* fix test

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-06-15 14:50:12 +02:00
Alexander Medvedev
68bae5899e feat: add stats 2026-06-12 20:55:29 +02:00
kedor
fda79cbc41 feat: adding barebone advancement codegen (#2251)
* implementing the barebone generation of

* cargo fmt

* fixing CI

* fixing unused import

* updating advancements.json file

* remove useless modification for identifier.rs

* fixing CI and typos

* remove bad modification

* update pumkin-plugin-wit
2026-06-12 07:07:10 +02:00
Alexander Medvedev
5b8eab0f56 feat: initial village support 2026-06-10 23:07:10 +02:00
Alexander Medvedev
dd524b6ef9 Revert "feat: implementing the base generation of advancement (#2236)"
This reverts commit decfc460b2.
2026-06-09 16:49:14 +02:00
kedor
decfc460b2 feat: implementing the base generation of advancement (#2236)
* implementing the barebone generation of

* cargo fmt

* fixing CI

* fixing unused import

* updating advancements.json file
2026-06-09 16:00:37 +02:00
Demetrius Kanios
2283048b9b feat(bedrock): Initial inventory setup (#2215)
* Initial asset prep, and `CItemRegistry` packet (vanilla; no Java fixes).

* Fix definition component NBTs.

* Packet fixes and dummy stick.

* Map actual player inventory & add stack UIDs

* Cleanup

* Update assets README
2026-06-07 07:59:06 +02:00
Nicolai Van der Storm
42f6b9ce3f fix(protocol): remap item/block state IDs and entity metadata for older Java clients (#2185)
* 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>
2026-05-27 15:22:17 +02:00
Alexander Medvedev
bd544271e2 feat: more loot table work 2026-05-22 22:23:47 +02:00
Laptop59
fd0539c2a7 feat(command): slot argument types (#2170)
* argument types implemented

* tested parsing in-game and on the terminal

* fixed doc comment
2026-05-22 16:30:26 +02:00
Alexander Medvedev
d47ac2cd51 feat(loot-table): add luck 2026-05-21 22:20:00 +02:00
Alexander Medvedev
2fcc9bcf4a chore: enforce some more clippy lints
pumpkin contributors will love me :cap:
2026-05-20 22:27:54 +02:00
Alexander Medvedev
330a68054f chore: replace String with ConfiguredFeatures enum 2026-05-19 20:19:46 +02:00
Alexander Medvedev
c7a9d5935a chore: replace String with PlacedFeatures enum 2026-05-19 20:08:58 +02:00
Demetrius Kanios
81f9f51d39 feat: Implement Bedrock NBT (network variant) (#2148)
* Implement Bedrock (Network) NBT

* Refactor to reduce dup between Java and Bedrock impls.

* Add tests, fuzzers, and benchmarks for Bedrock
2026-05-18 21:46:29 +02:00
Alexander Medvedev
d3d13323b2 fix: don't store empty chunks
should be fixed
2026-05-17 13:47:34 +02:00
Alexander Medvedev
e2ff17d6f0 feat(plugin-api): allow to register custom recipies 2026-05-16 20:56:29 +02:00
Alexander Medvedev
966fbec3d3 feat(plugin-api): add java/bedrock abstraction 2026-05-16 09:56:18 +02:00
Alexander Medvedev
5aafff35e8 feat: add bedrock forms 2026-05-15 18:24:28 +02:00
RB007
b2b10f3323 feat: chest loot tables (#2084)
* feat: add vanilla chest loot table json files

* feat: codegen and chest loot logic

Co-authored-by: Copilot <copilot@github.com>

* fix: monster_room loot chests

* fix: nether_fortress loot chests

* fix: shuffle item stacks and fmt/clippy

Co-authored-by: Copilot <copilot@github.com>

---------

Signed-off-by: Alexander Medvedev <lilalexmed@proton.me>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-05-15 08:43:51 +02:00
AurelienFT
ed3465b75c feat: Add root placement for mangrove trees (#2137) 2026-05-15 08:39:41 +02:00