Commit Graph

126 Commits

Author SHA1 Message Date
Alexander Medvedev
744664cb2f chore: parse DoublePerlinNoiseParameters at compile time 2026-03-10 20:55:49 +01:00
Bjorn Beishline
576d76dfd6 feat: add wasm plugin api (#1675)
* feat: wasm plugin api base

* fix: make metadata macro work

* chore: fix clippy lints

* Implement guest registering of events

* chore: remove hardcoded v0.1.0  dep in wasm_host

* feat: add events to wasm

* feat: add caching of components

* fix: clippy lints

* chore: update Cargo.lock

* fix: add feature flag for link section

* feat: add base for command wit definitions

* feat: implement arg variants for command wit interface

* feat: add commented out command-tree arg variant

* feat: add wit definitions for text-component and command tree

Introduces the text interface with a builder-pattern resource,
argument-type variant, command-node resource, and register-command
on context. Migrates event and command-sender to use the new
text-component resource.

* feat: add stubs for wasm host

* chore: update wasmtime to v42

* feat: implement three methods of wit textcomponent

* Add consume function

* feat: implement all text-component host methods

Replace todo!() stubs with working implementations for all
HostTextComponent trait methods: style setters, click events,
hover events, add_text, get_text, and encode.

* feat: allow events to be modified

* feat: add some of base for commands

* chore: fix spelling mistake

* chore: remove unused dep

* feat: implement all argument-type to consumer mappings

* Add command exports

* log plugin load errors

* Some commands work

* Some more Commands work

* Update how commands are registered

* Implement locale

* Use handler id with require

* chore: fix some warnings

* Add PlayerLeaveEvent

* chore: fix all clippy warnings

* fix: add more descriptive error message

---------

Co-authored-by: Purdze <r.s.sutton@hotmail.co.uk>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-03-09 18:12:48 +01:00
Alexander Medvedev
7248f942e7 fix: latest rust clippy lints 2026-03-05 21:34:47 +01:00
Alexander Medvedev
12acb8aa76 fix: CI 2026-02-22 16:42:41 +01:00
Alexander Medvedev
bc205d2683 feat: pumpkin-protocol: add fuzzing
actually found some issues
2026-02-22 15:24:36 +01:00
Alexander Medvedev
4afe60aca9 chore: i'm back 2026-02-21 20:52:37 +01:00
FabseGP
24ea53b2e9 feat: replace log with tracing (#1460)
* feat: replace log with tracing

* chore: clippy

* fix: revert replacing println!-calls

* fix: await async construct

* fix: lints + incorrect await

* fix: each plugin spawns their own tracing-subscriber

* fix: replace info! with println for commands

* chore: remove env_logger

* fix: added TODO about structured logging
2026-02-13 21:10:13 +00:00
vyPal
88a38f74be fix: Lock tracing-subscriber to version before ANSI escaping (#1516) 2026-02-10 21:25:38 +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
Alexander Medvedev
b0ab5006ca chore: remove unused deps
also apply some clippy lints in some places
2026-02-09 00:07:39 +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
Alexander Medvedev
b1f62f3cd9 chore: remove not needed dep 2026-02-07 16:53:54 +01:00
Alexander Medvedev
fd1b968ae6 chore: switch from simplelog to tracing 2026-02-07 16:51: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
Alexander Medvedev
2a0d2f1cf3 chore: move structure settings from runtime to compile time parsing 2026-02-04 17:13:50 +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
72bd4dfbef feat: add from_legacy_string to TextComponent 2026-01-30 23:12:54 +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
Purdze
830284c091 feat: Implement nether portal linking (#1372)
* fix: nether portals

* fix: add world border checks and match vanilla portal behavior

* feat: add region-based POI storage for nether portal linking

Implemented Point of Interest system for fast portal lookups:
- region-based NBT storage matching vanilla format
- sections keyed by Y coordinate within per-chunk data
- auto-registration on portal creation/destruction
- used by portal search to avoid scanning all blocks

Note: this POI implementation covers nether portals only.
The full POI system still needs significant work for:
- villager job sites
- beds, bells, beehives
- ticket/occupation system
- auto-scanning chunks for POI blocks
- distance tracker for pathfinding

Vanilla POI reference: net/minecraft/world/poi/

* feat: add entity position preservation and collision avoidance for portals

- preserve entity position relative to portal when teleporting
- add collision avoidance to find safe spawn positions
- add source portal tracking for accurate exit position calculation
- fix clippy pedantic warnings across portal and border code

* feat: add yaw rotation and vehicle teleportation for portals

- rotate entity yaw 90° when portal axis changes between dimensions
- prevent passengers from teleporting independently (wait for vehicle)
- teleport all passengers along with vehicle through portals

* fix: handle nested passengers recursively for portal teleportation

passengers of passengers (e.g., player riding a pig riding a minecart)
are now teleported correctly through portals

* style: apply cargo fmt and allow too_many_lines for portal search

find_safe_location exceeds 100 lines but splitting it would reduce
readability - the portal search algorithm flows naturally as one unit

* feat: use MCA format for POI storage for vanilla compatibility

Change POI storage to vanilla-compatible .mca region format. This allows
proper portal linking when importing existing vanilla worlds, as Pumpkin
can now read portals registered by vanilla.

* fix: remove local cargo config that breaks CI

* fix: correct portal direction calculations and dimension chunk loading

- fix portal direction to match vanilla: z-axis uses south (not north)
- fix perpendicular direction to match vanilla's rotateyc1ockwise()
- fix fallback clearing dimensions to match vanilla (3x2x4 blocks)
- store world reference in chunkmanager, updated on dimension change
- use chunkmanager's world for chunk loading instead of entity.world

this fixes players spawning inside blocks and seeing wrong terrain
(overworld blocks in nether) after portal teleportation.

* fix: portal neighbor update logic and remove_player return value

- fix impossible condition in portal neighbor update (was always false)
- fix remove_player to return the removed player instead of none

* fix: update entity.world to arcswap for dimension teleportation

entity.world was an immutable arc<world> that was never updated after
dimension teleportation. when a player teleported to the nether,
chunkmanager.world was updated but entity.world still pointed to the
overworld. this caused tick_block_collisions() to read blocks from the
wrong dimension, preventing return portal detection.

changed entity.world from arc<world> to arcswap<world> to allow atomic
updates when changing dimensions. added set_world() method and updated
teleport_world() to call it after dimension changes.

* fix: reset chunk batch state on dimension change

when changing dimensions, the chunk batch state was not being reset.
this caused slow chunk loading if the player was in a throttled state
before teleporting, as the server would wait for acknowledgments for
chunks that no longer exist in the new dimension.

now resets batches_sent_since_ack to Initial in change_world() so
chunks can be sent immediately after dimension change.
2026-01-27 20:30:58 +01:00
Alexander Medvedev
622d0599df chore: added gradient and rainbow to TextComponent
ofc did also a bunch of other things, the JavaClient implementation should be cleaner now and does not lock the player anymore
2026-01-25 16:41:46 +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
49490237d4 chore: replaced rustyline-async with rustyline
also added console tab support
fixes https://github.com/Pumpkin-MC/Pumpkin/issues/429
2026-01-17 21:59:51 +01:00
Alexander Medvedev
3fbefafe4d feat: some more entity AI work 2026-01-17 19:26:25 +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
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
a44a5babe3 feat: partially implement Stronghold
also fixed some bugs
2026-01-10 17:56:25 +01:00
Alexander Medvedev
01d3be963d feat: Structures 2026-01-03 23:36:19 +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
70b75a0ac5 remove async-trait entirely 2025-12-04 23:50:00 +01:00
Alexander Medvedev
71392b4a38 remove async_trait from Commands
This decreased compile time by 30%, Plugins also are not required anymore to use async_trait when adding custom Commands
2025-12-03 18:25:58 +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
0ce5471761 Overhaul registry loading
Registry data is now loaded dynamically for automatic future-proofing, ending the need for manual struct updates. Access to specific values now requires explicit data lookups.
2025-11-18 19:00:18 +01:00
Alexander Medvedev
47bbc56591 this should fix plugin errors
at least for now
2025-11-01 12:13:28 +01:00
Alexander Medvedev
58583da4c1 Port to 1.21.9
I did not update density functions because i'm too lazy to refactor a bunch of things because Mojang decided to remove "initial_density_without_jaggedness", but i will in the future
2025-10-02 18:27:10 +02:00
Alexander Medvedev
932512b5d6 lets try fix CI 2025-10-02 16:54:48 +02:00
Alexander Medvedev
f0668ec746 readme: check eating as complete 2025-08-20 16:31:07 +02:00
Alexander Medvedev
fae24008db pumpkin-world(structures): Add structure placement calculation 2025-08-13 17:11:56 +02:00
Alexander Medvedev
7e3a1c0972 Fix rust 1.89 warns 2025-08-11 20:45:55 +02:00
Alexander Medvedev
8ccc135d74 Update all crates 2025-07-26 17:51:15 +02:00
unschlagbar
2e2236bf3b Bedrock player joining (#1063)
Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-07-26 17:31:00 +02:00
Alexander Medvedev
e96dc4d98e Improve compile time 2025-07-09 16:26:16 +02:00
Alexander Medvedev
8fec1d56cd Improve compile time by a bit 2025-07-08 23:58:00 +02:00
Alexander Medvedev
630560e1d8 Update README gif 2025-07-02 10:45:32 +02:00
4lve
622e2a13d2 Improve chunk generation speed by 5x (#988)
* Fewer locks and limit chunk gen to 2x per core

* remove logs

* Fix server shutdown

* Always use static blockstate

* Remove clone from block

* Fix clippy

* Imporve perf

* Implement FyorDev & MartV0 lookup tables

* Add chunk benchmark (FyorDev)

* fix c

* Fix CI

* fix clippy

* Format

* fix CI fr

* format

* Update benchmark to 1000 chunks
2025-07-02 09:48:36 +02:00
unschlagbar
8d934e31c7 First valid Raknet Frame set Packet :) (#983)
* hhlzuui

* gg

* reufef

* fix

---------

Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-07-01 14:04:23 +02:00
Alexander Medvedev
c67d4cfd2e Update to 1.21.7 2025-06-30 23:41:23 +02:00