Commit Graph

41 Commits

Author SHA1 Message Date
kralverde
d518732a76 Fix dupe, double click, and shift click (re-PR) (#591)
* Fix dupe, doubble click and shift click

* Fix inventory desync

* Fix clippy

* refactor magic numbers

* fix clippy

* refactor item logic

* fix inventory

* prefer main inventory over offhand

* Set slot stack to None if empty

* fix container deadlock

* fix linter

* fix lint pt 2

---------

Co-authored-by: 4lve <72332750+4lve@users.noreply.github.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-03-01 08:09:14 -10:00
Alexander Medvedev
27f239a612 Living Entity: Proper death
Now we wait until despawning the entity so the death animation is played
2025-02-27 22:51:49 +01:00
Alexander Medvedev
8aef30ee13 Make TNT Work (#590)
* make tnt work

* Spawn TNT at right position

* Fix tnt
2025-02-25 16:38:12 +01:00
Alexander Medvedev
995edfb3c2 Add Effects 2025-02-22 14:17:06 +01:00
Alexander Medvedev
1fb2be46d4 Update to Rust edition 2024 2025-02-20 18:42:20 +01:00
kralverde
4f3c146500 Fix Item Tool Components and Partially Implement Tag Updates (#554)
* initial commit

* add fluid tags

* rename tag item

* Don't broadcast block breaking to breaker

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-16 15:54:07 +01:00
Alexander Medvedev
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
Alexander Medvedev
06334ec658 Add Particle command 2025-02-11 20:43:16 +01:00
Alexander Medvedev
79ad1c40f3 Make non Player entities attackable 2025-02-10 23:32:04 +01:00
kralverde
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
yarml
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
Alexander Medvedev
8592d095f3 Parse Items at Compile time 2025-02-08 19:23:59 +01:00
Alexander Medvedev
5c5bc67b3a Improve damage type 2025-02-07 22:33:52 +01:00
Alexander Medvedev
8a5a0cdee8 Drop item when destroying blocks
Also make EntityType consts
2025-02-07 21:20:03 +01:00
Alexander Medvedev
2e2fe83720 Add Hunger 2025-02-07 00:22:52 +01:00
drakeerv
09d6eb6da2 Add damage types & damage command (#526) 2025-02-02 11:22:49 +01:00
suprohub
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
drakeerv
e1e0576f29 Make sound to_name a const fn (#519)
Small change but should make it a bit faster
2025-01-31 10:12:07 +01:00
drakeerv
c6d349249c Finalize playsound command implementation (#512)
* Fully implement playsound

* Format and Clippy

* Formatting

* Add translate strings
2025-01-29 23:01:27 +00:00
Alexander Medvedev
41fac573ba Fix some typos 2025-01-28 14:05:17 +01:00
MrMelther
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
Alexander Medvedev
2fdf0777f6 Add Summon Command
Also refactor some things:

- Remove cmd_ prefix from commands
- Remove arg_ prefix from arguments
2025-01-26 20:06:20 +01:00
Alexander Medvedev
6c78567a83 add play sound command
Its simple and there are many arguments missing but its works
2025-01-23 23:40:20 +01:00
Alexander Medvedev
7ec4cc7c2e Add Message types
aka chat types
2025-01-23 18:35:00 +01:00
Alexander Medvedev
709d222c23 add basic entity NBT storage 2025-01-19 19:30:32 +01:00
BlaCoiso
c7875fb699 Fix incremental build for pumpkin-data assets (#482) 2025-01-17 14:57:30 +01:00
Alexander Medvedev
a115106899 fix screen deadlock 2025-01-12 18:04:06 +01:00
Alexander Medvedev
6415f697e5 parse Biome enum at compile time 2025-01-11 19:48:18 +01:00
Alexander Medvedev
4f370845e2 replace DoublePerlinNoiseParameters with parsed one 2025-01-11 18:54:45 +01:00
Alexander Medvedev
aad1f91acb parse entity types at compile time 2025-01-11 17:59:36 +01:00
Alexander Medvedev
308c125a20 parse world events at compile time 2025-01-11 17:06:21 +01:00
Alexander Medvedev
03cb80b216 parse scoreboard display slot at compile time 2025-01-11 16:52:09 +01:00
Alexander Medvedev
621bc31f48 parse entity pose at compile time 2025-01-11 16:20:31 +01:00
Alexander Medvedev
c95b27eafb parse sound category at compile time 2025-01-11 16:11:51 +01:00
Alexander Medvedev
82386a57c4 parse game event at compile time 2025-01-11 15:54:26 +01:00
Alexander Medvedev
da268b548b parse ChunkStatus at compile time 2025-01-10 15:31:20 +01:00
Alexander Medvedev
7b205fe108 remove build from gitignore 2025-01-10 14:57:06 +01:00
Alexander Medvedev
45a591b27b parse Sounds into enum at compile time 2025-01-10 14:47:34 +01:00
Alexander Medvedev
c711d1511c parse Particle into enum at compile time 2025-01-10 14:39:25 +01:00
Alexander Medvedev
1208e67f36 parse screen into enum at compile time 2025-01-10 14:31:43 +01:00
Alexander Medvedev
03e81a1436 transfer packet id parsing to build time
This also allows now to create custom packets with a custom packet id which is not in the packets.json
2025-01-10 13:42:39 +01:00