Commit Graph

461 Commits

Author SHA1 Message Date
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
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
Starless_Sky
a96eca4f19 feat: Custom Payload (#1536)
* added CCustom_Payload to player.rs 

added CCustom_Payload to the 
pumpkin_protocol::java::client::play:: 
list

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Fire PlayerCustomPayloadEvent on play payload

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Implement SCustomPayload decoding

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Add CCustomPayload packet

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Export custom payload packet

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Add PlayerCustomPayloadEvent

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Expose player_custom_payload event module

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>

* Fixed cargo fmt and clippy

* merged master  into branch

* fix(custom_payload): cap payload size and use shared bytes to reduce memory buildup

* resolved clippy -D warnings regression in custom payload event

* fixed Bytes::from(payload.data)

---------

Signed-off-by: Starless_Sky <108993627+xStarless-Skyx@users.noreply.github.com>
Co-authored-by: GabeGrundy <grundygabriel050@gmail.com>
2026-02-13 10:49:47 +00:00
ChocoDev
9f78d65c3f perf: packet encode, decode and compression (#1517)
* fix: protocol network optimize

* compression reuse and decoder payload

* revert risky lighting queue

* refactor: split observability and dedupe packet broadcast grouping

* remove log.workspace = true

* [expect]

* clippy

---------

Co-authored-by: chocodev11 <chocodev11@users.noreply.github.com>
2026-02-12 13:41:33 +00:00
Richard Marshall
62c40dcaf9 Merge pull request #1491 from chocodev11/fix/velocity-1218-clean
fix: velocity packet 1.21.8
2026-02-11 11:53:17 +00:00
chocodev11
0efc05138c chore: mark legacy velocity encoder must_use 2026-02-11 11:09:54 +00:00
chocodev11
2ee194b190 fix: unify legacy velocity encoding for 1.21.8 2026-02-11 11:03:37 +00:00
RB007
8aeeacfbbc feat: lighting system and refactored chunk_system (#1431)
* refactor: chunk system

* feat: start of lighting engine (working cave lighting?)

* fix: all lighting working?

* chore: clean up

* chore: clippy and formatting

* fix: cross-chunk light propagation and light update packet added

* refactor: restore top-y and add reserve queue optimizations

* refactor: reduce locks, add shadow cache, and batch lighting updates

* fix: block lighting updates now work properly 🥳

* fix: sky lighting updates now work properly 🥳

* feat: lighting config value (default, full, dark)

* fix: import

* fix: re-calculate lighting if required and halt generation on server stop

* fix: smooth chunk saving

* feat: make chunk autosave configurable

* fix: chunks now unload?

* fix: "missing chunk" crash

* fix: receive_chunk hang

* fix: some unloading memory leaks and bugs; refactored lighting a bit

* refactor: simplify lighting propagation and engine

* chore: clippy and formatting

* fix: adherence to lighting config

* fix: sky light propagation

* fix: speed up light propagation

* fix: sky light issues

* chore: clippy and formatting

* fix: merge changes and fmt

* refactor: remove mem command

* fix: Cargo.toml
2026-02-09 19:15:40 +01: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
chocodev11
6aa60248f6 formatting 2026-02-09 07:03:36 +00:00
chocodev11
48b3d679e0 velocity encode 2026-02-09 07:03:35 +00:00
chocodev11
3cbf788da4 velocity packet 2026-02-09 07:03:35 +00: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
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
Alexander Medvedev
3c87523112 chore: refactor chunk reading/writing 2026-02-05 01:54:34 +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
Alexander Medvedev
452d8c413b chore: add uuid to world 2026-01-31 15:24:11 +01:00
Alexander Medvedev
67fc80439d fix: player count overflowing 2026-01-31 13:57:26 +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
DrPing
232bf29d07 fix: prevent player from getting kicked when doing jab attack with spear (#1375) 2026-01-25 16:58:34 +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
Alexander Medvedev
5bfa6528da chore: changed block registration
only require block ids, should make bin size smaller and let the compiler better optimize, should also be faster performance wise
2026-01-23 23:32:17 +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
Alexander Medvedev
d81acb0ab1 fix: bedrock edition and port it to 1.21.30 2026-01-23 15:17:56 +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
Jinx
a6a09a9eca feat: implemented item/armor durability (#1343)
* Added durability for items and armor

* Run rustfmt
2026-01-20 19:16:56 +01:00
Hendrik Lind
1e691c71b9 refactor: use macros & remove need for temp buffer (#1313) 2026-01-16 16:39:38 +01:00
Alexander Medvedev
526c9cc465 fix: https://github.com/Pumpkin-MC/Pumpkin/issues/1298 2026-01-16 16:24:13 +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
Clicks
6178de5b07 fix: variety of small things (#1265)
* scheduled ticks for banners

* scheduled ticks and can place at for cakes

* add pitch to world spawn and setworldspawn command

* add ability migrate LevelDat from SpawnAngle to SpawnYaw

* backwards compatibility

* use minecraft name for setworldspawn
make PlayerSpawnPosition not panic anymore
fix infinite skipping of night when no players were online

* fix more clippy lints

* send abilities update on initial spawn

* Revert "fix more clippy lints"

This reverts commit 19d4ae56f8.

* .-.

* implement advance time gamerule

* still tick world_age

* advance weather

* add dropping of inventory on death

* keep inventory gamerule

* clippy

---------

Co-authored-by: CuzImClicks <cuzimclicks@proton.me>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-01-15 12:15:12 +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
Ben Landon
9319bedac5 feat: Implement Command Blocks (#1223)
* Fix /transfer permission

* It's actually permission level three, not permission level two.

* Move dispatcher.register call to correct place

* Implement command blocks

* satisfy clippy

* satisfy formatter

* fix NBT typo

* Fix command block entity handling & ignore starting "/"

* fix: use @ for command block sender name

* feat: correctly load command block entities

* feat: send message when command block is changed

* feat: implement conditional flag for command blocks

* feat: implement chain command blocks

* fix: resolve clippy errors

* feat: implement command block previous output mode

* feat: implement comparator output for command blocks

* fix: check redstone conditions for repeating command blocks

---------

Co-authored-by: MollTheCoder <mollthecoder@programmer.net>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-01-11 15:32:04 +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
Hendrik Lind
b84e2e7153 feat: add times subcommand to title command (#1246)
* feat: add `times` subcommand to `title` command

* chore: make clippy happy
2025-12-30 12:14:55 +01:00
Clicks
24fff00425 Make All Dependencies Workspace Dependencies (#1245) 2025-12-30 12:13:51 +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
Alexander Medvedev
3829850607 removed some clones
fix: https://github.com/Pumpkin-MC/Pumpkin/issues/1226
2025-12-07 22:43:26 +01:00
とぴ。(おーけ
dbdbc04eb4 feat: switch to dynamic config (#1201)
* remove static BASIC_CONFIG

* remove static ADVANCED_CONFIG
2025-12-06 13:32:06 +01:00
Alexander Medvedev
a2d8ca8d98 fix: pumpkin-world external crate compilation 2025-12-06 10:30:03 +01:00
Alexander Medvedev
74c66e25e8 fix typo
and some compilation changes,
fix https://github.com/Pumpkin-MC/Pumpkin/issues/1010
2025-12-01 11:23:57 +01:00
Alexander Medvedev
5e8d7221e3 fix: https://github.com/Pumpkin-MC/Pumpkin/issues/1174 2025-11-27 17:31:39 +01:00
Alexander Medvedev
03b3ff5e15 This should prevent some dead locks 2025-11-23 20:08:47 +01:00
Alexander Medvedev
2104367d0e fix: https://github.com/Pumpkin-MC/Pumpkin/issues/1216 2025-11-20 19:40:50 +01:00