* Tick Command Implementation
* Send the current ticking state to the new player so they are in sync.
* extend `/tick query` command with performance tracking
* feat: enhance tick sprint reporting and message formatting
* Add suggestion hints for tick command arguments
* fix: update tick command permission level
* fix: resolve clippy pedantic warnings and refactor tick command
- Refactor oversized execute function in tick command into smaller helper methods:
- handle_query() for query command logic
- handle_non_sprinting_status() for status display
- send_percentiles() for percentile calculations
- handle_step_command() and handle_sprint_command() for respective operations
- Fix format string warnings by using inline format arguments ({tickrate:.1})
- Replace lossless casts (ticks as i64) with From::from() for type safety
- Use Self instead of explicit type name in tick_worlds method signature
- Add Default trait implementation for Ticker struct
- Ensure all match arms return proper Result types
Resolves all clippy::pedantic warnings including too_many_lines, uninlined_format_args, cast_lossless, and use_self violations.
* fix: replace hardcoded tick rate with configurable value from BASIC_CONFIG
* revert back the old comment
* Added bed block entity
* Player can sleep
* Format
* Respawn point works
* Clippy
* Added dimension support
* Sleeping works!
* Bed explodes when not in overworld
* Omg there was a packet missing
* Clippy
* Sleeping checks fully working!
* Clippy
* Wrong tick time
* Bruh mb
* feat(protocol): Implement char serialization and deserialization
This commit introduces support for serializing and deserializing individual characters within the pumpkin-protocol. Characters are handled as big-endian u32 Unicode scalar values.
Key changes:
- Implemented `Serializer::serialize_char` to write a `char` as a `u32`.
- Implemented `Deserializer::deserialize_char` to read a `u32` and convert it to a `char`, including validation for invalid scalar values.
- Added a new test suite `test_char_reserialize` with cases for ASCII, multi-byte Unicode characters (e.g., 'Ω'), and characters requiring 4-byte UTF-8 representation (e.g., '🎃').
- Corrected warnings related to unused mutable variables in the new tests.
Additionally, to support the testing and building of related crates:
- fix(build): Enabled the `io-util` feature for the `tokio` workspace dependency in the root `Cargo.toml`. This resolved compilation errors in the `pumpkin-world` crate by providing necessary async I/O utilities like `AsyncReadExt` and `AsyncWriteExt`.
* feat(protocol): Implement i128/u128 serialization and deserialization
This commit adds support for serializing and deserializing 128-bit integer types (i128 and u128) in the pumpkin-protocol. These values are written and read as 16 bytes in big-endian order.
Key changes:
- Implemented `Serializer::serialize_i128` and `Serializer::serialize_u128` to write i128/u128 values.
- Added `NetworkReadExt::get_i128_be` and `NetworkReadExt::get_u128_be` for reading these types.
- Implemented `Deserializer::deserialize_i128` and `Deserializer::deserialize_u128`.
- Added new test cases `test_i128_reserialize` and `test_u128_reserialize` to ensure correctness for both positive and negative i128 values, and positive u128 values.
* feat(protocol): Implement unit type (de)serialization
This commit introduces serialization and deserialization logic for Rust's unit type `()` and unit structs.
- `Serializer::serialize_unit` now correctly writes no bytes for unit types, as they carry no value.
- `Deserializer::deserialize_unit` and `Deserializer::deserialize_unit_struct` are implemented to
consume no input and correctly reconstruct unit types/structs.
- Added `test_unit_reserialize` to verify that serializing and deserializing unit structs, both standalone and as fields within other structs, behaves as expected (i.e., no bytes are written or read for the unit components).
* feat(protocol): Implement enum (de)serialization for all variant types
This commit introduces comprehensive support for serializing and
deserializing Rust enums, including unit, newtype, tuple, and
struct variants.
Key changes:
- `serializer.rs`:
- Implemented `serialize_struct_variant` to correctly write the
variant index (as a VarInt) and then delegate to the
`SerializeStructVariant` trait for field serialization.
- Implemented `SerializeStructVariant` to serialize individual
fields of a struct variant.
- `deserializer.rs`:
- Implemented `deserialize_enum` to use `visitor.visit_enum`.
- Implemented `EnumAccess` to read the variant index (as a VarInt,
converted to u32) and deserialize the correct variant.
- Implemented `VariantAccess` to handle deserialization of
unit, newtype, tuple, and struct variants.
- `ser/mod.rs`:
- Added `test_enum_reserialize` to thoroughly test (de)serialization
of enums with unit, newtype (e.g., `Enum::B(i32)`), and struct
variants (e.g., `Enum::C { field: T }`).
This ensures that enums with various structures can be reliably
transmitted over the network protocol.
* cargo fmt
* feat(protocol): Implement (de)serialization for tuple structs
This commit adds support for serializing and deserializing tuple
structs within the network protocol.
Key changes:
- `serializer.rs`:
- `serialize_tuple_struct` in the main serializer now delegates
to the `SerializeTupleStruct` trait implementation.
- Implemented `SerializeTupleStruct` to serialize fields of a
tuple struct sequentially.
- Updated `SerializeTupleVariant::serialize_field` to correctly
serialize tuple variant fields.
- `deserializer.rs`:
- Implemented `deserialize_tuple_struct` to reuse the existing
`deserialize_tuple` logic, as their serialization format is
identical.
- `ser/mod.rs`:
- Added `test_tuple_struct_reserialize` to verify the correct
(de)serialization of tuple structs.
These changes ensure that tuple structs are handled correctly by the
protocol.
* feat(protocol): Implement (de)serialization for maps
This commit introduces support for serializing and deserializing
maps (specifically `std::collections::HashMap`) within the network
protocol.
Key changes:
- `serializer.rs`:
- `serialize_map` now requires a known length for the map and
writes this length as a VarInt before serializing key-value
pairs.
- Implemented `ser::SerializeMap` to handle the sequential
serialization of map keys and values.
- `deserializer.rs`:
- `deserialize_map` reads the VarInt length prefix.
- Implemented `de::MapAccess` to deserialize key-value pairs
according to the read length.
- `ser/mod.rs`:
- Added `test_map_reserialize` to verify the correct
(de)serialization of `HashMap<String, i32>`, including
empty maps and maps with multiple entries.
These changes enable generic map types to be transmitted via the
protocol, with their length explicitly prefixed.
* inital chunk features
* add more things
great title i know
* add some features
still no result, but we are getting there...
* make it parse
* add simple BlockPredicate
* add simple random selector
* new things
* change stuff
* base tree impl
* change things
* add more heightmaps
* fix master merge
* steps towards proper random
* fix upper level block placement logic
* Make it compile
* fix block dir serde name
* Added Tree Foliage
* more Tree work
* Implement would_survive check
I don't say its good, but it works :D
* Fixed biome placement modifier (#836)
* Implement all tree foliages
* Fix grass, flowers, seagrass, seapickles...
* Add Ores
* add Bamboo, Vine, Spring feature
Also more fixes
* Corals
* Add Tree decoration & more
Many many fixes
* fix vines
* fixed bamboo
* fix some clippy warns
* fix trees outside of chunk
* make it compile again
upsi
* fix clippy warns
* fix InsideWorldBoundsBlockPredicate
* set dirt under tress trunk
dirt, not grass
* more trees work
---------
Co-authored-by: kralverde <github@email.kralverde.dev>
Co-authored-by: Laurent Stéphenne <laurent@guibi.dev>
* replace slot with ItemStackSeralizer
* Dismantle current inv logic
* Disassemble even more, items need fixing markd with TODO: Inv
* Player inventory methods implmented
* make some fields private
* remove invalid comment
* Partial screen handler and slot
* Add armorslot
* prepare for crafting
* implement some more crafting traits
* Fix ItemStack
* Fix pickup and remove faulty crafting (getting reworked in inv revamp)
* fix
* fix error
* add readme
* move readme file
* asd
* remove readme
* add uppsercase readme
* Some more work
* merge
* Move from generics to dynamics
* fix
* move to same impl
* Some changes
* add player open logic
* Basic impl of sync and listeners
* Why did mojang complicate it so much
* bruh
* Simplify things with DefaultScreenHandlerBehaviour
* Implement partial slot clicks
* add
* itemhashes are broken
* Start implementing packets
* fix deadlock
* new vanilla update
* Use static item refs and use Arc Mutex on invs
* working normal click
* fix deadlock
* implement sync handler
* small patch
* Implement quick_move
* Implement Swap click type
* pickup, update bug
* start fixing updates
* fix pickup desync
* Make Inventories non mutexes
* Implement some finishing stuff
* close screen on player leave
* fix pick item
* Move to item hashes
* remove some logs
* begin implementing barrels
* Begin implementing barrel
* implement barrels
* fix clippy + typos
* Fix merge conflicts
* Fix lint error
* don't use unwrap when getting equipment slot
* Fix typo and single threaded
* Accidentally removed tokio completley
* Fix crash when opening barrel holding item
* Add support for marking block entities dirty
* Player Equipment changes
* Make ScreenHandlerFactory own inventory instead of passing in optional
* remove log
* replace todo's
* fix clippy
---------
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
This also includes 2 other smaller crate updates, but i wanted just have rustyline-async not using a weird commit, i asked the maintainer of rustyline-async to release a new version, now its released
* feat: add amplifier + hide particles (but the infinite time is missing)
* fix effect duration
* /effect give fully work
* feat: add basic remove effect (should work?)
* fix the import of remove_entity_effect packet
* /effect clear fully work + translation ok
* feat: command /effect is now complete
* fix visual bug when the duration is infinite
* Finalization
* Everything work fine now