Commit Graph

952 Commits

Author SHA1 Message Date
Dylan K. Taylor
5b89833d5c Merge branch 'stable' into next-minor 2022-08-27 17:27:15 +01:00
Dylan K. Taylor
fb25e05416 InventoryManager: fixed current window getting removed in race conditions with close window ACK
this could be observed by pressing E and immediately clicking a chest, which, if timed correctly, would lead to the chest lid closing, but the inventory being opened anyway.
2022-08-27 17:26:43 +01:00
Dylan K. Taylor
3235d128e5 Fixed handling of fake requests during block placement and other actions 2022-08-18 18:25:49 +01:00
Dylan K. Taylor
2b7510945a First look at ItemStackRequest usage (very unstable) 2022-08-18 17:38:57 +01:00
Dylan K. Taylor
d6af2b12f4 Merge branch 'complex-inventory-rewrite' into next-minor 2022-08-18 17:30:00 +01:00
Dylan K. Taylor
ad2d59923c Merge branch 'stable' into next-minor 2022-08-18 17:06:15 +01:00
Dylan K. Taylor
e90abecf38 Rewrite InventoryManager handling of complex mapped inventories
this turned out to be necessary when dealing with the ItemStackRequest system.
2022-08-17 14:42:30 +01:00
Dylan K. Taylor
dce8bd6d21 CS: Standardize new with braces 2022-08-15 17:16:23 +01:00
Dylan K. Taylor
f7ab0a3b92 Merge branch 'stable' into next-minor 2022-08-14 18:37:56 +01:00
Dylan K. Taylor
036e06e889 Revert "Workaround items in blockentity NBT not being processed correctly in 1.19.10"
This reverts commit 2b61c025c2.
2022-08-14 17:25:55 +01:00
Dylan K. Taylor
df7a1fcba6 Changes for 1.19.20 2022-08-09 19:06:05 +01:00
Dylan K. Taylor
16ed16722a Merge branch 'stable' into next-minor 2022-07-24 21:21:37 +01:00
Dylan K. Taylor
42f9336f7a Split packet receive timings into decode and handle subcomponents 2022-07-24 21:16:52 +01:00
Dylan K. Taylor
5d9f783037 InGamePacketHandler: do not update player rotation if it didn't change
setRotation() does an alarmingly large amount of work...
2022-07-24 21:07:35 +01:00
Dylan K. Taylor
01ca14c314 InGamePacketHandler: avoid processing movement if position is unchanged since last tick 2022-07-24 21:00:12 +01:00
Dylan K. Taylor
c26631d06d InGamePacketHandler: avoid useless object allocations when forceMoveSync=false (99.9% of the time) 2022-07-24 20:44:27 +01:00
Dylan K. Taylor
b75bc61a64 InGamePacketHandler: don't bother checking for flag changes if the flag fields are identical
we don't need to check this on a bit by bit level if the integers are the same.

this saves 2-3 microseconds per packet on my machine, which doesn't sound like much, but it adds up when there are lots of players.
2022-07-24 20:35:49 +01:00
Dylan K. Taylor
3724479be3 InGamePacketHandler: improve performance of input flag resolving 2022-07-24 20:33:35 +01:00
Dylan K. Taylor
2940547026 Eliminate repeated calls to Position->getWorld()
as well as improving readability, it also improves performance in some areas.
2022-07-20 20:44:05 +01:00
Dylan K. Taylor
93254523e6 Merge branch 'stable' into next-minor 2022-07-14 22:04:38 +01:00
Dylan K. Taylor
2b61c025c2 Workaround items in blockentity NBT not being processed correctly in 1.19.10
closes #5154

this hack sends only the bare essential data to create the tiles in LevelChunkPacket,
and then separately sending the full tile data using BlockActorDataPacket afterwards.

This is necessary because the client doesn't handle items correctly in NBT when chunks are sent without using the SubChunkRequest system.
In 4.6 this is observed with incorrect items shown in item frames; in 5.0 it's seen with items simply not showing up at all (difference due to modernization of the serialization format in 5.0).
2022-07-14 21:54:01 +01:00
Dylan K. Taylor
e00f8e3a32 Merge branch 'stable' into next-minor 2022-07-14 20:59:06 +01:00
Dylan K. Taylor
e2855aadff Simplify handling of broken transactions for crafting and friends
this allows stuff like smithing tables to work without needing any extra hacks.

Implementing enchanting or anvils would require some extra work, but I don't plan to implement those under the legacy transaction system anyway.
2022-07-14 20:50:06 +01:00
Dylan K. Taylor
c7133bc2e6 InGamePacketHandler: don't kick the player out of inventory windows on actor events
this is sent when the player crafts something using an anvil.
2022-07-14 20:36:11 +01:00
Dylan K. Taylor
06655bee78 Updated to 1.19.10 2022-07-13 00:59:49 +01:00
Dylan K. Taylor
4ec97d0f7a InGamePacketHandler: added missing break
I'm getting sloppy ...
2022-06-07 17:52:59 +01:00
Dylan K. Taylor
016a80bb70 1.19.0 changes 2022-06-07 17:47:13 +01:00
Dylan K. Taylor
5fd685e07d TypeConverter: fix crash on arbitrary out-of-bounds item IDs
I don't know why I didn't consider this fix necessary when the item meta bug was originally discovered.
2022-06-06 19:29:44 +01:00
Dylan K. Taylor
e040c2b281 InventoryManager: fixed windows not opening when the server removes windows
closes #5094
2022-06-05 16:03:24 +01:00
Dylan K. Taylor
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
3fcf6372e0 Merge branch 'stable' into next-minor 2022-06-01 15:32:37 +01:00
Dylan K. Taylor
227f28a6d2 Use VanillaItems::AIR() instead of ItemFactory 2022-05-24 15:47:27 +01:00
Dylan K. Taylor
179cac45f5 Merge branch 'stable' into next-minor 2022-05-22 16:21:05 +01:00
Dylan K. Taylor
fcb2ccab99 NetworkSession: Sync all attributes on respawn 2022-05-21 16:22:35 +01:00
Dylan K. Taylor
86efa0aae6 Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-20 17:49:04 +01:00
Dylan K. Taylor
554f96bc24 InventoryManager: Defer opening new windows to the client until the window close handshake has been completed
fixes #5021 and probably a bunch of other inventory related glitches

When the server initiates a window close, it does so by sending a ContainerClose to the client, which causes the
client to behave as if it initiated the close itself. It responds by sending a ContainerClose back to the server,
which the server is then expected to respond to.

Sending the client a new window before sending this final response creates buggy behaviour on the client, which
is problematic when switching windows. Therefore, we defer sending any new windows until after the client
responds to our window close instruction, so that we can complete the window handshake correctly.

This is a pile of complicated garbage that only exists because Mojang overengineered the process of opening and
closing inventory windows.
2022-05-20 16:54:15 +01:00
Dylan K. Taylor
df3a69dcb7 Modernize private property declarations in Threaded classes
I previously avoided this due to being unsure of the effects; however, it's clear that we already use typed properties on Threaded things in other places anyway, and the only known issues are with uninit properties, and arrays.
2022-05-17 22:42:18 +01:00
Dylan K. Taylor
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
Dylan K. Taylor
c0b15de504 Modernize private static property declarations 2022-05-17 21:55:16 +01:00
Dylan K. Taylor
6eac2ea7a5 Modernize private property declarations in src/network 2022-05-17 21:22:33 +01:00
Dylan K. Taylor
cd016bedce Network: Improve typeinfo for PHPStan on bannedIps 2022-05-17 21:19:48 +01:00
ipad54
1e59679ec2 Implemented Stonecutter (#4732) 2022-05-17 16:01:03 +01:00
Dylan K. Taylor
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
Dylan K. Taylor
33cf085692 PHPStan 1.6.3 2022-04-28 16:06:20 +01:00
Dylan K. Taylor
6b4687a36b RuntimeBlockMapping: unseal constructor to facilitate easier testing of new versions 2022-04-20 14:00:20 +01:00
Dylan K. Taylor
c085bf0db4 Changes for 1.18.30 2022-04-20 13:59:50 +01:00
Dylan K. Taylor
ded7e24f67 Merge branch 'stable' into next-minor 2022-04-19 15:27:55 +01:00
Dylan K. Taylor
4c9d2a989e cs again 2022-04-17 19:32:30 +01:00
Dylan K. Taylor
022db5cbe3 NetworkSession: compare usernames case-insensitively
the current data management system uses case-insensitive names, so we can't allow different players with the same name in different cases to join, or we will have duplication exploits.

This typically only applies to offline servers, since Xbox Live doesn't permit reuse of a username, same case or otherwise.

closes #4965
2022-04-17 19:28:10 +01:00
Dylan K. Taylor
e388cb1643 Merge branch 'stable' into next-minor 2022-04-10 21:23:04 +01:00