Closed GoMinty closed 3 years ago
Invalid biome ID failure, need to check where those biome ID comes from
console
It comes from here: when a player joins for the first time the spawnLocation for the player is null in this piece of code: io.gomint.server.network.PlayerConnection#sendWorldInitialization
, so the world spawn is used.
In my case the problem is that the world spawn is 150, 75, 150
. When calling world.getBiome(position)
in io.gomint.server.world.WorldAdapter#getBiome
the block coordinates are converted to chunk ones, resulting in 9, 9
for chunk x and chunk z. Then after the chunk is created with the chunk coordinates and generate=true
, when getting the biome with chunk.biome(150 & 15, 150 & 15)
we end up with chunk.biome(6, 6)
. In that method the biome ID is generated by shifting 6 four times to the left and adding 6 to it, both x and z are 6. The result is 96 + 6 = 102
. When calling getByte
on this.biomes
in ChunkAdapter
the ID turns out to be 119. There's no biome with such ID in the Biomes
enum.
1 occurrence since (Fri Nov 15 2019 11:27:39)
s:32c8d1d5
— 1tag.plugin.crash — 1
1
— 1plugin — 1
Portal v1.0
— 1io.gomint.server.network.PlayerConnection.sendWorldInitialization io.gomint.server.entity.EntityPlayer.prepareEntity io.gomint.server.network.handler.PacketResourcePackResponseHandler.switchToLogin io.gomint.server.network.handler.PacketResourcePackResponseHandler.handle io.gomint.server.network.PlayerConnection.handlePacket io.gomint.server.network.PlayerConnection.handleBufferData io.gomint.server.network.PlayerConnection.handleSocketData io.gomint.server.network.PlayerConnection.updateNetwork io.gomint.server.network.PlayerConnection.update io.gomint.server.network.NetworkManager.update io.gomint.server.GoMintServer.startAfterRegistryInit io.gomint.server.Bootstrap.bootstrap io.gomint.server.Bootstrap.main