Carpet

Carpet

2M Downloads

Weird spawn glitch with fake players

Miner34dev opened this issue ยท 1 comments

commented

What's wrong

  • Instead of having the joined the game message once you get it many times.
  • If you kill it, you will get the left the game message but it will not respawn (and the command is on a repeating command block)
  • Once killed, trying to respawn it says it is already logged on
  • Trying to get rid of it with /kick, /player kill, /kill etc... seemingly works but trying to respawn it still doesn't work, meaning it's still there

Reproducing

  1. Get a command block and place it down
  2. Set the command to player somename spawn
  3. Set the command block to repeating
  4. Activate it
  5. Quit Minecraft
  6. Reopen the world
  7. Try using the command block again

Additional information

Minecraft 1.20.4
Carpet v1.4.128
Lithium 0.12.1 (maybe a compatibility issue?)
Note: Sometimes the game just crashes a while after spawning the player, here's the interested part of the log:

net.minecraft.class_148: Exception ticking world
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:952) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:845) ~[client-intermediary.jar:?]
	at net.minecraft.class_1132.method_3748(class_1132.java:110) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:683) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) ~[client-intermediary.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 257
	at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap.fixPointers(Int2ObjectLinkedOpenHashMap.java:1013) ~[fastutil-8.5.12.jar:?]
	at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap.shiftKeys(Int2ObjectLinkedOpenHashMap.java:356) ~[fastutil-8.5.12.jar:?]
	at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap.removeEntry(Int2ObjectLinkedOpenHashMap.java:264) ~[fastutil-8.5.12.jar:?]
	at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap.remove(Int2ObjectLinkedOpenHashMap.java:372) ~[fastutil-8.5.12.jar:?]
	at net.minecraft.class_5570.method_31757(class_5570.java:48) ~[client-intermediary.jar:?]
	at net.minecraft.class_5579.method_31850(class_5579.java:221) ~[client-intermediary.jar:?]
	at net.minecraft.class_5579$class_5580.method_31750(class_5579.java:115) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_31745(class_1297.java:3661) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_5650(class_1297.java:405) ~[client-intermediary.jar:?]
	at net.minecraft.class_1309.method_5650(class_1309.java:713) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_31472(class_1297.java:381) ~[client-intermediary.jar:?]
	at net.minecraft.class_1308.method_5982(class_1308.java:752) ~[client-intermediary.jar:?]
	at net.minecraft.class_3218.method_31420(class_3218.java:379) ~[client-intermediary.jar:?]
	at net.minecraft.class_5574.method_31791(class_5574.java:54) ~[client-intermediary.jar:?]
	at net.minecraft.class_3218.method_18765(class_3218.java:363) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:948) ~[client-intermediary.jar:?]
	... 5 more```
commented

This has already been fixed in #1849, however this is only fixed in the future versions (1.20.5+).

I backported the fix here for 1.20.4.