diff --git a/fabric-1.21.9/build.gradle b/fabric-1.21.9/build.gradle index 29a366a9..4edde49f 100644 --- a/fabric-1.21.9/build.gradle +++ b/fabric-1.21.9/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.10.5' + id 'fabric-loom' version '1.11-SNAPSHOT' } archivesBaseName = "Dynmap" @@ -8,7 +8,7 @@ group = parent.group eclipse { project { - name = "Dynmap(Fabric-1.21.6)" + name = "Dynmap(Fabric-1.21.9)" } } @@ -34,7 +34,8 @@ dependencies { shadow project(path: ':DynmapCore', configuration: 'shadow') - modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" + // modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" + modCompileOnly files("../libs/fabric-permissions-api-0.1.jar") compileOnly 'net.luckperms:api:5.4' } diff --git a/fabric-1.21.9/gradle.properties b/fabric-1.21.9/gradle.properties index fea2c1bf..9e1958d3 100644 --- a/fabric-1.21.9/gradle.properties +++ b/fabric-1.21.9/gradle.properties @@ -1,6 +1,6 @@ -minecraft_version=1.21.6 +minecraft_version=1.21.9 # see https://fabricmc.net/develop/ -yarn_mappings=1.21.6+build.1 -loader_version=0.16.14 -fabric_version=0.128.2+1.21.6 +yarn_mappings=1.21.9+build.1 +loader_version=0.17.2 +fabric_version=0.133.14+1.21.9 diff --git a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/DynmapPlugin.java b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/DynmapPlugin.java index fb998d55..19b6b242 100644 --- a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/DynmapPlugin.java +++ b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/DynmapPlugin.java @@ -259,7 +259,7 @@ public class DynmapPlugin { } // TODO: Consider whether cheats are enabled for integrated server - return server.isSingleplayer() && server.isHost(server.getPlayerManager().getPlayer(player).getGameProfile()); + return server.isSingleplayer() && server.isHost(server.getPlayerManager().getPlayer(player).getPlayerConfigEntry()); } boolean hasPerm(PlayerEntity psender, String permission) { diff --git a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricPlayer.java b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricPlayer.java index fdec35b3..bd3ac506 100644 --- a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricPlayer.java +++ b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricPlayer.java @@ -44,7 +44,7 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { uuid = this.player.getUuid(); GameProfile prof = this.player.getGameProfile(); if (prof != null) { - Property textureProperty = Iterables.getFirst(prof.getProperties().get("textures"), null); + Property textureProperty = Iterables.getFirst(prof.properties().get("textures"), null); if (textureProperty != null) { DynmapPlugin.TexturesPayload result = null; @@ -99,8 +99,8 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { return null; } - Vec3d pos = player.getPos(); - return FabricAdapter.toDynmapLocation(plugin, player.getWorld(), pos.getX(), pos.getY(), pos.getZ()); + // Vec3d pos = player.movement; + return FabricAdapter.toDynmapLocation(plugin, player.getEntityWorld(), player.getX(), player.getY(), player.getZ()); } @Override @@ -109,7 +109,7 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer { return null; } - World world = player.getWorld(); + World world = player.getEntityWorld(); if (world != null) { return plugin.getWorld(world).getName(); } diff --git a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricServer.java b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricServer.java index 84357897..493c2f2f 100644 --- a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricServer.java +++ b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricServer.java @@ -1,6 +1,5 @@ package org.dynmap.fabric_1_21_9; -import com.mojang.authlib.GameProfile; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.minecraft.block.AbstractSignBlock; @@ -14,6 +13,7 @@ import net.minecraft.server.BannedPlayerList; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.PlayerConfigEntry; import net.minecraft.text.Text; import net.minecraft.util.UserCache; import net.minecraft.util.Util; @@ -63,9 +63,8 @@ public class FabricServer extends DynmapServerInterface { this.biomeRegistry = server.getRegistryManager().getOrThrow(RegistryKeys.BIOME); } - private Optional getProfileByName(String player) { - UserCache cache = server.getUserCache(); - return cache.findByName(player); + private Optional getProfileByName(String playerName) { + return Optional.ofNullable(PlayerConfigEntry.fromNickname(playerName)); } public final Registry getBiomeRegistry() { @@ -202,12 +201,10 @@ public class FabricServer extends DynmapServerInterface { public boolean isPlayerBanned(String pid) { PlayerManager scm = server.getPlayerManager(); BannedPlayerList bl = scm.getUserBanList(); - try { - return bl.contains(getProfileByName(pid).get()); - } catch (NoSuchElementException e) { - /* If this profile doesn't exist, default to "banned" for good measure. */ - return true; - } + + return getProfileByName(pid) + .map(profile -> bl.get(profile) != null) + .orElse(true); } @Override diff --git a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricWorld.java b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricWorld.java index 9d96888f..9891528b 100644 --- a/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricWorld.java +++ b/fabric-1.21.9/src/main/java/org/dynmap/fabric_1_21_9/FabricWorld.java @@ -2,6 +2,7 @@ package org.dynmap.fabric_1_21_9; import net.minecraft.registry.RegistryKey; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.WorldProperties.SpawnPoint; import net.minecraft.util.math.MathHelper; import net.minecraft.world.Heightmap; import net.minecraft.world.LightType; @@ -96,7 +97,7 @@ public class FabricWorld extends DynmapWorld { @Override public DynmapLocation getSpawnLocation() { if (world != null) { - BlockPos spawnPos = world.getLevelProperties().getSpawnPos(); + BlockPos spawnPos = world.getLevelProperties().getSpawnPoint().getPos().toImmutable(); spawnloc.x = spawnPos.getX(); spawnloc.y = spawnPos.getY(); spawnloc.z = spawnPos.getZ(); diff --git a/fabric-1.21.9/src/main/resources/fabric.mod.json b/fabric-1.21.9/src/main/resources/fabric.mod.json index ca350c21..9ee0b6f1 100644 --- a/fabric-1.21.9/src/main/resources/fabric.mod.json +++ b/fabric-1.21.9/src/main/resources/fabric.mod.json @@ -27,8 +27,8 @@ "accessWidener" : "dynmap.accesswidener", "depends": { - "fabricloader": ">=0.16.9", + "fabricloader": ">=0.17.2", "fabric": ">=0.108.0", - "minecraft": ["1.21.6","1.21.7", "1.21.8"] + "minecraft": ["1.21.9"] } }