1268 Commits

Author SHA1 Message Date
Javier León
d3add78d3e
Add support for basic entity picking via middle-click (#5397)
Support for more advanced stuff like NBT copying wasn't added in this PR, as the NBT used by PM is currently an inconsistent mess and doesn't play nice with vanilla. In the interests of avoiding this mess propagating, it's been left for another time.

Adds PlayerEntityPickEvent a la PlayerBlockPickEvent
and Entity->getPickedItem().
2024-11-15 21:27:10 +00:00
Dylan T.
ff695a5f97
PlayerInteractEvent: added APIs to independently control reaction of item and block (#4683)
This allows, for example, banning the usage of spawn eggs, without preventing opening of doors, without the need for item ID whitelists.

It also allows customizing the behaviour of item and block interactions when sneaking - it's now possible to force spawn eggs to work when sneaking, or force containers to open.

Finally, this also allows preventing any interaction at all without preventing block placement (by setting both to false). Since cancelling the event will typically prevent placement too (which might not be desired).

Side note: Blocks are now always synced when right-clicking on a block.
This differs from the previous behaviour, where the blocks were only synced when the action "failed".
However, since this change introduces a situation where the action may succeed but have different results than the client expects, it's best to just always sync blocks in this situation.

Fixes #3267
2024-11-15 21:19:54 +00:00
Dylan K. Taylor
c63d0ef1b6
Fix dodgy ignored PHPStan error 2024-11-03 14:43:34 +00:00
Dylan K. Taylor
3c96e72f7d
Merge remote-tracking branch 'origin/stable' into minor-next 2024-11-03 14:01:47 +00:00
Dries C
4814db4fe7
Assemble 1.21.40 (#6471) 2024-10-25 14:21:51 +01:00
ipad54
f6e6f15c63
Implemented a proper way to handle items cooldown (#6405) 2024-09-25 13:28:17 -05:00
github-actions
a4a07a8e5a Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/10986731877
2024-09-23 02:36:00 +00:00
Dries C
60cac18104
Assemble 1.21.30 (#6453) 2024-09-20 18:47:25 -05:00
Dries C
ede363eb0f
Fix shift crafting (#6433)
This field was added to the action in 1.21.20. Previously, the client would behave as if clicking the crafting result slot many times. Now it behaves more like recipe book shift-clicking.
2024-08-22 21:53:21 +01:00
IvanCraft623
92f380bb9c
Merge branch 'stable' into sync-minor-next 2024-08-17 11:17:48 -05:00
Dries C
0f365886e0
Assemble 1.21.20 (#6423)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
Co-authored-by: IvanCraft623 <ivancraft623@gmail.com>
2024-08-16 11:26:49 +01:00
Dylan T
ef9791eaed
Merge pull request #6397 from pmmp/stable
Merge branch 'stable' into minor-next
2024-07-10 18:56:52 +01:00
IvanCraft623
5d60ba36b7
Support for 1.21.2 2024-07-09 21:07:47 -05:00
ipad54
2ffc38c835
Implement campfire & soul campfire (#4696) 2024-07-07 15:01:34 -05:00
Dylan K. Taylor
f121654452
Assemble 1.21.0 2024-06-13 18:41:41 +01:00
Dylan K. Taylor
6077748caa
Changes for 1.20.80 2024-04-25 11:31:41 +01:00
Dylan K. Taylor
a835069564
Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-14 12:47:04 +00:00
Dylan K. Taylor
b77193b987
ZlibCompressor: Increase max decompression size to accommodate larger skins
again, very annoying that we have to account for this (it makes it easier for attackers to waste CPU time and memory), but we don't really have much of a choice.
2024-03-14 12:34:30 +00:00
Dylan K. Taylor
11ca208d93
RakLib: Allow larger number of split packet parts
some persona skins are insanely bloated and get split into hundreds of parts.
it's quite annoying that we have to accommodate this, but we can't keep allowing players to experience login timeouts without an obvious indication what's wrong.
2024-03-14 12:32:26 +00:00
Dylan K. Taylor
ba48f258f3
Support for 1.20.70 2024-03-13 14:53:27 +00:00
Dylan K. Taylor
dbc7105e5b
Merge branch 'resource-pack-ack-receipts' into minor-next 2024-03-04 15:46:31 +00:00
Dylan K. Taylor
3b97d067a3
Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-04 15:40:10 +00:00
Dylan K. Taylor
5cb69e00d0
NetworkSession: remove hardcoded limit
this is already covered by the dynamic Game Packets rate limit, which is much more effective at dealing with this anyway.
2024-03-04 14:36:40 +00:00
Dylan K. Taylor
781e3643dd
Clean up 2024-03-04 14:25:47 +00:00
Dylan K. Taylor
72f3c0b4b9
NetworkSession: fixed timings not being stopped when handling uncompressed packets 2024-03-01 17:36:40 +00:00
Dylan K. Taylor
b9a1ef1357
Throttle resource pack sending using ack receipts
this isn't the best solution, as it limits the download speed somewhat, but it's relatively simple and works quite well.
closes #3127
2024-03-01 17:07:19 +00:00
Dylan K. Taylor
4abc36275c
Remove newline 2024-03-01 17:02:44 +00:00
Dylan K. Taylor
4b5ac53276
Fixes 2024-03-01 17:01:32 +00:00
Jason Wynn
90409b50d1
Allow offering different resource packs to different players (#6249)
closes #6248
2024-03-01 14:53:59 +00:00
Dylan K. Taylor
bc2abf4b15
First shot at packet ack receipt support
this will be useful for preventing resource pack sending from overloading the network.
it's not the best solution for that (since it means the RTT will limit the pack download speed), but it's easier than implementing congestion control and will work fine in most cases.
2024-03-01 14:41:53 +00:00
Dylan K. Taylor
98042f844f
Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-28 17:36:21 +00:00
Dylan K. Taylor
a0cca53f52
Fixed mismatched predictions due to NBT key order differences
this is a pain :(
It appears the client always sorts the keys in alphabetical order due to use of std::map. However I'm not sure of the exact ordering behaviour, so it needs to be investigated.
2024-02-27 16:07:43 +00:00
Dylan K. Taylor
efd113bdc8
Integrate pmmp/BedrockProtocol@65b3d0b341 2024-02-26 17:09:09 +00:00
Dylan K. Taylor
47f0119660
InGamePacketHandler: added an extra check 2024-02-26 14:35:21 +00:00
Dylan K. Taylor
6872661fd0
Harden JsonMapper on login JSON handling 2024-02-23 14:10:02 +00:00
Dylan K. Taylor
d211392b67
Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-12 11:46:48 +00:00
Dylan K. Taylor
eaab1a8784
ChunkSerializer: fixed count calculation for non-overworld chunks
plugins that implement dimensions can't change the number of subchunks used by Chunk, they can only choose to use a subset of them.
2024-02-07 18:58:41 +00:00
Dylan K. Taylor
4fcb644c51
Added missing imports 2024-02-07 12:51:39 +00:00
Dylan K. Taylor
6492e7f4a2
1.20.60 support 2024-02-07 12:33:44 +00:00
GameParrot
5386e86079
ProcessLoginTask: remove old root key (#6211) 2024-01-03 12:50:05 +00:00
Dylan K. Taylor
e1f4fd3048
ProcessLoginTask: remove dead comments
This is no longer an issue since b2df405cc0355dcffe202bc4040fae316940d427.
2023-12-15 16:01:43 +00:00
Dylan K. Taylor
06b2e61d3c
Merge remote-tracking branch 'origin/stable' into minor-next 2023-12-14 14:02:15 +00:00
Dylan K. Taylor
25cca1b63f
Changes for 1.20.50 2023-12-06 14:29:23 +00:00
Dylan K. Taylor
b2df405cc0
NetworkSession: Send less information to clients on error disconnects
in particular, the information from VerifyLoginTask shouldn't be sent to clients, as it could contain sensitive information.
This change only affects disconnection screens. The server log shows the same amount of information as before (though formatted differently in some cases).
2023-11-29 16:31:59 +00:00
Dylan K. Taylor
a1748a92ca
Avoid unnecessary TypeConverter::getInstance() calls
we already have it available within these contexts
2023-11-17 14:00:25 +00:00
Dylan K. Taylor
0f620fad94
ChunkCache: inline unnecessary function 2023-11-17 13:30:44 +00:00
Dylan K. Taylor
bc07778434
Avoid unnecessary CompressBatchPromise allocations for sync-prepared batches
Sync-prepared batches account for the vast majority of outbound packets. Avoiding these useless objects further reduces the overhead of zero-compressed packets, as the creation of these objects is a significant part of the overhead for these cases.

closes #6157
2023-11-17 12:35:42 +00:00
Dylan K. Taylor
e3700cab50
ZlibCompressor: use libdeflate for level 0 compression
this is supported since libdeflate 1.15 and ext-libdeflate 0.2.0.
Everyone should be using these versions by now anyway, and if they aren't, they should update.

libdeflate's level 0 compression is over 20 times faster than zlib, so this is a nice performance improvement.
2023-11-09 18:05:07 +00:00
Dylan K. Taylor
b41960dfec
Merge branch 'stable' into minor-next 2023-10-26 12:55:47 +01:00
Dylan K. Taylor
53a740433f
Changes for 1.20.40 2023-10-26 12:32:59 +01:00