Commit Graph

20 Commits

Author SHA1 Message Date
kedor
a11f40a403 chore: move ItemStack from pumpkin_world to pumpkin_data (#1944) 2026-03-31 10:08:41 +02:00
Alexander Medvedev
e45ab613f4 chore: parse translations at compile time
not finished but its much safer and nicer now
2026-02-08 13:22:36 +01:00
Laptop59
cd71f16189 feat: make commands return i32 as result on success (#1415)
* added i32 result for /ban, /ban-ip, /banlist, and /bossbar

* added i32 result for /give, /fill and /clear, fixed executor spelling

* added i32 result for /damage, /data, /defaultgamemode, /deop, /difficulty, /effect, /enchant, /gamemode, /gamerule, /list, /me, /plugins, /pumpkin, /say, /seed, /setblock, and /stop

* added i32 for all other implemented commands left

* fixed clippy warnings and other various fixes

* added helpful documentation for `CommandResult`

* formatted docs properly
2026-02-04 10:41:22 +01:00
Clicks
70b3132396 chore: Remove Redundant Clippy Allows (#1247)
* switch to btreemap to comply with lint

* amplifier i32 -> u8

* switch allow to expect lint

* remove many many unnecessary clippy lints

* dont use expect inside quotes
2025-12-30 12:16:31 +01:00
Alexander Medvedev
71392b4a38 remove async_trait from Commands
This decreased compile time by 30%, Plugins also are not required anymore to use async_trait when adding custom Commands
2025-12-03 18:25:58 +01:00
Liyan Zhao
73c2c0115e Refactor entity argument (#1098)
* refactor: implement entity arguments

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

* fix clippy

* feat: server.select_entities

* fix clippy

* fix clippy

* fix /kill

* fix /kill damage

* fix entity filter parsing

* type filtering

* chore

* fix entity argument

* fix clippy

* fix entity arg

* Update player.rs

* Update entities.rs

* Update entity_type.rs

* fix

* fix clippy

* fix kill
2025-08-03 12:10:21 +02:00
Liyan Zhao
0e375434c5 Improve entity damage handling & entity name, Add death message & void damage, Weak reference to server in worlds. (#961)
* fix: enhance damage handling with context in LivingEntity

* feat: add out-of-world damage handling

Fix: #957

* fix: refine damage handling with context for entities

* fix: clippy

* feat: death message

* fix

* fix

* fix

* fix: review suggestions

* fix

* Update mod.rs

* fix display name

* fix display name

* fix clippy

* fix clippy

* fix

* fix

* fix world load

* fix logger timestamp

* fix logger timestamp

* fix compiling

* fix fall damage

* fix: pass fat ptr in damage_with_context

* refactor: Refactor commands to use styled name instead of plain text.

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-28 18:07:52 +02:00
spr-equinox
8ce65cc42d Refactor ItemStack to Support Vanilla-Like Data Components (#1059)
* improve tag v1

* improve tag v2

* fix typo and make BlockPredicate better

* improve get state from state id

* impl DataComponent

* make tag pub

* make component work

* apply clippy

* apply clippy

* remove unused crate

* apply to itemstack and no lifetime mark anymore

* Update tag.rs

* use Cow

* remove unnecessary lazy_static and Cow

* Update mod.rs

* Update mod.rs

* make DataComponent dyn

* remove unused crate

* fix error

* Update Cargo.toml

* Update Cargo.lock

* fix

* Update composter.rs

* update rust-version, remove unused crate, and merge

* Update furnace.rs
2025-07-28 12:24:40 +02:00
Clicks
c49f147230 Implemented the item counting in /clear (#872)
* implement cleared item counting

* add equipment to counting

* cargo fmt

* make clippy happy :)
2025-06-13 18:44:10 +02:00
ioterw
87bb594025 usize crashes my server all the time (#839)
* client id is u64

* item_count is u64

* 32 bit overflow fix in pallete.rs

* removed some scary usize multiplications

* fixed format

* clippy fix
2025-06-08 21:32:15 +02:00
4lve
9e36cdf683 Full inventory refactor + barrels (#691)
* replace slot with ItemStackSeralizer

* Dismantle current inv logic

* Disassemble even more, items need fixing markd with TODO: Inv

* Player inventory methods implmented

* make some fields private

* remove invalid comment

* Partial screen handler and slot

* Add armorslot

* prepare for crafting

* implement some more crafting traits

* Fix ItemStack

* Fix pickup and remove faulty crafting (getting reworked in inv revamp)

* fix

* fix error

* add readme

* move readme file

* asd

* remove readme

* add uppsercase readme

* Some more work

* merge

* Move from generics to dynamics

* fix

* move to same impl

* Some changes

* add player open logic

* Basic impl of sync and listeners

* Why did mojang complicate it so much

* bruh

* Simplify things with DefaultScreenHandlerBehaviour

* Implement partial slot clicks

* add

* itemhashes are broken

* Start implementing packets

* fix deadlock

* new vanilla update

* Use static item refs and use Arc Mutex on invs

* working normal click

* fix deadlock

* implement sync handler

* small patch

* Implement quick_move

* Implement Swap click type

* pickup, update bug

* start fixing updates

* fix pickup desync

* Make Inventories non mutexes

* Implement some finishing stuff

* close screen on player leave

* fix pick item

* Move to item hashes

* remove some logs

* begin implementing barrels

* Begin implementing barrel

* implement barrels

* fix clippy + typos

* Fix merge conflicts

* Fix lint error

* don't use unwrap when getting equipment slot

* Fix typo and single threaded

* Accidentally removed tokio completley

* Fix crash when opening barrel holding item

* Add support for marking block entities dirty

* Player Equipment changes

* Make ScreenHandlerFactory own inventory instead of passing in optional

* remove log

* replace todo's

* fix clippy

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-05-09 16:28:15 +02:00
Alexander Medvedev
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
kralverde
b9d9bacf8c Abstract networking to streamline code and avoid creating a new buffer for (de)compression. (#607) 2025-03-20 06:23:25 -10: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
Alexander Medvedev
148ac38fe3 Make TextComponent::translate simpler 2025-02-16 18:47:30 +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
466d4380cf Some Refactors 2025-02-01 17:53:41 +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