Commit Graph

10 Commits

Author SHA1 Message Date
Laptop59
b241bbf0bd fix: make SNBT operation bool() return true for all non-zero values (#2358) 2026-07-09 16:00:34 +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
SomeYellowGuy
f383c88c76 feat(codec): implement Encode and Decode for some pumpkin-util items and convenience codec macros (#2111)
* added identifier codec

* added codec impls for `Vector2<T>` and `Vector3<T>`

* added codec impl for `BlockPos`

* added codec impls for `BlockBox` and `EulerAngle`

* fixed formatting and clippy

* added `BlockPos` test

* fixed clippy and formatting

* fixed codec mapping macros and started using them in tests

* fixed formatting
2026-05-15 08:45:49 +02:00
Alexander Medvedev
63d39f46d4 feat: add enchanting table 2026-05-06 22:29:29 +02:00
Laptop59
04874d4420 feat(command): implement SNBT parser (#2088)
* initial commit

* split snbt into modules

* formatted

* clippy warnings fixed

* added more rules

* applied clippy fixes

* added even more rules

* fixed clippy errors

* made all the required rules

* added some integer tests

* fixed clippy errors part 2

* finish up the last integer tests

* added float tests and some basic string tests

* quoted string literals

* `bool` operation tests done

* operation and maps

* fixed conflicts

# Conflicts:
#	pumpkin-nbt/src/tag.rs

* fixed clippy errors

* added message to `todo!()`

* fixed `indexmap` dependency for `pumpkin-codegen`

* fixed `typos` errors

* removed usage of `peek_byte()` for consistency

* removed useless macro

* moved some parser functions into a trait

* new translation changes
2026-05-05 10:41:27 +02:00
SomeYellowGuy
513477d1cf fix(codec): replace codec and map codec structs with Encode and Decode traits and their field versions (#2051)
* removed codecs in favor of the `Encode` and `Decode` traits and their derivatives

* placed more exports in the `pumpkin-codecs` lib

* split primitives into their own folder and added some tests

* added `Either` support and added a simple test for it

* fixed linting for tests
2026-04-21 16:38:25 +02:00
Alexander Medvedev
9b2bd09dcc fix: rust 1.95 lints 2026-04-16 20:50:36 +02:00
SomeYellowGuy
6ac9b31f78 feat(codec): add either codecs (#1900)
* initial commit

# Conflicts:
#	Cargo.toml

# Conflicts:
#	Cargo.toml

* implemented more `DataResult` methods

* finished data result struct

* fixed clippy errors

* implemented `map_like` and more `dynamic_ops` methods

* finished most other `DynamicOps` methods

* Fixed doc in get_bytes

* added encoder and decoder files

* fixed some stuff and added primitive codecs

* added some primitive codecs (has errors for now)

* changed the "stream" ops methods

* reworked types of the coders and codecs, added list codecs

* added JSON ops

* fixed list codecs, added some doc test examples in `JsonOps`

* added lazy codecs

* added map encoders, decoders and struct builders

* actually added mapdecoder

* added encoder and decoder transformations

* fixed encoder and decoder transformations and added transformation functions and range codecs

* added field encoders and decoders and separated range codecs

* added field encoders and decoders and separated range codecs

* added BaseMapCodec and SimpleMapCodec

* added struct codecs and moved tests

* added `NbtOps`, unsigned number codec types, range codec tests, a struct test, detailed `Codec` documentation

* added optional field map codecs, the validator function and reworked struct builder functions

* added unbounded map and struct codec tests and reworked validated codecs

* did some visibility refactoring

* fixed some stuff and renamed unsigned number codecs

* fixed formatting

* fixed docs to reflect changes on renaming unsigned number codecs

* fixed validated test

* fixed doctest

* moved base_map_codec and fixed docs about codecs

* fixed some mistakes in the code

* fixed some more mistakes in the code and converted some `DataResult::error` calls to `DataResult::partial_error`

* fixed formatting

* fixed some incorrect docs

* removed `OnceLock`s in `MapCodec`s so they can be used more easily

* fixed transformer codec descriptions, added more `NbtOps` tests and fixed some `NbtOps` list methods

* fixed doctest

* added a method to allow creating a field using a `MapCodec` reference

* bifurcated `MapCodecCodec`s as well

* removed imports only for documentation and replaced them with intra-doc links

* added additional docs to `optional_field_with_default` and `lenient_optional_field_with_default` Codec methods for additional details on encoding

* renamed crate to `pumpkin-codecs` so that data fixing can be placed somewhere else not frequently used

* fixed invalid nbt tag for test

* reverted wrapping the tags for heterogeneous elements

* fixed a few more issues

* initial commit

# Conflicts:
#	Cargo.toml

* added `NbtOps`, unsigned number codec types, range codec tests, a struct test, detailed `Codec` documentation

* renamed crate to `pumpkin-codecs` so that data fixing can be placed somewhere else not frequently used

* added either codecs and either map codecs

* added a test and extra either methods

* added extra assertion

* removed this crate's `either` module in favor of the `either` crate

* fixed rebase

* fixed Cargo.lock

* removed old folder

* removed `DataResult` change
2026-03-30 16:52:57 +02:00
HairlessVillager
974bdd98a6 chore: add license to Cargo.toml files (#1927) 2026-03-28 15:47:15 +01:00
SomeYellowGuy
24f6e2732d feat: Implement basic codecs and DynamicOps implementations from DataFixerUpper (#1483)
* initial commit

# Conflicts:
#	Cargo.toml

* implemented more `DataResult` methods

* finished data result struct

* fixed clippy errors

* implemented `map_like` and more `dynamic_ops` methods

* finished most other `DynamicOps` methods

* Fixed doc in get_bytes

* added encoder and decoder files

* fixed some stuff and added primitive codecs

* added some primitive codecs (has errors for now)

* changed the "stream" ops methods

* reworked types of the coders and codecs, added list codecs

* added JSON ops

* fixed list codecs, added some doc test examples in `JsonOps`

* added lazy codecs

* added map encoders, decoders and struct builders

* actually added mapdecoder

* added encoder and decoder transformations

* fixed encoder and decoder transformations and added transformation functions and range codecs

* added field encoders and decoders and separated range codecs

* added field encoders and decoders and separated range codecs

* added BaseMapCodec and SimpleMapCodec

* added struct codecs and moved tests

* added `NbtOps`, unsigned number codec types, range codec tests, a struct test, detailed `Codec` documentation

* added optional field map codecs, the validator function and reworked struct builder functions

* added unbounded map and struct codec tests and reworked validated codecs

* did some visibility refactoring

* fixed some stuff and renamed unsigned number codecs

* fixed formatting

* fixed docs to reflect changes on renaming unsigned number codecs

* fixed validated test

* fixed doctest

* moved base_map_codec and fixed docs about codecs

* fixed some mistakes in the code

* fixed some more mistakes in the code and converted some `DataResult::error` calls to `DataResult::partial_error`

* fixed formatting

* fixed some incorrect docs

* removed `OnceLock`s in `MapCodec`s so they can be used more easily

* fixed transformer codec descriptions, added more `NbtOps` tests and fixed some `NbtOps` list methods

* fixed doctest

* added a fourth specific `NbtOps` test for byte buffers (`ByteArray`s in NBT)

* fixed grammar mistake

* log messages for discarded keys in `create_map`

* use the `tracing` crate for logging

* added a method to allow creating a field using a `MapCodec` reference

* bifurcated `MapCodecCodec`s as well

* removed imports only for documentation and replaced them with intra-doc links

* added additional docs to `optional_field_with_default` and `lenient_optional_field_with_default` Codec methods for additional details on encoding

* renamed crate to `pumpkin-codecs` so that data fixing can be placed somewhere else not frequently used

* fixed some more errors and reworked `nbt_ops`'s `ListCollector` to be like 1.21.11, also allows &str in `DataResult`'s creation methods

* fixed invalid nbt tag for test

* reverted wrapping the tags for heterogeneous elements

* renamed function parameter in `DataResult::apply_2`

* removed unnecessary comment

* fixed a few more issues

* fixed formatting

* fixed another mistake for `DataResult::add_message`

* renamed `DataResult` factory methods to be more idiomatic and removed unnecessary `dyn` method

* removed unnecessary `clone()`

* updated Cargo.lock
2026-03-24 09:07:51 +01:00