1217 Commits

Author SHA1 Message Date
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
1ecb10acba
Merge branch 'next-minor' into next-major 2022-08-21 19:19:07 +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
43a3151de3
Merge branch 'next-minor' into next-major 2022-08-14 18:49:19 +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 2b61c025c26394c3293bcc12a2d0b2301cb4c7ee.
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
c8a8e33fc1
Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +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
f6c9bf5cd1
Merge branch 'next-minor' into next-major 2022-07-20 20:55:33 +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
172bd9a129
... 2022-07-17 21:24:27 +01:00
Dylan K. Taylor
012b668537
Avoid bogus assumptions about block and item NBT on tiles 2022-07-17 21:23:41 +01:00
Dylan K. Taylor
259f44e57c
Merge branch 'next-minor' into next-major 2022-07-14 22:05:04 +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
e5804df24b
Merge branch 'next-minor' into next-major 2022-07-14 20:59:13 +01:00
Dylan K. Taylor
e00f8e3a32
Merge branch 'stable' into next-minor 2022-07-14 20:59:06 +01:00
Dylan K. Taylor
c8320fe849
Merge branch 'next-minor' into next-major 2022-07-14 20:50:49 +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
eb8fb63409
Added cartography and smithing tables
these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
2022-07-14 18:01:47 +01:00
Dylan K. Taylor
dea0207e4e
Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
Dylan K. Taylor
06655bee78
Updated to 1.19.10 2022-07-13 00:59:49 +01:00
Dylan K. Taylor
2ba51567d8
RuntimeBlockMapping: avoid keeping two copies of the same blockstate data in memory 2022-07-10 17:41:01 +01:00
Dylan K. Taylor
ccb3c3cb05
BlockStateData: use array<Tag> instead of CompoundTag to store state properties
this reduces the footprint of RuntimeBlockMapping by a further 1 MB, as well as simplifying various parts of the code, and solidifying the immutability guarantee of BlockStateData.
2022-07-09 16:03:51 +01:00
Dylan K. Taylor
151f2c3f3a
BlockStateDictionary: reduce memory footprint by 5 MB by deduplicating blockstate NBT keys and values 2022-07-08 21:51:44 +01:00
Dylan K. Taylor
a8728a02f6
BlockStateDictionary: extract a more generic helper method for decoding block palette files 2022-07-06 14:37:46 +01:00
Dylan K. Taylor
68cbe46600
Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
Dylan K. Taylor
9f0b32e748
Updated creative and crafting data to 1.19 2022-07-04 20:28:07 +01:00
Dylan K. Taylor
405e552efd
ItemTranslator: use GlobalItemDataHandlers
this ensures that plugin serializers will actually be used on the network.
2022-07-04 15:47:28 +01:00
Dylan K. Taylor
d9c61f0492
Publish script used to generate ItemTypeIds 2022-07-04 15:43:13 +01:00
Dylan K. Taylor
323c563684
Break Block's dependence on ItemFactory, and item legacy IDs
let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
2022-07-02 17:29:28 +01:00
Dylan K. Taylor
7994da07be
Crafting recipe network serialization no longer depends on PM's internal legacy metadata
WOOOOOOOOOOOOOOOOOOOOOOHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!
2022-07-02 16:37:43 +01:00
Dylan K. Taylor
5e4e5147d9
Remove ItemFactory involvement from brewing
this involves a very nasty hack for potion container change, but for the time being it can't be helped.
2022-06-29 16:11:15 +01:00
Dylan K. Taylor
2cb722b674
Fixed durability handling (ish) 2022-06-29 15:17:16 +01:00
Dylan K. Taylor
541a624d48
ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items 2022-06-27 17:14:43 +01:00
Dylan K. Taylor
55cb68e5b5
Burn meta wildcards from Item, allow more dynamic recipe inputs
this was an obstacle for getting rid of legacy item IDs.
2022-06-27 13:33:26 +01:00
Dylan K. Taylor
bc5a600d59
Added item stack serialize/deserialize methods 2022-06-26 17:02:55 +01:00