Commit Graph

695 Commits

Author SHA1 Message Date
Alexander Medvedev
995edfb3c2 Add Effects 2025-02-22 14:17:06 +01:00
Alexander Medvedev
1f414f347c Support dropping items out of Inventory 2025-02-20 21:50:59 +01:00
Alexander Medvedev
1fb2be46d4 Update to Rust edition 2024 2025-02-20 18:42:20 +01:00
4lve
b428fdca1a Proper item stacking (#562)
* Implement item stacking

* Fix clippy issues

* Fix comments

* Some improvements

* Fix item picking bug

* Fully fix pickblock

* Pioritize item held

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-20 16:51:48 +01:00
kralverde
3f1fd5a0f1 Fix deadlock when "packet ready" buffer is full (#565) 2025-02-19 07:21:36 +01:00
Alexander Medvedev
1da941755a World: Give different error message on WorldInfoError::UnsupportedVersion 2025-02-18 19:23:27 +01:00
4lve
dbf58a54a8 Don't boradcast Equipment Change back to player (#561) 2025-02-18 19:06:46 +01:00
kralverde
e146130fd2 Check version of level.dat before trying to deserialize it (#555)
* initial commit

* cargo: fmt

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-18 17:41:27 +01:00
kralverde
a0d3a71ba8 Gracefully exit on stop, new logger and rustyline (#557)
* initial commit

* fix linter

* save remaining chunks in memory

* fix colors not working when terminal prompt is enabled

* fix typo
2025-02-18 16:10:09 +01:00
4lve
76188b9a47 Differentiate between single and stack drops (#559)
* Differentiate between single and stack drops

* Fix formatting
2025-02-18 15:50:06 +01:00
Alexander Medvedev
148ac38fe3 Make TextComponent::translate simpler 2025-02-16 18:47:30 +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
kralverde
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
Alexander Medvedev
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
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
vyPal
d6a3506627 Only show commands that player can execute (#551) 2025-02-14 17:50:12 +01:00
vyPal
9c324990fa world: change player list to rwlock (#550) 2025-02-14 17:49:45 +01:00
kralverde
95e04c7ff9 fix logging env level (#548) 2025-02-13 16:02:32 +01:00
Thomas Tartrau
73d3fe0373 Add new plugin events / change plugin organization (#536)
* refactor: make file per event

* feat: edit plugins organization
2025-02-12 16:37:23 +01:00
Alexander Medvedev
e2dff9d55a CI: Check for typos 2025-02-12 16:19:26 +01:00
Alexander Medvedev
06334ec658 Add Particle command 2025-02-11 20:43:16 +01:00
vyPal
af0573d9b8 Support Teleport to different world (#532)
* make entity world RwLock

* Add teleport function

* Mark client as not loaded before change dim

* clippy

* Post-merge issues

* FIx post merge issues

* Make world.remove_player fire event conditionally

* Remove extra StartWaitingChunks packet

* Add world.send_world_info()
2025-02-11 17:08:11 +01:00
Alexander Medvedev
79ad1c40f3 Make non Player entities attackable 2025-02-10 23:32:04 +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
MrMelther
8755b6cdaf Mini properties repair (#537)
* Made waterlog work

Added the hability to waterlog blocks when you place them on water, or when you use a bucket.

* Repaired fences properties
2025-02-10 18:45:54 +01:00
MrMelther
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
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
Roblux
ec0e8a723a Fixed item decrementing while block fails to place due to player intersection (#533)
* Fixed item decrementing while block fials to place due to intersection

* Missing semicolon according to formatting test
2025-02-07 21:36:00 +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
Alexander Medvedev
3d789f7450 Some Renames 2025-02-05 23:12:16 +01:00
drakeerv
0f88e79f8f Add basic weather, weather command, and weather cycle (#527)
* Add weather and weather command

I still need to add duration, fading and sounds

* F*ck bedrock

* Add weather cycle, fading, and duration

* Revert "Merge remote-tracking branch 'upstream/master' into weather"

This reverts commit c009fdfad3, reversing
changes made to ddeda07272.

* Reapply "Merge remote-tracking branch 'upstream/master' into weather"

This reverts commit 70a0e9861d.

* Update time.rs to use time arg
2025-02-05 18:59:53 +01:00
Alexander Medvedev
1712e5f0ac Use bytes 1.10.0 and replace our try_get with their 2025-02-03 22:48:48 +01:00
Kris
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
Alexander Medvedev
484009bb9e Fixed Some typos 2025-02-02 15:12:34 +01:00
drakeerv
09d6eb6da2 Add damage types & damage command (#526) 2025-02-02 11:22:49 +01:00
Alexander Medvedev
1729f58a6f Make Snowballs and Eggs work 2025-02-01 21:17:37 +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
Alexander Medvedev
466d4380cf Some Refactors 2025-02-01 17:53:41 +01:00
drakeerv
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
Alexander Medvedev
a1f08ebb55 Make item drops work 2025-02-01 14:13:13 +01:00
Alexander Medvedev
819e0c62ac Some more Item dropping work
And also some fixes
2025-01-31 23:21:24 +01:00
Alexander Medvedev
ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00
vyPal
8bb47b6ec7 Allow plugins to unregister commands (#522)
* Add unregister function

* Add unregister_command to plugin context

* Send command suggestions packet to all players

* cargo clippy

* cargo clippy again
2025-01-31 13:12:57 +01:00
MrMelther
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
Alvsch
0e8f8ecf6e Moved can_not_join check to proper place. (#517) 2025-01-31 10:14:17 +01:00
Alexander Medvedev
fefcb78e56 Fix reading from invalid level.data
Also use Spawn x and z now !
2025-01-30 15:13:56 +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
e82a52fc9e Improve Error handling when loading Plugins 2025-01-29 20:29:16 +00:00