0
0
mirror of https://github.com/Pumpkin-MC/Pumpkin synced 2025-04-05 05:03:48 +00:00

51 Commits

Author SHA1 Message Date
dda7cac329 Save/Read and broadcast biomes (#678)
* send biomes in packet

* fix single pallet

* complete logical palette container

* refactor codecs

* palette work

* palette work

* fix palettes

* clean up palette logic

* better handling of chunk loading channel errors

* fix encompassing bits

* fix network serialization

* fix typos

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
2025-04-03 19:06:40 +02:00
a63b49a095 add Secure Chat (#656)
* Add secure chat configuration option

* Add secure chat bool to login packet

* change name of config flag

* add packet deserializer for player session packet

* make session update async

* Change config option

* Formatting

* Add chat configuration option

* Basic custom chat formatting

* formatting

* Add chat session to Player

* fix duplicate imports

* Formatting

* chat validation mostly working

* add registry for custom raw message

* chat formatting working with secure chat

* don't share session tokens if reporting blocked

* add received message index

* add custom registry without modifying asset files

* resolve color decorator before MESSAGE so player can't inject color codes by default

* move comment

* update all player sessions on join

* better previous message handling

* fix multiplayer bugs

* send new players existing signatures

* clean stuff up

* only send ChatSession if reports are enabled

* make clippy happy
2025-03-30 21:31:55 +02:00
d8b726dfe2 Update to 1.21.5 (#665)
* update to 1.21.5

* maybe made something better maybe made something worse

:c does still not work

* some fixes

* fix chunk packet

finally, this took way too much of my life time

* port text component

* fix tests

recipes are broken but we currently don't use them anyway
2025-03-27 21:49:02 +01:00
d738b5879d make the chunk packet faster 2025-03-17 22:46:48 +01:00
93510eecd5 Grammar fixes, terminology change (#633)
* Major grammar sweep

* Remove extra backtick

* Use more specific terminology for chunk data storage

* Forgor to cargofmt

* Fix typo "thier"

* Fix typo "clousures"

* Try new terminology

* Forgor to cargofmt

* Use "Subchunks" instead of "Heterogeneous" for ChunkBlocks variant

* Fix variable name

* Forgor to change comment
2025-03-16 10:40:17 +01:00
eb27cfa16a Generate Blocks and Properties Revamp (#613)
* Add block builder

* Implement loot tables

* chaos snapshot

* LFG

* add oak fence

* lever facing

* Add trait for CardinalDirection

* fix clippy

* fix clippy

* reimplement partial state of loottable

* Implement neighbor block updates

* add oak door

* Fix crash on invalid state

* Fixes

* Add fences

* Add doors

* Refactor how we handle block properties when implemented in many places

* Remove old loot_table, moved to block generation

* Better Block Properties

* Add fence gates

* Update block_grouper and add logs

* Build tags instead and make it easier to define variants of blocks

* Save block states

* Allow nether fences to connect with fence gates

* Move away from hardcoded property names

* Clean up property remaps

* start refactor of blocks

* refactor block compile build

* refactor name map for property groups

* Make it so fences can't connect to the air part of a fence gate

* Use extractor instead of hard coded property names

* to_value and from_value should be stripped of "L" prefix

* Prefix isn't used anymore

* use hashes to verify uniqueness

* Don't declare IntProvider twice and fix typo

* remove some comments that don't apply anymore

* Move loot table so it's shared

* Futureproof Loot Tables

* Implement BlockStateProperty condition for LootTables

* Move experience to pumpkin_utils

* Add is_liquid

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
2025-03-10 18:06:44 +01:00
1fb2be46d4 Update to Rust edition 2024 2025-02-20 18:42:20 +01:00
7ec99a0411 Fix our NBT serde (#549)
* make deserializer streamable

* fix logic

* fix deserializing

* work on deserialization

* finish serialize

* replace everything with pumpkin_nbt

* fix more serialization cases

* finish conversion

* add comment

* remove all fast_nbt, test nbt arrays, add implement tuples/arrays

* add size hints for deserialization

* fix deserialization
2025-02-16 13:39:43 +01:00
3d1e0bf35c Check for correct tool when breaking blocks
Also rewrite how we handle tags. Now we can use tags everywhere we want!. I also decided to make the json assets pretty printed which is so much easier to debug, The decision was made because of the reason that we are moving to compile time assets, so pretty printing does not affect performance
2025-02-14 22:47:09 +01:00
2e2fe83720 Add Hunger 2025-02-07 00:22:52 +01:00
186e846858 Plugin event rewrite (#513)
* simplify all

* fmt

* Consider using derive macro

* Add new events

* Add events call

* minor fixes

* minor fixes

* fix

* optimize code

* big changes

* fix skill issue

* fix

* Consider not specify patch version

* make logger shared

* i want test one thing

* Add one useful function

* add little amouth of docs

* use config instead

* revert changes

* fmt

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-01 18:14:28 +01:00
ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00
deda78231a play sound on fall damage 2025-01-27 21:55:32 +01:00
ee485056fb rename pumpkin-core to pumpkin-util
I see that there is an confusion between the pumpkin-core crate,  People often think that this is the most important one
2025-01-09 13:12:57 +01:00
f772d971f6 Remove lifetime from TextComponent 2024-12-30 13:10:02 +01:00
0633197b62 pumpkin-protocol: added codecs 2024-12-21 17:05:44 +01:00
f587cb6748 remove iter_tools
we only used them for collect_vec. I think its worth the "effort" to write Vec type annotations ourself and have one big crate with way too may features we don't need less
2024-12-12 23:40:52 +01:00
2ee2cc06dd fix some typos 2024-12-11 16:15:31 +01:00
d0d0f35a94 Some minor improvements 2024-12-08 23:59:52 +01:00
b82a4e130b Add: Interactive blocks (#333)
* WIP interactive blocks

* Added jukebox and crafting table

* Making feature more dynamic allowing every block action to be registered here

* Renamed interactive_block_manager to block_manager

* Simplifying register functions

* Added on placed

* Fix master merge

* Added pumpkin_block macro

* Removed junk

* Added the option to block placing in on_use_with_item

* Fixed inventory lock

* Adding on_broken and implementing it for the jukebox

* Fixed merge
2024-12-07 13:00:03 +01:00
35afc0bfb9 Port to 1.21.4 2024-12-03 23:34:59 +01:00
5efa881090 Fix: Clippy 1.83 2024-11-28 21:52:55 +01:00
796341be05 Extractor: minimize everything
- blocks.json 8.3MB -> 4.1MB
- items.json 988KB -> 548KB
- packets.json 6.9kb -> 4.2kb
- particles.json 3.5kb -> 1.6kb
- recipies.json 376kb -> 264kb
- screens.json 731b -> 315b
- sounds.json 72.2kb -> 42.2kb
- synced_registeries.json 143.3kb -> 87.6kb
- tags.json 335.4kb -> 165.8kb
2024-11-27 00:12:11 +01:00
c3c4aff912 Consistent registry values and player changes (#324)
* Made registry values consistent

* Port to own nbt crate

---------

Co-authored-by: Snowiiii <lilalexmed@proton.me>
2024-11-23 19:00:34 +01:00
402f3951f5 Move to own NBT crate (Mostly) (#100)
* Remove fastnbt as dependency

* Move to own NBT crate

* Added deserialization

Also replaced i8 bool's with bool's

* Use: fastnbt for pumpkin-world

Until i don't figure out why Arrays do not work, we can use fastnbt
2024-11-23 14:50:54 +01:00
8cde02e625 Add Shaped and Unshaped crafting support, as well as deserializing the entire recipe format (#165)
* add cleaner registry parsing

* start adding recipes

* add tags, and some crafting things

* Fix echest command

* add partly working crafting interface

* add generated assets

* fix container commands and clippy lints

* fix issues with resolving recursive item tags for crafting

* add flatten3x3 function

* add shapeless crafting

* add tests to and fix recipe flattening function

* refactor recipe system a bit

* add rayon to speed up initial loading of recipes

* almost working after rebase

* add deserialization for new crafting type "transmute"

* make crafting work again

* make shapeless recipes not require all permutations

* fixed visual bug with when taking out ingredients for crafting

* add support for new tags system
2024-11-12 12:57:14 +01:00
d3f299d2f6 Add damage and re-spawning (#224)
* Added new packets

Added packets to pumpkin-protocol for damage and re-spawning.

* Made damage_type registry value accessible

* Added damage and fall damage

* fixed phasing bug

* fix issues caused by merge

* spawn player on ground

make the player spawn on the highest block instead of in the air.

* dont default player to flying

* mode last_pos to living_entity

* fix using entity instead of living_entity

* fixed fall damage not working properly when switching gamemodes
2024-11-05 23:38:26 +01:00
8db277f63e Minior Changes 2024-11-03 22:36:00 +01:00
9e7adec16b Parse Registries from JSON 2024-11-02 16:34:35 +01:00
e396399e66 Port to 1.21.2 (#171)
* Update JSON Files to 1.21.2

* Update constants to 1.21.2

* Port c_login_success to 1.21.2

* Fix: damage type

* Overhaul Packet ID system

We now use Packet IDS from enums.

1. This is very very nice for seeing which Packets are already implemented and which not.
2. This lets us easly port to newer Minecraft version, In vanilla there are no Packet ids hardcoded, Packet IDs will be parsed from a enum like this

* Port all Packets to 1.20.2

* Update README badge to 1.20.2

* Change doc for the new packet id system
2024-10-23 14:31:23 +02:00
287f466ae1 More workspace dependencies 2024-10-21 19:36:42 +02:00
229be05e98 run formatter on cargo.toml files 2024-09-19 03:10:26 -04:00
91d190c212 Remove unused deps
to mention is the take_mut dep i removed. Its heavily outdated and uses unsafe combined with pointer magic.
2024-09-06 13:30:57 +01:00
dad4798844 Update deps 2024-09-06 11:34:59 +01:00
0a02c28b26 Move serde into workspace 2024-09-01 12:26:48 -05:00
8eb894ef13 Create pumpkin-core, and move pumpkin-text 2024-08-21 16:12:09 +02:00
a6d9ed216d Use Cow's in TextComponent
We now don't always convert &str to Strings allowing us to use stack allocations
2024-08-19 20:05:18 +02:00
1a21290e0f Fix some minor typos 2024-08-19 17:52:04 +01:00
8fa8b793ee improve doc 2024-08-14 23:16:02 +02:00
5cf19a4e98 Add ChatType 2024-08-12 15:46:24 +02:00
5b636111e4 Prepare ChatType registry 2024-08-11 17:55:41 +02:00
414cf3190c Added RCON support 2024-08-10 23:53:32 +02:00
50dcbfeb6d Add inventory support 2024-08-09 22:38:00 +02:00
19af3618cb fix: all clippy warns 2024-08-04 00:40:27 +02:00
ae69bbc7f1 Add pumpkin-world
also refactor player
2024-08-04 00:29:20 +02:00
f779d31880 Add Clientbound Chunk Data and Update Light 2024-08-03 13:56:32 +02:00
a45a43397c Add Serverbound Confirm Teleportation 2024-08-03 13:25:28 +02:00
f111c7881c add damage type registries 2024-08-03 12:56:21 +02:00
1f041cc7db Fix Clientbound Login 2024-08-03 11:25:38 +02:00
2fd3585af7 Finally fix all registries 2024-08-03 01:01:15 +02:00