Traveler's Backpack

Traveler's Backpack

26M Downloads

[Fabric] If Trinkets integration is set to true, clients connecting to servers will not be able to use backpacks unless they join a single-player world first

SplendidAlakey opened this issue · 11 comments

commented

Describe the bug

When Trinkets integration is enabled on both the server and the client, the client will not be able to open backpacks at all. The client must join a single-player world first and then join multiplayer for it to work properly.

To Reproduce

Steps to reproduce the behavior:

  1. Enable Trinkets integration on both the server and the client
  2. Join the server and try to open a backpack - nothing will happen
  3. Leave the server and join a single-player world
  4. Leave the single-player world and rejoin the server - now everything works as intended

Expected behavior

Clients should be able to use backpacks in multiplayer without joining single-player first.

Logs

I personally don't see any related information in the logs, but in case it can be useful:

Required information (please complete the following information):

  • Mod version: travelers-backpack-1.17.1-6.0.0
  • Fabric: loader 0.12.3; API 0.41.3

Additional context

There is another mod that I know of that had a similar issue, Consistency+ (they resolved their issue here TropheusJ/stonecutter-recipe-tags#1). Stone cutter recipes were missing until the client joined a single-player world and then multiplayer. If it's the same sort of issue, maybe it could be helpful somehow.

commented

I can confirm that this issue has persisted into the 1.18.1 Fabric version as well. Players on multiplayer servers are unable to use backpacks unless joining a singleplayer instance first.

After some testing, it appears this issue is regardless of Trinkets integration or not. I seem to have found a workaround that enables backpacks to work on multiplayer servers, but it requires the use of 2 backpacks at the same time and feels quite janky.

With both client and server config set to "trinketsIntegration": false, the backpack is unusable as intended. If you right-click the backpack and click the green arrow to equip, the backpack remains unusable. However, if you then use a second backpack and equip it in the Trinkets slot (which it accepts despite the config being false), I am able to open the backpack and use as intended. This workaround solution works regardless of trinketsIntegration being set to false or to true. In both instances, 2 backpacks are needed: 1 in the trinkets slot, 1 in the integrated Traveler's Backpack equip method. (This only results in 1 backpack inventory being usable, this doesn't duplicate any items. When you removed both backpacks, the one that was in the Trinkets slot is empty.) To remove the backpacks, you need to remove the Traveler's Backpack equipped one first, using the green arrow in the GUI to remove. Then you can remove the one from your Trinkets slot as well.

This workaround makes the Traveler's Backpack most usable as intended, however the sleeping bag does not render unless your right-click where the sleeping bag is supposed to be, then the sleeping bag appears.

I hope this explanation makes sense and is helpful! I can try to record some gameplay to document the workaround if my explanation was poorly worded, or if that would help find a fix.

Thank you!

commented

Would be great if the developer would respond to this major issue :)

commented

this is a fairly easy fix, but implementing the fix on an old code branch is not ideal. Hopefully the issue is either fixed or the code is uploaded so it can be fixed there. alternatively, The older code is released under LGPL so it can be re-ported and fixed, but i would prefer to leave it in the hands of the active developer.

commented

@Linguardium I've uploaded most of the current code on the GitHub, to be honest I have no clue how to fix that syncing issue, althrough I'm working on it. If you know how to fix it, and you are able to help me with that, I'd be very glad.

commented

@Tiviacz1337
The issue is that you tell it to only load the config on server start, which doesnt happen on clientside. you then check the config values (which are unset) on the client for rendering and backpack opening. Since the trinket integration is a boolean, it defaults to false so the client never checks the trinket slots and fails to find a backpack in the backpack slot.

There are a couple ways to resolve this, i went the route of doing an initial load of the config on server and client, then sending a custom packet to sync the server configs when a client connects or when datapacks are reloaded.

Is there any reason you are deferring initial load to the server start instead of immediately? i understand the reload trigger, thats fine, but the initial config load is only done once the server has already loaded which seems a bit late for some of the features and integration into loot tables and such.

commented

but the initial config load is only done once the server has already loaded which seems a bit late for some of the features and integration into loot tables and such.

That's was just my bad, I don't like all this config stuff and just messed up there.
Anyways, your patch works really great. Thank you so much for helping me with this issue! I'll release update today or tomorrow with this bug patched

commented

The issue I'm having is very much like this issue. I reported another github before reading this one. I can't wait to see this resolved. :)

commented
commented

Did you fix this by sending the config in the play packet, not the login packet? Curious, because the same issue was affecting another mod that I just reported.

commented

Packet is being sent when player joins server - that's what I see from Linguardium pull request
8ef3202#diff-273f304da505c5337a80cace13568dc5f22201bde7c986c5733242d8774a000eR41-R45 here

commented

Excellent, thank you. I'll send that code example to the other mod dev, see if they can't adapt it.