Commit Graph

117 Commits

Author SHA1 Message Date
Snowiiii
bcbde20623 Make Logging configurable 2024-10-11 16:41:52 +02:00
Snowiiii
9ac4bdbd50 Add Living Entity struct 2024-10-11 12:54:42 +02:00
Alexander Medvedev
4967e9aa37 New clipps lints 2024-10-08 20:02:56 +01:00
kralverde
b7b975a064 rebase block_id 2024-09-28 17:39:11 -04:00
Snowiiii
1ddaca1406 Allow disable encryption 2024-09-28 13:03:31 +02:00
Snowiiii
14a13435c1 less clones 2024-09-19 23:13:45 +02:00
StripedMonkey
c13261ba20 standardize use of compact serialization for UUIDs. 2024-09-12 18:02:55 -04:00
Snowiiii
f9bf750b65 Add Clientbound Entity Status 2024-09-12 15:42:26 +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
ada0d82a72 Added Container back 2024-09-10 09:57:54 +02:00
Snowiiii
e5bfbce2ce Fix dead locks 2024-09-09 23:22:55 +02:00
Snowiiii
c8fee9b23c Try to solve Pumpkin's locking problem 2024-09-09 21:12:49 +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
Alexander Medvedev
8b29d9e763 Merge pull request #60 from Bryntet/master
Add packet SClickContainer and abstractions
2024-09-08 14:50:50 +01:00
Snowiiii
39b4cb3ac9 Move world into entity
Also fixes most of error when leaving while chunks are loading
2024-09-07 22:39:42 +02:00
Edvin Bryntesson
33a5a10f34 Merge branch 'master' into master 2024-09-07 20:42:52 +02:00
Snowiiii
3d14e1310b Command system rewrite
Note: Help commands is currently disabled
2024-09-07 20:26:19 +02:00
Snowiiii
2ee9710f93 Refactor Entity 2024-09-07 19:33:01 +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
2acd1ed02a refactored state_id to PlayerInventory 2024-09-06 17:53:23 +02:00
Edvin Bryntesson
55765fccc1 Merge remote-tracking branch 'upstream/master' 2024-09-05 16:37:42 +02:00
StripedMonkey
4dce8aa90d Allow From<Vec3<T>> for (_,_,_) for easy destructuring. 2024-09-04 21:52:42 -04:00
StripedMonkey
dc093f4a21 remove unnecessary references
It's already a usize, so the references are meaningless when the pointer is the same size as the type.
2024-09-04 21:52:42 -04:00
StripedMonkey
f47b8a1ed1 Eliminate Unnecessary Arc<Token>
Tokens already implement copy and clone, keeping a shared reference to the token doesn't actually do anything, and is larger than a token is to begin with.

clone copies
2024-09-03 17:41:21 -04:00
Edvin Bryntesson
d1c4e59955 add working container state and change to fix with latest current branch 2024-09-02 15:15:26 +02:00
Snowiiii
5c0dffbf9d Dynamic chunk loading 2024-09-01 18:04:27 +02:00
DaniD3v
070a50833b Moved config into its own crate 2024-08-31 19:38:47 +02:00
DaniD3v
2fbf450ed3 Moved GameMode into pumpkin-core 2024-08-31 19:33:47 +02:00
DaniD3v
bb543b7178 Moved configuration to LazyLock 2024-08-31 19:29:22 +02:00
Snowiiii
ee4e18282e Support multiple worlds
- We moved all players to seperate worlds. This will save performance when many different players are on different worlds. The only thing broken now are commands because of async stuff
2024-08-31 11:39:59 +02:00
Snowiiii
3cc0c9a52a Broadcast Sneaking/Sprinting
For some reason Sneaking "partially" works. Only the player names becomes darker when sneaking but the actual pose does not change. Weird
2024-08-29 22:43:43 +02:00
Snowiiii
c36b6d3464 Less unwraps 2024-08-28 18:52:30 +02:00
DaniD3v
cf283323fc BlockId refactor.
Moved `BlockId` to it's own file.
Prefixed all of the `block_registry` types with Registry to avoid confusion.
Made stuff that should not be public private.
2024-08-28 12:52:19 +02:00
DaniD3v
43164ee4f1 Added abstraction for BlockId
`i32` is really ambiguous and it is not immediately obvious what it is supposed to represent.
`BlockId` is much more readable.

Changed internal type to u16 because we currently have ~30k/64k block states.
(and i32 doesn't make a lot of sense for an Id, except when replicating mojang behavior)
2024-08-28 12:52:07 +02:00
Alexander Medvedev
52ffec0dd3 Merge pull request #61 from neeleshpoli/master
Implement Use Item (packet id 0x39) packet
2024-08-25 21:48:23 +01:00
Snowiiii
9d6c8dc524 Check block distance 2024-08-25 19:16:38 +02:00
we sell insurance
983ede2ef6 Create function for packet handling 2024-08-25 10:52:20 -05:00
Snowiiii
83aad86005 Made everything thread safe
- Also improved gamemode command
- We now can use Server in commands
2024-08-25 13:20:49 +02:00
Snowiiii
ddd3f1e781 Add Serverbound Set Player On Ground 2024-08-25 12:06:09 +02:00
Snowiiii
80477f9aab fix: clippy warns 2024-08-25 00:19:16 +02:00
Snowiiii
d8fd1dd00b Improve teleport
we now use teleport id's and also set player position when receiving the response packet
2024-08-24 23:51:01 +02:00
Snowiiii
d69f6c5fc1 Add Clientbound Teleport Entity
usually used when Player moves more than 8 blocks
2024-08-24 23:07:12 +02:00
Edvin Bryntesson
bae9198980 fix issues 2024-08-24 18:09:27 +02:00
Bryntet
67dd35e0cb Merge branch 'master' into master 2024-08-24 18:04:40 +02:00
Edvin Bryntesson
52943f66c8 Simply abstraction of property trait 2024-08-24 18:03:32 +02:00
Snowiiii
c7f15dee3d Refactor Client 2024-08-24 14:51:43 +02:00
StripedMonkey
8494388324 entitiy -> entity 2024-08-23 07:54:36 -04:00
StripedMonkey
51da48d937 hourse -> Horse 2024-08-23 07:52:24 -04:00
Edvin Bryntesson
ef21b3ae40 add serverbound packet SContainerClose 2024-08-23 12:36:22 +02:00