VMP-fabric icon indicating copy to clipboard operation
VMP-fabric copied to clipboard

Force-added player with duplicate UUID

Open Libreh opened this issue 1 year ago • 5 comments

Describe the bug I'm not sure if this is a bug in itself or a compatibility issue. If VMP is installed on servers with mods that do ServerPlayerEntity#teleport very early after the player has joined the console will say Force-added player with duplicate UUID <player uuid> (https://modrinth.com/mod/yet-another-minecraft-bingo does this for example). The player associated with will be in a weird state where it among other things is invulnerable to damage. If this is not a bug then how do I make my own mod compatible with VMP?

To Reproduce Steps to reproduce the behavior:

  1. Use a mod that runs ServerPlayerEntity as early as PlayerJoin or the tick after that.
  2. See message in console and player will be in a weird bugged state.

Expected behavior Without VMP the player joins without the message and isn't invulnerable or anything weird.

Runtime info (please complete the following information):

  • OS: Linux
  • Minecraft version: 1.21
  • Mod version: 0.2.0+beta.7.162 devbuild for 1.21

Checklist

  • [x] I am using the official version of the mod.
  • [x] I tried the latest development version but the issue persists.
  • [x] I searched for similar open issues and could not find an existing bug report on this.

Libreh avatar Jun 30 '24 12:06 Libreh

Try disabling use_async_chunks_on_login and see if it still happens.

ishland avatar Jul 02 '24 07:07 ishland

That does fix it, but is there any way to avoid the issue with use_async_chunks_on_login set to true? Is compatibility with it enabled possible?

Libreh avatar Jul 02 '24 13:07 Libreh

A rewrite is currently planned to avoid such issues completely. In the current implementation, players in async loading stage have notInAnyWorld set to true. You can avoid teleporting such player by checking that field in the meantime. Or disable the option as a workaround for end users for now.

ishland avatar Jul 02 '24 13:07 ishland

Alright, thank you. Have a great day and great job on C2ME, VMP, etc!

Libreh avatar Jul 02 '24 14:07 Libreh

Reopening as a tracking issue for the fix.

ishland avatar Jul 02 '24 14:07 ishland

Do I need to check notInAnyWorld with the new reimplemntation?

Libreh avatar Sep 25 '24 14:09 Libreh

Do I need to check notInAnyWorld with the new reimplemntation?

You don't have to now, since the player shouldn't be visible by anything else when the chunk is loading in.

ishland avatar Sep 25 '24 14:09 ishland

Just wondering, is there any use to keeping this up now? Considering that the new reimplementation fixes my issue?

Libreh avatar Oct 16 '24 16:10 Libreh