0
0
mirror of https://github.com/Pumpkin-MC/Pumpkin synced 2025-02-18 00:19:09 +00:00

27 Commits

Author SHA1 Message Date
148ac38fe3 Make TextComponent::translate simpler 2025-02-16 18:47:30 +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
5a77b21d22 Calculate block breaking speed
Also broadcast current held item. The block progress is already correctly displayed and calculated for tools. But for some reason the destruction does not work, looking at vanilla code i have no idea what i'm doing wrong
2025-02-15 22:47:14 +01:00
8d2ca8e404 Density Function Re-Work (#525)
* add density function parser, re-write functionality, and add initial tests

* add more tests and fix typo

* re-work density interpolator

* re-work flat cache

* re-work the rest of the chunk specific density functions

* re-work fill functions

* tweak sample logic and do some refactoring

* convert chunk noise to use new density functions

* work on porting proto chunk

* port proto chunk

* add cell cache test

* fix wrapper functions

* remove test print

* update benchmark

* rework again

* rework again pt 2

* classic off by one

* reduce components on the stack by 60x

* aquifer tweaks

* add multi noise sampler for biome sampling
2025-02-10 22:24:08 +01:00
45f5c27381 Fix HoverEvent::show_entity calls (#539)
* expose entity resource name in EntityType

* Use correct resource name in HoverEvent::show_entity

* fix lint
2025-02-10 21:41:15 +01:00
daa67c2dfa Reworking block properties (#529)
* Added 11 blocks properties

Added the following properties:
Axis
Open
Age
Attachment
Signal Fire
6 connection directions

* Clippy my beloved 💕

* Reworked block properties

Changed block properties to make them more extensible and easier to handle.

* Little too much of Clippy

* Lever works!!! 🎉

Made the lever work, implementing modifiers to the “on_place” per block, plus the “on_interact” function to handle the state when interacting with a block that has it.

* Kinda implemented bool as value

* A little bit of Clippy :)
2025-02-09 18:45:18 +01:00
8a5a0cdee8 Drop item when destroying blocks
Also make EntityType consts
2025-02-07 21:20:03 +01:00
2e2fe83720 Add Hunger 2025-02-07 00:22:52 +01:00
237b335a17 Add Support for Sign's (#490)
* Updated revised areas

* Removed enum added macro to search for block entity id

* Added sign update for all clients & clean up

* updated update_sign

* Updated code

* typo fix and format

* Finish and correct merge

* Remove hardcoded block entity value

* Move to own nbt crate

---------

Co-authored-by: whiteout314 <almagro.carlos@proton.me>
2025-02-03 12:45:15 +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
466d4380cf Some Refactors 2025-02-01 17:53:41 +01:00
97065617b6 Implement experience and experiene/xp commands (#521)
* Initial experience support

For some reason I am getting link errors

* Implement experience math

* Fix packet and format/clippy

* Fix translate strings

* Fix experience handling

* Clippy & Format

* Fix experience calculations

* Fix how we store experience.

Math WIP

* Redo all experience calculations

This should be 100% vanilla parity.
2025-02-01 16:23:43 +01:00
819e0c62ac Some more Item dropping work
And also some fixes
2025-01-31 23:21:24 +01:00
ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00
7ef2770ee0 Fixed slabs properties (#515)
* Fixed slabs properties

Changed a little bit the properties system to make the slabs work properly and the collision calculation when placing them.

* Added Layers

Used for Snow

* Prevent some crashes

Fixes https://github.com/Pumpkin-MC/Pumpkin/issues/514

* fix clippy

* Improve bounding box

* Added margin on intersection

Added a margin on intersections calculation to prevent the player to pass through blocks.

* Rolling back intersection margin

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-01-31 10:32:58 +01:00
136254729f Command parity to vanilla (#505)
* Updated show_entity

Changed a little bit the show_entity function from HoverEvents to better usability

* Added to_string to EntityType

Added to_str and to_string functions to allow proper use of identifiers in the show_entity of a TextComponent.

* Clear texts parity

Added translations to clear command, also added to show the player which items are cleaned, and tell something to the user like vanilla.

* Pumpkin command format

Formatted the pumpkin command to show better the text.

* Kill texts parity

Added translations to kill command, also added to show the player who is killed, and tell something to that user like vanilla. Also changed the color to white like vanilla.

* Added translate key of item

Added a function to item_registry which returns the appropriate TextComponent::translate for a item

* Give texts parity

Added translations to give command item, also added to show the player who receive the item, and tell something to that user like vanilla.

* CLIPPY MY LORD

* Reverted entity_type changes

I had not thought that I could use debug to get the name of the type, my mistake

* Added send_message to Player

Added the function send_message to allow sending DisgusedChatMessages directly to a specific player.

* Added msg command

Added msg (tell) command to match with the applied parity changes.

* Bossbar texts parity

Added translations and parity props for Bossbar command texts, without changing their behavior.
2025-01-28 00:08:07 +01:00
ac1856db2c Changed hover types (#497)
* get_text gets translations

Changed the function get_text to use translations correctly

* Fixed ShowItem and ShowEntity

Changed the ShowText type to allow using TextComponent on it, made the same chage to the "name" attribute of ShowEntity.

* Fixed Clippy requirements
2025-01-26 11:47:24 +01:00
31b04a6bae Add title command
- Fix TextComponentArgConsumer
- Rename with_child to then
- Rename ProtoCmdArgParser to ArgumentType
- Add title command, Mostly complete only "times" sub command is missing
2025-01-25 18:12:29 +01:00
43af1eacae Text component refactor (#492)
* Refactorized TextComponent

Changed the whole TextComponent structure to allow nested translated texts and avoid recursion in serialization, but keeping the api unchanged.

* Adapted translations

Changed all the translate components to fit the new format, also added translation to gamemode command.

* Format revised
2025-01-24 14:46:44 +01:00
5c787f9c5a Corrected player detection on place block (#491)
* Corrected player detection on place block

Changed the system of detection of intersection of the player with the placed blocks so that it respects the collision of the block.

* Solve clippy errors
2025-01-23 23:54:40 +01:00
57e54284c5 Translate when printing to console 2025-01-23 16:57:23 +01:00
e7f1420da3 Translate almost everything
The command output in Console/RCON is a bit broken now, i will fix that tomorrow, But in-game it works great
2025-01-22 23:31:56 +01:00
1a3b7e0ad6 Placement restrictions (#487)
* Restrict under and above

Fixed crashing due to user trying to place blocks under the world, moving the above check to take effect, and making it send the player the error message.

* Changed TextComponent Translate

Due to a circular encoding problem changed "with" value type of Translate until TextComponent rework.

* Restrict on adventure and spectator

Added a check and error when user tries to place a block on adventure or spectator gamemodes.
2025-01-21 21:28:52 +01:00
709d222c23 add basic entity NBT storage 2025-01-19 19:30:32 +01:00
23dbb72bbe rename WorldPosition 2025-01-12 16:45:22 +01:00
fcc3aaefe4 entity: spawn with random yaw 2025-01-09 14:29:42 +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