Skip to content

Properly address NBT desync bug, improve keyhandler, and add server-to-client config sync - #484

Open
TheBuilderBoy76 wants to merge 7 commits into
age-series:mainfrom
TheBuilderBoy76:improvements/NBT-desync-and-related
Open

Properly address NBT desync bug, improve keyhandler, and add server-to-client config sync#484
TheBuilderBoy76 wants to merge 7 commits into
age-series:mainfrom
TheBuilderBoy76:improvements/NBT-desync-and-related

Conversation

@TheBuilderBoy76

Copy link
Copy Markdown
Contributor
  1. Properly address NBT desync bug: The server now detects when a player has a lamp socket/floodlight GUI open and/or is holding either shift key. If both of these conditions are true, all bulb(s) within the particular lamp socket/floodlight stop losing life (meaning they stop updating their NBT tags). Thus, when the player shift-clicks a bulb out of a lamp socket/floodlight, its NBT tag has had time to sync between the server and the client, so it is not duplicated. Additionally, this behavior is multiplayer-safe - if two players have the same GUI open and one player is holding shift, bulbs in that container stop losing life for both players.
  2. Improve keyhandler: The ELN keyhandler now maintains a unique server-side list of which keys are pressed for each connected client. Essentially, this means that if one player is holding the wrench key (for example), wrench mode is no longer enabled for every player on the server. Also, the ELN keyhandler can be programmed to listen to certain keys (like the shift keys) without creating keybind entries. This is mainly useful for the NBT desync fix mentioned above, where the relevant keys are hardcoded into Minecraft's code. Finally, the ELN keyhandler can also be programmed to listen for key presses within GUIs. Again, this is really only useful for the NBT desync fix.
  3. Add server-to-client config sync: The server now has the ability to send certain config entries to all connected clients, where the clients are expected to use these config entries in place of their own in certain contexts. At the moment, only the "debug.logging.enabled" config entry is sent to clients from the server in order to force clients to display certain additional item tooltips. This mirrors the behavior of wailaEasyMode, where the server controls what the client is able to display. Server config entries are sent to all clients every time a new client connects, as well as every time a client executes the /eln config or /eln debug commands.
  4. Other miscellaneous changes: When in debug mode, the wrench key (as defined by the client-side keybind) can be used to activate both the information and realism tooltips for all ELN items. This was used for testing the NBT desync fix, but it is still a useful feature to keep around. Also, all raw JsonConfig reads of "debug.logging.enabled" and "ui.waila.easyMode" have been replaced with calls to isDebugEnabled() and isWailaEasyModeEnabled(), respectively, in Utils.kt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant