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
1 changed files with 3 additions and 7 deletions

View File

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