mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-10 13:49:04 +01:00
use a map for join game nbt
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
9ab4277502
commit
615f8e7edd
@ -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(),
|
||||||
|
Loading…
Reference in New Issue
Block a user