Commit Graph

194 Commits

Author SHA1 Message Date
RB007
b3fc910579 fix: lava and fire behavior (#1509)
* fix: item burning (except netherite), proper lava damage, and eliminate ghost lava

* fix: soul fire damage

* fix: fire spreading behavior

* chore: clippy and formatting

* fix: add on_entity_step for magma block damage

* chore: clippy and formatting

* fix: remove item.rs edit and hardcode is_fire_immune for now

* fix: compare biome ids and restore a fn name

* fix: god mode gamerule hack

* feat: DamageResistantImpl

* refactor: remove campfire damage fixes

* refactor: shared fire collision fn

* fix: typos

* fix: i did now 💀

* fix: gamerule and fire resistance now prevent magma block damage

* fix: fire_damage gamerule only for players

* fix: better on_entity_step detection (block edges)

* fix: on_entity_step now fires with bool flag (for detection under non-solid blocks)

* fix: rip

* fix: infiniburn tags and damage

* fix: send_pos_rot

* fix: restore adjust_movement_for_collisions logic and fmt

---------

Signed-off-by: RB007 <36972202+RoosterBooster007@users.noreply.github.com>
2026-02-17 22:49:58 +00:00
Richard Marshall
b77d9c1b4d feat: complete boat implementation (#1440)
* feat: implement boat placement

- add boat item handler for all boat/raft types
- raycast with fluid handling to place on water or blocks
- filter entities with can_hit predicate (vanilla parity)
- check space is empty before spawning
- decrement item unless creative mode

* feat: add boat entity with damage handling

- create BoatEntity struct implementing EntityBase
- implement can_hit() and is_collidable() for boats
- implement damage handling that drops boat item on destroy
- update boat item to spawn BoatEntity instead of generic Entity

* fix: boat damage wobble and attack sounds match vanilla

Boats now accumulate damage with wobble animation that decays over time.
Attack sounds play for all hittable entities, not just living entities.

* feat: add boat riding and vehicle movement packets

* feat: complete boat implementation matching vanilla

- add underwater check (60 ticks) and max 2 passengers limit
- add paddle animation metadata and handler
- implement proper land dismount with offset calculation
- add riding_cooldown field to entity

* fix: clippy warnings for boat implementation

* refactor: use loot tables for boat item drops

* fix: collapse nested if to satisfy clippy

* style: fix cargo fmt formatting for collapsible if

* fix: boat dismount places player correctly beside vehicle

- implement vanilla's dismount position calculation with
  getDismountHeight, canDismountInBlock, and pose fallback
  (standing → crouching → swimming)
- fix packet ordering race: use enqueue_packet for teleport so it
  arrives after CSetPassengers (send_packet_now bypassed the queue)
- pre-set awaiting_teleport before CSetPassengers to block stale
  movement packets during async dismount calculation
- send CSetPassengers directly to dismounting player, broadcast to
  others (matching vanilla's targeted packet behavior)
- use DELTA|ROT position flags for teleport (vanilla preserves
  current look direction with relative rotation)
- add riding cooldown (60 ticks) to prevent immediate re-mount
- reset sneaking state after player dismount
- fix water detection to check specifically for water/flowing_water
  fluids (Fluid::from_state_id returns EMPTY for air blocks)
- revert broken loot table refactor for boat item drops (boats use
  hardcoded entity-to-item mapping, not loot tables)
- add get_dismount_height helper on World matching vanilla's
  BlockView.getDismountHeight()
- ignore movement packets while awaiting teleport confirmation in
  handle_position and handle_position_rotation

* style: fix cargo fmt formatting

* refactor: use loot tables for boat item drops

add loot table entries to entities.json for all 20 boat/raft types
and use the existing loot table system instead of hardcoded mapping.

* fix: resolve rebase conflicts and clippy warnings

* fix: regenerate codegen to include boat loot tables
2026-02-17 19:47:49 +00:00
RB007
fb0750c342 fix: inventory saving/loading (#1582)
* fix: inventory saving

* fix: potion NBT schema

* fix: firework NBT schema

* fix: different fireworks won't stack now

* chore: formatting

* fix: restore hopper TransferCooldown saving

* fix: use filter_map

* fix: firework duration default

* fix: proper is_dirty support

* fix: add clear_dirty overrides and remove double furnace mark_dirty
2026-02-17 03:17:54 +00:00
Richard Marshall
6e1bea72b7 fix: resolve multiple fluid flow bugs (#1561)
* fix: resolve multiple fluid flow bugs

- Fix from_state_id overlapping ranges so WATER/LAVA source blocks are
  correctly identified instead of always returning FLOWING variants
- Fix is_source always being false (was checking level==0 instead of is_still)
- Fix waterlogged blocks getting garbage fluid properties
- Fix lava receive_neighbor_fluids checking above instead of below
- Remove incorrect falling-to-non-falling quiescence guard in apply_spread
- Fix flow_to_sides TOCTOU by passing props from caller
- Add matches_type/same_fluid_type/to_flowing helpers for fluid type matching

* fix: check all 6 directions in lava receive_neighbor_fluids

Vanilla checks all directions (including Up) for water interaction.

* fix: clippy overlapping arm and redundant closure lints
2026-02-16 13:10:06 +00:00
Ksawier Wilczynski
501eb25ec3 feat(fireworks): implement firework data components (#1548)
* feat: implement firework data components

* Fix: Cargo Fmt

* Fix: Update color to i32 and add color limits

* Fix: Check firework flight time is within NBT limit

* fix: cargo fmt

* fix: clippy
2026-02-15 16:20:26 +00:00
Rorical
b22e66768a fix: preserve protocol ordering for sound event IDs (#1533)
* fix: preserve protocol ordering for sound event IDs in codegen

The Sound enum variants were sorted alphabetically, causing every
sound ID sent via the protocol to mismatch the client's expected
registration order. Only sort the LOOKUP table for binary search;
keep enum variants in the original sounds.json order.

Closes #1532

* chore: regenerate sound.rs with protocol-correct ordering
2026-02-12 00:04:24 +00:00
Alexander Medvedev
f60a77c5d9 chore: decrease compile time
Instead of parsing pumpkin-data for everyone who compiles lets have it as static files, pumpkin-codegen is a standalone parser now
2026-02-09 15:52:46 +01:00
Alexander Medvedev
b0ab5006ca chore: remove unused deps
also apply some clippy lints in some places
2026-02-09 00:07:39 +01:00
ChocoDev
cef8a024e7 feat: BlockState Remaping (#1457)
* vn translation

* feat: blockstate remapping

* formatting cleanup

* damm dot

* damm comma

* fix: mapping 1.21.8 tracker

* fix: entity metadata

* formatting

* clippy

* fix: item id remap

* formatting
2026-02-08 14:24:16 +01:00
Alexander Medvedev
e45ab613f4 chore: parse translations at compile time
not finished but its much safer and nicer now
2026-02-08 13:22:36 +01:00
Laptop59
3e82875e4f feat: add string reader from Brigadier and its errors (#1427)
* added StringReader and its errors

* fixed clippy errors in tests

* removed unnecessary '_ from &

* removed unnecessary `Box`

* removed Simple and Dynamic error types in favor of one struct and changed size of `TextComponent`

* formatted with `cargo fmt`

* fixed spelling error

* removed unnecessary (default) leftover from experimentation
2026-02-07 21:52:45 +01:00
Richard Marshall
042e12d026 fix: jukebox now properly handles music discs (#1438)
* fix: jukebox now properly handles music discs (#568)

- Add JukeboxBlockEntity for disc storage and playback tracking
- Disc is removed from player inventory when inserted
- Disc drops when player right-clicks to retrieve it
- Disc drops when jukebox is broken
- Redstone power output (15 when playing, 0 otherwise)
- Comparator output varies per song (vanilla values 1-15)
- Playback auto-stops when song finishes

* refactor: use synced registries for jukebox song data

* replace indexmap with btreemap per clippy.toml policy

* fix import ordering for cargo fmt
2026-02-07 12:07:56 +01:00
Alexander Medvedev
53803c5e94 feat: add infested blocks & silverfish spawn
ofc also includes a bunch of other things like i always do :D
2026-02-05 19:34:04 +01:00
Clicks
51f1152403 fix: warnings about the use of hashmap instead of btreemap in pumpkin-data (#1443) 2026-02-05 18:03:15 +01:00
Purdze
6649d80ca7 feat: add furnace xp system (#1436)
* fix: award xp when taking items from furnace output slot

adds experience tracking to all furnace-like block entities (furnace,
blast furnace, smoker). experience is accumulated when items are smelted
and awarded to the player when they extract items from the output slot.

- add ExperienceContainer trait for dyn-compatible xp extraction
- add experience_held field to furnace block entities (fixed-point)
- add FurnaceOutputSlot that awards xp on item take
- add award_experience method to InventoryPlayer trait
- add to_experience_container method to BlockEntity trait

closes #1432

* fix: use recipesused nbt format for furnace xp

- add recipe_id field to CookingRecipe struct
- track recipes used instead of raw xp
- spawn xp orbs on furnace break and hopper extraction
- add get_recipe_experience function to look up xp by recipe id

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-02-04 18:07:13 +01:00
Alexander Medvedev
2a0d2f1cf3 chore: move structure settings from runtime to compile time parsing 2026-02-04 17:13:50 +01:00
Alexander Medvedev
cb6cb149bc ci: fix clippy
-_-
2026-02-03 23:51:53 +01:00
Alexander Medvedev
835262a85a chore: move chunk gen settings from runtime to compile time parsing
Bin size decreased, Startup time decreased by a lot in debug, lower memory usage
2026-02-03 23:35:31 +01:00
Purdze
2f29fcef8d fix: implement powder snow freeze effect and damage (#1390)
* fix: implement powder snow freeze effect and damage

- add frozen_ticks field to track freeze duration
- send DATA_FROZEN_TICKS metadata to clients for visual effect
- freeze ticks increase by 1/tick in powder snow, decrease by 2/tick outside
- deal 1 freeze damage every 40 ticks when fully frozen (140 ticks)
- add freeze immunity for snow golems, strays, polar bears, wither, wither skeletons

* fix: use freeze_immune_entity_types tag instead of hardcoded checks

* use has_tag method for freeze immunity check
2026-02-03 14:21:48 +01:00
FabseGP
cccf8dc2b0 ci: detect unused dependencies in CI + rearrange CI-steps (#1419)
* chore: detect unused dependencies

* fix: exclude phf in pumpkin-data

* fix: combine CI-steps and fail earlier

* fix: use cargo-nextest + split clippy-steps
2026-02-02 12:37:36 +01:00
Bjorn Beishline
441040105b chore: add sounds variants slice (#1420) 2026-02-01 16:31:12 +01:00
Ashank Sundaram
ed318c94c4 chore: Add block type helper methods (#1421) 2026-02-01 14:03:43 +01:00
Alexander Medvedev
be322123cf chore: make chunk gen usable in debug mode 2026-01-30 00:57:55 +01:00
Alexander Medvedev
7d63253a87 fix: fmt 2026-01-29 11:54:57 +01:00
Alexander Medvedev
35e4d6b04d fix: import 2026-01-29 11:47:10 +01:00
Purdze
676e7e2f65 fix: implement potion_contents data component to prevent crashes (#1387)
implements the minecraft:potion_contents data component which was causing
server crashes when players clicked on potions or tipped arrows in creative
mode

fixes #1309
2026-01-29 11:38:28 +01:00
Alexander Medvedev
b58822319d fix: CI 2026-01-28 23:40:48 +01:00
Alexander Medvedev
fb13004b47 fix: apply clippy lints to workspace
also add contributors to /pumpkin command

Co-Authored-By: Fyor <90567841+fyordev@users.noreply.github.com>
Co-Authored-By: MartV0 <34748938+martv0@users.noreply.github.com>
Co-Authored-By: FabseGP <fabsegp@fabseman.space>
2026-01-28 00:52:47 +01:00
Alexander Medvedev
ac4c85192f chore: less ugly code
and less allocations
2026-01-26 22:23:58 +01:00
Alexander Medvedev
186ad2edea feat: 1.21.7-1.21.11 support
Its works, but block state ids are currently not mapped, meaning that when using the current default world gen the client mostly will disconnect due to a not found block state id, vanilla version compatible worlds should work
2026-01-25 23:08:28 +01:00
Alexander Medvedev
7eccda00ff fix: bedrock movement
also added a bunch of docs, and fixed bedrock air bubbles constantly shown, and also fix bedrock block states
2026-01-24 22:05:50 +01:00
FabseGP
a04b7036bc chore: some cargo adjustments (#1306)
* chore: strip binaries & define rust-version in workspace

* fix: don't strip binary when profiling

* chore: clippy lints

* fix: use stable fmt

* fix: don't strip dev builds
2026-01-23 15:58:07 +01:00
Felipe Muñoz Mazur
9c70f09360 feat: negates fall damage on certain blocks (#1348)
* remove fall damage when landing on:
- vine
- cobweb
- water
- powder snow
- slime block

solves: #1333

* feat: add fall area detection for certain blocks

* fix: correct spelling in fall damage prevention methods

* style: improve code formatting in fall damage prevention logic

* refactor: rename fall damage prevention methods and improve logic for area detection

* feat: add Powder Snow and Slime blocks with fall damage handling

* feat: player needs additional checks if portal

* chore: fix format for powder_snow

* feat: handle entities immune to fall damage

* chore: fix clippy error
2026-01-22 22:59:36 +01:00
Alexander Medvedev
142296a9b2 feat: 1.21.9-1.21.11 support
more versions will come
2026-01-22 17:16:37 +01:00
Alexander Medvedev
ac021d5d47 chore: more work
- fixed nether again, not the dead lock or whatever it is but the server crash
- further replace Notify with CancellationToken
- fixed chunk loading on inital spawn
- more stronghold work
2026-01-21 23:08:56 +01:00
Jinx
a6a09a9eca feat: implemented item/armor durability (#1343)
* Added durability for items and armor

* Run rustfmt
2026-01-20 19:16:56 +01:00
Alexander Medvedev
afc4cb0cd3 chore: this should speed things up 2026-01-20 18:59:05 +01:00
Clicks
d737b56cbc perf: improve performance of has_random_ticks by 3x (#1296)
* bitsets!

* add benchmark to confirm

* assert same output (this will become outdated on the next version
upgrade)

---------

Co-authored-by: CuzImClicks <cuzimclicks@proton.me>
2026-01-20 12:42:44 +01:00
Alexander Medvedev
ff1f3a0fbd remove: pumpkin-registry
it is gone for good, i made the new registry be parsed from compile time in pumpkin-nbt and even parse the nbt code at compile time as well, And like expected this gives a massive speedup in first time parsing and also decreased bin size
2026-01-15 21:10:18 +01:00
Alexander Medvedev
db486d5572 fix: make item drops fall smooth 2026-01-15 20:29:30 +01:00
Alexander Medvedev
6889399e65 fix: use the correct health for entities 2026-01-14 19:55:34 +01:00
Alexander Medvedev
0555f804e0 feat: guess living entities 2026-01-13 23:36:49 +01:00
Alexander Medvedev
e46459915c feat: Implement fireworks
also fix: https://github.com/Pumpkin-MC/Pumpkin/issues/1217
also includes some bedrock work, but still broken
2026-01-13 19:09:19 +01:00
Alexander Medvedev
ce652860e0 fix nether 2026-01-04 20:28:51 +01:00
Clicks
70b3132396 chore: Remove Redundant Clippy Allows (#1247)
* switch to btreemap to comply with lint

* amplifier i32 -> u8

* switch allow to expect lint

* remove many many unnecessary clippy lints

* dont use expect inside quotes
2025-12-30 12:16:31 +01:00
Clicks
24fff00425 Make All Dependencies Workspace Dependencies (#1245) 2025-12-30 12:13:51 +01:00
AyaSanae
10f19a93da feat: Implement blast furnace and smoker (#1253)
* implment blasting_furnace

* add smoker block entity

* add smoker block

* refactor furnace_block_entity using macros

* fix fmt
2025-12-30 12:10:32 +01:00
Alexander Medvedev
42c903493a port to 1.21.11 2025-12-24 13:09:01 +01:00
Alexander Medvedev
fba4d405ac ci: add Windows Arm and macOS Intel 2025-12-09 19:29:57 +01:00
Alexander Medvedev
92fe87e921 smaller structure gen preparations 2025-12-08 20:52:03 +01:00