FamroFexl / ForceCrawl

Manually control when you crawl.
MIT License
3 stars 1 forks source link

Singleplayer integrated server only allows crawl control from the host. #3

Open FamroFexl opened 1 year ago

FamroFexl commented 1 year ago

Describe the bug An "Open to LAN" integrated server only has crawl control assigned to the host. The host determines if all other players can crawl based on if the host is crawling. Client-side crawling is not affected. The server doesn't acknowledge player guests are crawling, both visually and mechanically. When the host crawls, the player guests receive a slight pose stuttering, indicating the server is attempting to put them into crawl mode, but it is quickly overridden by the client.

Mod version affected 1.0.2

Other mods used Unknown except for fabric api

Minecraft version used 1.20

To Reproduce Set a single-player world "Open to LAN", have another player on, and have the host shift.

Additional information Other mod versions and Minecraft versions are likely affected as well

yermachello commented 1 year ago

Got the same issue on 1.19.2 quilt

yermachello commented 1 year ago

This is how it looks from a host perspective: javaw_4fZNr41xc8

FamroFexl commented 1 year ago

It's such an annoying bug. The real issue is that behavior on dedicated servers and integrated servers should be the same since both versions are basically identical, but it isn't. In all my testing, nothing has been amiss logically, so it's a very frustrating discrepancy.

FamroFexl commented 1 year ago

Crawling functionality is handled by the client-side implementation when using the integrated server for multiplayer. Both ServerPlayer and LocalPlayer instances are handled this way.

Since the client wasn't programmed to expect multiple players (and rather delegate that task to the server), it automatically forces all player instances to crawl at the request of the integrated server host. Because the client handles all player instances, the server-side doesn't process crawl request packets from guest clients, meaning they can only crawl through 1-block holes when the server host is crawling.

FamroFexl commented 2 months ago

The Crawl mod solves this issue by injecting a custom enum into the player pose states and passing it on the network. The Crawl On Demand mod solves this issue by using Forge's capability system.