Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Use entities for single chest inventories, check if a block for serve…

Open valaphee opened this issue 1 year ago • 2 comments

Description

This fixes https://github.com/GeyserMC/Geyser/issues/3271 by using entities for single chest inventories or checking if a block for server-side opened inventories can be placed either above or below, otherwise, close the inventory (same logic as with inventory translator found). And extending the placing distance to allow, 5 blocks (maximum reach distance) above or below fake invs to be opened.

Testing

Has been tested on Waterfall with a 1.8 ViaVersion server (upper and lower limit)

valaphee avatar Sep 10 '22 09:09 valaphee

It seems that the InventoryContentPacket doesn't work for entity-based inventories, or it takes more time as a block inventory for the inv to be created, therefore I reverted this change

valaphee avatar Sep 12 '22 10:09 valaphee

Is it any different if you use a boat chest as the base entity?

Camotoy avatar Sep 12 '22 17:09 Camotoy

Still same problem with entity-based inventories, they need some delay between entity creation - inventory opening, otherwise the content is ignored, or the inventory opening is delayed internally in Minecraftl, and therefore ignores the content

valaphee avatar Sep 25 '22 17:09 valaphee

What's the maximum range for blocks to work as inventories?

Camotoy avatar Sep 25 '22 19:09 Camotoy

5 - actually 6, but because of rounding 5 works always

valaphee avatar Sep 25 '22 19:09 valaphee

OK. My worry is that we extend the range and then there's more edge cases where people are opening inventories as they're jumping and the inventory stops working.

Camotoy avatar Sep 25 '22 19:09 Camotoy

Should not be a problem except maybe when you jump at max world height (but as I said its actually reduced to 5 to be safe and but this should be a very rare case), and falling but there we cant do anything, except use entities, and synchronize their movement with the player

Swimming would also be an "edge" case

valaphee avatar Sep 25 '22 20:09 valaphee