Skip to content

ServerboundMovePlayerPacket error when using changeDimension to fantasy dimensions, chunks do not generate #39

@filloax

Description

@filloax

As title. Trying the lib by using a simple command that creates a temporary dimension and moves the player there, but I just get the classic pre-loading empty world on the client side as chunks never generate, with the error at the bottom of the issue post in the log.

The command code (in Kotlin, mojmap, fabric) is this:

object Commands {
    val worldConfig = { server: MinecraftServer ->
        RuntimeWorldConfig()
            .setDimensionType(BuiltinDimensionTypes.OVERWORLD)
            .setDifficulty(Difficulty.HARD)
            .setGameRule(GameRules.RULE_DAYLIGHT, false)
            .setGenerator(server.overworld().chunkSource.generator)
            .setSeed(1234L)
    }

    fun register(dispatcher: CommandDispatcher<CommandSourceStack>, registryAccess: CommandBuildContext, environment: Commands.CommandSelection) {
        //tmpdim: move to temporary dim
        dispatcher.register(literal("tmpdim").requires{ it.hasPermission(2) }
            .executes { ctx ->
                val fantasy = Fantasy.get(ctx.source.server)
                val worldHandle:= fantasy.openTemporaryWorld(worldConfig(ctx.source.server))
                val level = worldHandle.asWorld()
                ctx.source.playerOrException.changeDimension(level)

                1
            }
        )
    }
}

Am I doing something wrong?

[20:54:42] [Server thread/ERROR] (Minecraft) Failed to handle packet net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot@380fc290, suppressing error
 java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectSet" is null
	at net.minecraft.server.level.DistanceManager.removePlayer(DistanceManager.java:225) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.level.ChunkMap.move(ChunkMap.java:1093) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.level.ServerChunkCache.move(ServerChunkCache.java:477) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:928) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:31) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot.handle(ServerboundMovePlayerPacket.java:90) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.PacketUtils.method_11072(PacketUtils.java:34) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.TickTask.run(TickTask.java:20) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:143) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:797) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:189) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:114) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:780) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:774) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:103) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:760) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:696) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:252) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[20:54:42] [Server thread/ERROR] (Minecraft) Failed to handle packet net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos@5f723ccf, suppressing error
 java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectSet" is null
	at net.minecraft.server.level.DistanceManager.removePlayer(DistanceManager.java:225) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.level.ChunkMap.move(ChunkMap.java:1093) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.level.ServerChunkCache.move(ServerChunkCache.java:477) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:928) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:31) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.handle(ServerboundMovePlayerPacket.java:68) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.network.protocol.PacketUtils.method_11072(PacketUtils.java:34) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.TickTask.run(TickTask.java:20) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:143) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:797) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:189) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:114) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:780) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:774) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:103) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:760) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:696) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:252) ~[minecraft-common-c4cba8cea8-1.20.2-loom.mappings.1_20_2.layered+hash.405084424-v2.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions