Fix fabric-1.18 for pre-5

This commit is contained in:
Blue (Lukas Rieger) 2021-11-21 16:53:53 +01:00
parent e373b5b624
commit f38ef50c3b
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
2 changed files with 6 additions and 18 deletions

View File

@ -9,8 +9,8 @@ configurations {
}
dependencies {
minecraft "com.mojang:minecraft:1.18-pre1"
mappings "net.fabricmc:yarn:1.18-pre1+build.8:v2"
minecraft "com.mojang:minecraft:1.18-pre5"
mappings "net.fabricmc:yarn:1.18-pre5+build.4:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.3"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.42.2+1.18"

View File

@ -26,7 +26,6 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import com.google.gson.Gson;
import de.bluecolored.bluemap.common.plugin.Plugin;
import de.bluecolored.bluemap.common.plugin.commands.Commands;
import de.bluecolored.bluemap.common.plugin.serverinterface.Player;
@ -42,27 +41,16 @@
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.loom.configuration.FabricApiExtension;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.util.WorldSavePath;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeEffects;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.biome.BuiltinBiomes;
import net.minecraft.world.dimension.DimensionType;
import org.apache.logging.log4j.LogManager;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.gson.GsonConfigurationLoader;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
@ -173,9 +161,9 @@ public UUID getUUIDForWorld(ServerWorld world) throws IOException {
private UUID loadUUIDForWorld(ServerWorld world) throws IOException {
MinecraftServer server = world.getServer();
File worldFolder = world.getServer().getRunDirectory().toPath().resolve(server.getSavePath(WorldSavePath.ROOT)).toFile();
File dimensionFolder = DimensionType.getSaveDirectory(world.getRegistryKey(), worldFolder);
File dimensionDir = dimensionFolder.getCanonicalFile();
Path worldFolder = world.getServer().getRunDirectory().toPath().resolve(server.getSavePath(WorldSavePath.ROOT));
Path dimensionFolder = DimensionType.getSaveDirectory(world.getRegistryKey(), worldFolder);
File dimensionDir = dimensionFolder.toFile().getCanonicalFile();
return getUUIDForWorld(dimensionDir);
}