From f38ef50c3bbc3567dfa1bae123aa7cb4f201132f Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sun, 21 Nov 2021 16:53:53 +0100 Subject: [PATCH] Fix fabric-1.18 for pre-5 --- implementations/fabric-1.18/build.gradle | 4 ++-- .../bluecolored/bluemap/fabric/FabricMod.java | 20 ++++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/implementations/fabric-1.18/build.gradle b/implementations/fabric-1.18/build.gradle index 45b17c86..887f3818 100644 --- a/implementations/fabric-1.18/build.gradle +++ b/implementations/fabric-1.18/build.gradle @@ -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" diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index e830154c..302655d6 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -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); }