mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Let biomes NBT be parsed by 1.19.30
This commit is contained in:
parent
8beae31cee
commit
55f7253a98
1 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,7 @@ import com.github.steveice10.mc.protocol.data.game.level.particle.ParticleType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
import com.nukkitx.nbt.NbtMap;
|
import com.nukkitx.nbt.NbtMap;
|
||||||
|
import com.nukkitx.nbt.NbtMapBuilder;
|
||||||
import com.nukkitx.protocol.bedrock.BedrockPacket;
|
import com.nukkitx.protocol.bedrock.BedrockPacket;
|
||||||
import com.nukkitx.protocol.bedrock.data.inventory.CraftingData;
|
import com.nukkitx.protocol.bedrock.data.inventory.CraftingData;
|
||||||
import com.nukkitx.protocol.bedrock.data.inventory.PotionMixData;
|
import com.nukkitx.protocol.bedrock.data.inventory.PotionMixData;
|
||||||
|
@ -179,5 +180,15 @@ public final class Registries {
|
||||||
// Create registries that require other registries to load first
|
// Create registries that require other registries to load first
|
||||||
POTION_MIXES = SimpleRegistry.create(PotionMixRegistryLoader::new);
|
POTION_MIXES = SimpleRegistry.create(PotionMixRegistryLoader::new);
|
||||||
ENCHANTMENTS = SimpleMappedRegistry.create("mappings/enchantments.json", EnchantmentRegistryLoader::new);
|
ENCHANTMENTS = SimpleMappedRegistry.create("mappings/enchantments.json", EnchantmentRegistryLoader::new);
|
||||||
|
|
||||||
|
// TEMPORARY FIX TO MAKE OLD BIOMES NBT WORK WITH 1.19.30
|
||||||
|
NbtMapBuilder biomesNbt = NbtMap.builder();
|
||||||
|
for (Map.Entry<String, Object> entry : BIOMES_NBT.get().entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
NbtMapBuilder value = ((NbtMap) entry.getValue()).toBuilder();
|
||||||
|
value.put("name_hash", key);
|
||||||
|
biomesNbt.put(key, value.build());
|
||||||
|
}
|
||||||
|
BIOMES_NBT.set(biomesNbt.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue