Geyser
Geyser copied to clipboard
Use entities for single chest inventories, check if a block for serve…
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)
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
Is it any different if you use a boat chest as the base entity?
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
What's the maximum range for blocks to work as inventories?
5 - actually 6, but because of rounding 5 works always
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.
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