-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player attachments not syncing to client properly on respawn #4475
Comments
After doing some digging I believe the [...]
//onPlayerRespawn snippet
this.startWorldLoading(clientPlayerEntity2, this.world, worldEntryReason);
clientPlayerEntity2.setId(clientPlayerEntity.getId());
this.client.player = clientPlayerEntity2; // I suggest mixing in into here
if (bl) {
this.client.getMusicTracker().stop();
}
[...] |
I had a look at that code but I think it is? The mixin targets that very field set already: see here. A minimal code example to reproduce the issue would help. |
After giving it a second look it seems like it should work, but doesn't. Edit 3: package net.fabricmc.fabric.impl.attachment;
[...]
public class AttachmentEntrypoint implements ModInitializer {
[...]
@Override
public void onInitialize() {
[...]
// Current
ServerPlayerEvents.COPY_FROM.register((oldPlayer, newPlayer, alive) ->
AttachmentTargetImpl.transfer(oldPlayer, newPlayer, !alive)
);
// Suggested change
ServerPlayerEvents.AFTER_RESPAWN.register((oldPlayer, newPlayer, alive) ->
AttachmentTargetImpl.transfer(oldPlayer, newPlayer, !alive)
);
[...]
} Edit 2: Edit: |
I was clearly wrong as the problem had nothing to do with the mixin I mentioned. |
While developing a mod using the v1 attachments API I've encountered a bug.
Where the server after respawing a player doesn't properly sync attachments to the client.
I believe it only affects client side, generating a stack trace for each attachment, linked below.
I suspect that the packet is sent during the wrong client phase.
I'm happy to provide more relevant information if needed.
Below I include the versions I use, logs, and a workaround I made, that doesn't address the root of the problem, and is only a band-aid solution.
Versions:
Minecraft - 1.21.4
Yarn - 1.21.4+build.8
Fabric Loader - 0.16.10
Fabric API - 0.118.0+1.21.4
A very basic workaround:
I set a constant delay of 100ms which fixes the issue
https://gist.github.com/bejker123/ff2daeeef96fe824d24e4c87b6a2004e
Relevant Logs:
https://gist.github.com/bejker123/a38d08dd622ff4fafd0076616696563d
The text was updated successfully, but these errors were encountered: