feat: updated Minestom version
This commit is contained in:
parent
ac61442dda
commit
c7c024fc6b
@ -27,7 +27,7 @@ tasks {
|
||||
dependencies {
|
||||
api project(":resource-compiler")
|
||||
|
||||
api 'net.minestom:minestom-snapshots:1_21_4-6490538291'
|
||||
api 'net.minestom:minestom-snapshots:8209a1d1e9' // stableVersion: 1_21_4-6490538291
|
||||
|
||||
api 'org.slf4j:slf4j-api:2.0.16'
|
||||
api 'org.apache.logging.log4j:log4j-slf4j2-impl:2.24.0'
|
||||
|
||||
@ -2,6 +2,7 @@ package ru.dragonestia.msb3.api.world.loader.anvil;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.nbt.*;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.instance.DynamicChunk;
|
||||
@ -11,9 +12,7 @@ import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.instance.block.BlockHandler;
|
||||
import net.minestom.server.instance.palette.Palettes;
|
||||
import net.minestom.server.registry.DynamicRegistry;
|
||||
import net.minestom.server.utils.ArrayUtils;
|
||||
import net.minestom.server.utils.MathUtils;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
import net.minestom.server.utils.validate.Check;
|
||||
import net.minestom.server.world.biome.Biome;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -26,7 +25,7 @@ import java.util.*;
|
||||
public class AnvilRegionLoader {
|
||||
|
||||
private static final DynamicRegistry<Biome> BIOME_REGISTRY = MinecraftServer.getBiomeRegistry();
|
||||
private final static int PLAINS_ID = BIOME_REGISTRY.getId(NamespaceID.from("minecraft:plains"));
|
||||
private final static int PLAINS_ID = BIOME_REGISTRY.getId(Key.key("minecraft:plains"));
|
||||
|
||||
private final File worldDir;
|
||||
|
||||
@ -178,7 +177,7 @@ public class AnvilRegionLoader {
|
||||
if (blockName.equals("minecraft:air")) {
|
||||
convertedPalette[i] = Block.AIR;
|
||||
} else {
|
||||
Block block = Objects.requireNonNull(Block.fromNamespaceId(blockName), "Unknown block " + blockName);
|
||||
Block block = Objects.requireNonNull(Block.fromKey(blockName), "Unknown block " + blockName);
|
||||
// Properties
|
||||
final Map<String, String> properties = new HashMap<>();
|
||||
CompoundBinaryTag propertiesNBT = paletteEntry.getCompound("Properties");
|
||||
@ -205,7 +204,7 @@ public class AnvilRegionLoader {
|
||||
int[] convertedPalette = new int[paletteTag.size()];
|
||||
for (int i = 0; i < convertedPalette.length; i++) {
|
||||
final String name = paletteTag.getString(i);
|
||||
int biomeId = BIOME_REGISTRY.getId(NamespaceID.from(name));
|
||||
int biomeId = BIOME_REGISTRY.getId(Key.key(name));
|
||||
if (biomeId == -1) biomeId = PLAINS_ID;
|
||||
convertedPalette[i] = biomeId;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user