use a map for join game nbt

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-12-13 16:49:54 +01:00
parent 9ab4277502
commit 615f8e7edd

View File

@ -238,13 +238,9 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
public void UNSAFE_init(@NotNull Instance spawnInstance) { public void UNSAFE_init(@NotNull Instance spawnInstance) {
this.dimensionType = spawnInstance.getDimensionType(); this.dimensionType = spawnInstance.getDimensionType();
NBTCompound nbt = NBT.Compound(n -> { NBTCompound nbt = NBT.Compound(Map.of(
NBTCompound dimensions = MinecraftServer.getDimensionTypeManager().toNBT(); "minecraft:dimension_type", MinecraftServer.getDimensionTypeManager().toNBT(),
NBTCompound biomes = MinecraftServer.getBiomeManager().toNBT(); "minecraft:worldgen/biome", MinecraftServer.getBiomeManager().toNBT()));
n.set("minecraft:dimension_type", dimensions);
n.set("minecraft:worldgen/biome", biomes);
});
final JoinGamePacket joinGamePacket = new JoinGamePacket(getEntityId(), gameMode.isHardcore(), gameMode, null, final JoinGamePacket joinGamePacket = new JoinGamePacket(getEntityId(), gameMode.isHardcore(), gameMode, null,
List.of("minestom:world"), nbt, dimensionType.toNBT(), dimensionType.getName().asString(), List.of("minestom:world"), nbt, dimensionType.toNBT(), dimensionType.getName().asString(),
0, 0, MinecraftServer.getChunkViewDistance(), MinecraftServer.getChunkViewDistance(), 0, 0, MinecraftServer.getChunkViewDistance(), MinecraftServer.getChunkViewDistance(),