Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5858

NPE: Joining the server with an invalid dimension

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Version:
      This server is running CraftBukkit version git-Spigot-6f4ff1b-983305b (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
    • Guidelines Read:
      Yes

      Description

      Error Log

      [23:54:42] [User Authenticator #2/INFO]: UUID of player PureGero is 6e397a6e-42db-46b3-9ac3-581c233499b6
      [23:54:42] [Server thread/WARN]: Unknown respawn dimension ResourceKey[minecraft:dimension / minecraft:test], defaulting to overworld
      [23:54:42] [Server thread/WARN]: Failed to handle packet for /127.0.0.1:58681
      java.lang.NullPointerException: null
      	at net.minecraft.server.v1_16_R1.PlayerList.a(PlayerList.java:168) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.LoginListener.c(LoginListener.java:153) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.LoginListener.tick(LoginListener.java:52) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.NetworkManager.a(NetworkManager.java:219) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.ServerConnection.c(ServerConnection.java:128) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.MinecraftServer.b(MinecraftServer.java:1128) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.DedicatedServer.b(DedicatedServer.java:354) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1009) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:848) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-6f4ff1b-983305b]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
      [23:54:42] [Server thread/INFO]: PureGero lost connection: Internal server error
      [23:54:42] [Server thread/INFO]: PureGero left the game

      Steps to reproduce

      1. Install the MultiVerse plugin
      2. Create a new world with multiverse with `/mv create test normal`
      3. Enter the world with `/mvtp test`
      4. Log off from the server
      5. From the console, delete the new world with `/mv delete test` and `/mvconfirm`
      6. Attempt to log back into the server but be disconnected due to the NPE

      (Note that multiverse isn't the cause of the error, it's just a handy plugin to reliably reproduce it)

      What should happen

      I should get moved to the default world instead of being disconnected from the server (as suggested by the warning preceding the error)

      Potentially how to resolve

      I haven't been able to test this fix due to my current environment, but in Spigot/CraftBukkit-Patches/0008-View-Distance.patch, line 18:

      playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver.spigotConfig.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
      

      change `worldserver.spigotConfig.viewDistance` to `worldserver1.spigotConfig.viewDistance` as `worldserver` is potentially null at this location.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            PureGero PureGero
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: