Commit Graph

64 Commits

Author SHA1 Message Date
Alexander Medvedev
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
Snowiiii
287f466ae1 More workspace dependencies 2024-10-21 19:36:42 +02:00
AnonymousBit
112110272b Better logging (#167)
* feat: logs for when a player interacts with a block out of reach

* cleanup: used self.gameprofile instead of getting it from the client

* cleanup: better logging

* fix: added logging library

* cleanup:removed unused namespace

* cleanup: capitalisation and log levels

* fix: removed simple logging

* fix: removed todo! where not needed

* cleanup: removed duplicate dbg!

* Fix mistake in merging

* Fix my bad

* Merge repeated match arms
2024-10-21 18:36:19 +02:00
Snowiiii
f74f77a1f0 Add tokio 2024-10-17 18:59:51 +02:00
Alexander Medvedev
dfd4f9bc76 Merge branch 'master' into pumpkinerror-trait 2024-10-13 16:59:23 +01:00
lukas0008
a30dbde50b Merge pull request #101 from Snowiiii/block-macro
Add `block_id!` macro
2024-09-19 17:31:30 +02:00
StripedMonkey
229be05e98 run formatter on cargo.toml files 2024-09-19 03:10:26 -04:00
lukas0008
cf62babfe4 Make itertools a workspace dependency 2024-09-18 16:59:12 +02:00
Asurar0
2e99877a6c fix warnings 2024-09-11 23:01:09 +02:00
Asurar0
d176fbd37e fix fmt 2024-09-11 22:56:03 +02:00
Asurar0
c6043189d3 Improved synchronization primitives
- Replaced all `std::sync::Mutex` by `parking_lot::Mutex` and refactored implementation accordingly
- Replaced all `Mutex<T> where T: Copy` by `crossbeam::AtomicCell<T>` and refactored implementation accordingly
2024-09-11 22:39:53 +02:00
Snowiiii
c8fee9b23c Try to solve Pumpkin's locking problem 2024-09-09 21:12:49 +02:00
Edvin Bryntesson
b0f1e60e46 Add a PumpkinError trait, and implement it for InventoryError and DeserializerError 2024-09-09 12:51:55 +02:00
lukas0008
fa114e7e23 Cleanup Server struct
This cleanup's goal is to make all `Server` functions only require &self. This means that `Server` can now be a `Arc<Server>` instead of `Arc<Mutex<Server>>`, which solves a lot of deadlock problems.
2024-09-08 17:44:09 +02:00
Edvin Bryntesson
59a950c606 a bit of refactor, and actually enforce player inventory condition rules on handle_item_change 2024-09-07 18:13:38 +02:00
Edvin Bryntesson
3b6fc48a0f add error handling to Click functions 2024-09-07 16:31:24 +02:00
Edvin Bryntesson
814b48a485 remove debug leftover 2024-09-07 16:27:38 +02:00
Edvin Bryntesson
c6dbc3d00f move around dependencies to match project spec 2024-09-07 16:03:11 +02:00
Edvin Bryntesson
72d95cd416 Merge branch 'master' into master 2024-09-06 21:55:47 +02:00
Edvin Bryntesson
3b93892f26 start trying to drag, it doesn't work though 2024-09-06 21:50:23 +02:00
Edvin Bryntesson
2acd1ed02a refactored state_id to PlayerInventory 2024-09-06 17:53:23 +02:00
Alexander Medvedev
dad4798844 Update deps 2024-09-06 11:34:59 +01:00
DaniD3v
e08309aacd Removed unused #[allow()]'s 2024-09-06 11:19:52 +02:00
Edvin Bryntesson
d07eec2245 fix so that it actually always updates both clients 2024-09-05 23:34:11 +02:00
Edvin Bryntesson
602c1c0859 clippy + format 2024-09-05 16:46:30 +02:00
Edvin Bryntesson
516ef3021f add sending packets on container change 2024-09-05 16:12:50 +02:00
Edvin Bryntesson
db70ea1cbf add checking gamemode for middleclick dragging 2024-09-05 14:58:48 +02:00
Edvin Bryntesson
4551d0bd0d clippy and format 2024-09-05 14:57:11 +02:00
Edvin Bryntesson
bb6677dd19 add drag and error handling for containers 2024-09-05 14:54:38 +02:00
Edvin Bryntesson
28292439de refactor away unnecessary abstraction 2024-09-03 09:02:28 +02:00
Edvin Bryntesson
d1c4e59955 add working container state and change to fix with latest current branch 2024-09-02 15:15:26 +02:00
Edvin Bryntesson
f465bc06d8 change to use correct function 2024-08-31 13:26:07 +02:00
Edvin Bryntesson
d213fad067 make window_type static in trait 2024-08-31 13:25:53 +02:00
Edvin Bryntesson
1d065645e1 add state id 2024-08-31 13:24:58 +02:00
Edvin Bryntesson
f34a483118 fix lints 2024-08-31 11:44:47 +02:00
Edvin Bryntesson
53c3a013c2 add OpenedContainer to Server
we will store all opened containers there until closed by all players, and when closed we will save contents to the block in the world. We should implement Drop for OpenedContainer to achieve this.
2024-08-31 11:41:13 +02:00
Edvin Bryntesson
d7e059cb86 refactor to make SClickContainer work in containers other than inventory 2024-08-28 09:58:35 +02:00
Edvin Bryntesson
0f9ac2259c add creative pick item to packet SClickContainer 2024-08-27 10:30:33 +02:00
Edvin Bryntesson
e0a20c1194 Add all functionality of mode zero for packet SClickContainer 2024-08-26 12:58:12 +02:00
Edvin Bryntesson
b90fd4c62d add debug of mouse_click 2024-08-26 08:48:35 +02:00
Edvin Bryntesson
c968131e04 make packet public and more abstraction thing 2024-08-25 11:48:24 +02:00
Edvin Bryntesson
c408244b37 pass CI 2024-08-24 20:05:49 +02:00
Edvin Bryntesson
83231f4271 add container click abstraction 2024-08-24 19:15:26 +02:00
Edvin Bryntesson
3428f03a0f better name 2024-08-24 18:12:51 +02:00
Edvin Bryntesson
52943f66c8 Simply abstraction of property trait 2024-08-24 18:03:32 +02:00
Edvin Bryntesson
e1a7d4e7ee add serverbound packet SContainerClose 2024-08-23 12:30:24 +02:00
Edvin Bryntesson
98fcd412c2 formatting 2024-08-23 11:52:21 +02:00
Edvin Bryntesson
1d1dcc6a85 make window property abstractions 2024-08-23 11:51:37 +02:00
Luk-ESC
d85e9bcbad fix set_slot armor indexing 2024-08-22 18:40:43 +02:00
Edvin Bryntesson
7818f83ea2 fix lints 2024-08-21 19:38:19 +02:00