diff --git a/CHANGELOG.md b/CHANGELOG.md index 706eb8a9..757de894 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 3.0.20 +##### Minecraft 1.20.3 + +Update dependencies + ### 3.0.19 ##### Minecraft 1.20[.1], 1.20.2 diff --git a/build.gradle b/build.gradle index 5edfe3e9..6e8ac854 100644 --- a/build.gradle +++ b/build.gradle @@ -36,13 +36,13 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // Translations - include modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_version}+${project.server_translations_branch}") + include modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_version}") // Permissions include modImplementation("me.lucko:fabric-permissions-api:${project.fabric_permissions_version}") // Placeholder API - include modImplementation("eu.pb4:placeholder-api:${project.placeholder_api_version}+${project.placeholder_api_branch}") + include modImplementation("eu.pb4:placeholder-api:${project.placeholder_api_version}") // Mods modCompileOnly "org.geysermc.floodgate:api:${floodgate_api_version}" @@ -104,11 +104,11 @@ modrinth { token.set(System.getenv("MODRINTH_TOKEN")) projectId.set("aZj58GfX") versionNumber.set("${project.version}") - versionName = "[1.20.2] ${project.version}" + versionName = "[1.20.3] ${project.version}" versionType = "beta" changelog.set("Release notes:\nhttps://github.com/NikitaCartes/EasyAuth/releases/tag/${project.version}\n\nChangelog:\nhttps://github.com/NikitaCartes/EasyAuth/tree/HEAD/CHANGELOG.md") uploadFile = remapJar - gameVersions.addAll("1.20.2") + gameVersions.addAll("1.20.3") loaders = ["fabric", "quilt"] dependencies { required.project("P7dR8mSH") // Fabric API @@ -129,10 +129,10 @@ curseforge { addGameVersion("Java 18") addGameVersion("Java 17") - addGameVersion("1.20.2") + addGameVersion("1.20.3") mainArtifact(remapJar) { - displayName = "[1.20.2] ${project.version}" + displayName = "[1.20.3] ${project.version}" relations { requiredDependency("fabric-api") embeddedLibrary 'server-translation-api' diff --git a/gradle.properties b/gradle.properties index c7af71d9..3430361c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,29 +1,27 @@ # Mod mod_name=EasyAuth mod_id=easyauth -mod_version=3.0.19 +mod_version=3.0.20 # Fabric -minecraft_version=1.20.2 -yarn_mappings=1.20.2+build.1 -loader_version=0.14.22 -fabric_version=0.89.1+1.20.2 +minecraft_version=1.20.3-rc1 +yarn_mappings=1.20.3-rc1+build.2 +loader_version=0.15.0 +fabric_version=0.91.1+1.20.3 # Dependencies -server_translations_version=2.1.0 -server_translations_branch=1.20.2-rc2 +server_translations_version=2.2.0+1.20.3-rc1 fabric_permissions_version=0.2-SNAPSHOT floodgate_api_version=2.2.0-20220810.210256-12 -placeholder_api_version=2.2.0 -placeholder_api_branch=1.20.2 +placeholder_api_version=2.3.0+1.20.3 argon2_version=2.11 -bcrypt_version=0.9.0 -bytes_version=1.5.0 +bcrypt_version=0.10.2 +bytes_version=1.6.1 leveldb_version=0.12 -mongodb_version=4.7.2 -mysql_version=8.0.33 -jna_version=5.12.1 +mongodb_version=4.11.1 +mysql_version=8.2.0 +jna_version=5.13.0 # Other org.gradle.jvmargs=-Xmx1G diff --git a/src/main/java/xyz/nikitacartes/easyauth/event/AuthEventHandler.java b/src/main/java/xyz/nikitacartes/easyauth/event/AuthEventHandler.java index 532712b5..8ccd8298 100644 --- a/src/main/java/xyz/nikitacartes/easyauth/event/AuthEventHandler.java +++ b/src/main/java/xyz/nikitacartes/easyauth/event/AuthEventHandler.java @@ -14,6 +14,7 @@ import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.TypedActionResult; +import net.minecraft.util.Uuids; import net.minecraft.util.math.BlockPos; import xyz.nikitacartes.easyauth.storage.AuthConfig; import xyz.nikitacartes.easyauth.storage.PlayerCache; @@ -286,8 +287,8 @@ public static ActionResult onUseEntity(PlayerEntity player) { } public static void onPreLogin(ServerLoginNetworkHandler netHandler, MinecraftServer server, PacketSender packetSender, ServerLoginNetworking.LoginSynchronizer sync) { - if (config.experimental.forcedOfflineUuids) { - netHandler.profile = ServerLoginNetworkHandler.createOfflineProfile(netHandler.profile.getName()); + if (config.experimental.forcedOfflineUuids && netHandler.profile != null) { + netHandler.profile = Uuids.getOfflinePlayerProfile(netHandler.profile.getName()); } } diff --git a/src/main/java/xyz/nikitacartes/easyauth/mixin/CommandManagerMixin.java b/src/main/java/xyz/nikitacartes/easyauth/mixin/CommandManagerMixin.java index b97f8159..bd3e1b5c 100644 --- a/src/main/java/xyz/nikitacartes/easyauth/mixin/CommandManagerMixin.java +++ b/src/main/java/xyz/nikitacartes/easyauth/mixin/CommandManagerMixin.java @@ -7,16 +7,19 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import xyz.nikitacartes.easyauth.event.AuthEventHandler; +import static xyz.nikitacartes.easyauth.utils.TranslationHelper.getLoginRequired; + @Mixin(CommandManager.class) public class CommandManagerMixin { - @Inject(method = "execute(Lcom/mojang/brigadier/ParseResults;Ljava/lang/String;)I", at = @At("HEAD"), cancellable = true) - private void checkCanUseCommands(ParseResults parseResults, String command, CallbackInfoReturnable cir) { + @Inject(method = "execute(Lcom/mojang/brigadier/ParseResults;Ljava/lang/String;)V", at = @At("HEAD"), cancellable = true) + private void checkCanUseCommands(ParseResults parseResults, String command, CallbackInfo ci) { ActionResult result = AuthEventHandler.onPlayerCommand(parseResults.getContext().getSource().getPlayer(), command); if (result == ActionResult.FAIL) { - cir.setReturnValue(1); + parseResults.getContext().getSource().sendError(getLoginRequired()); + ci.cancel(); } } } \ No newline at end of file diff --git a/src/main/java/xyz/nikitacartes/easyauth/mixin/ServerPlayNetworkHandlerMixin.java b/src/main/java/xyz/nikitacartes/easyauth/mixin/ServerPlayNetworkHandlerMixin.java index c8c89ddf..c3458573 100644 --- a/src/main/java/xyz/nikitacartes/easyauth/mixin/ServerPlayNetworkHandlerMixin.java +++ b/src/main/java/xyz/nikitacartes/easyauth/mixin/ServerPlayNetworkHandlerMixin.java @@ -27,7 +27,7 @@ public abstract class ServerPlayNetworkHandlerMixin { method = "onChatMessage(Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;)V", at = @At( value = "INVOKE", - target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;validateMessage(Ljava/lang/String;Ljava/time/Instant;Lnet/minecraft/network/message/LastSeenMessageList$Acknowledgment;)Ljava/util/Optional;", + target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;validateMessage(Lnet/minecraft/network/message/LastSeenMessageList$Acknowledgment;)Ljava/util/Optional;", shift = At.Shift.BEFORE ), cancellable = true diff --git a/src/main/java/xyz/nikitacartes/easyauth/mixin/WorldSaveHandlerMixin.java b/src/main/java/xyz/nikitacartes/easyauth/mixin/WorldSaveHandlerMixin.java index a857e382..fa638445 100644 --- a/src/main/java/xyz/nikitacartes/easyauth/mixin/WorldSaveHandlerMixin.java +++ b/src/main/java/xyz/nikitacartes/easyauth/mixin/WorldSaveHandlerMixin.java @@ -3,6 +3,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtIo; +import net.minecraft.nbt.NbtTagSizeTracker; import net.minecraft.util.Uuids; import net.minecraft.world.WorldSaveHandler; import org.spongepowered.asm.mixin.Final; @@ -75,7 +76,7 @@ private NbtCompound migratePlayerData(NbtCompound compoundTag, PlayerEntity play File file = new File(this.playerDataDir, Uuids.getOfflinePlayerUuid(player.getGameProfile().getName()) + ".dat"); if (file.exists() && file.isFile()) try { - compoundTag = NbtIo.readCompressed(new FileInputStream(file)); + compoundTag = NbtIo.readCompressed(new FileInputStream(file), NbtTagSizeTracker.ofUnlimitedBytes()); } catch (IOException e) { LogWarn(String.format("Failed to load player data for: %s", playername)); } diff --git a/src/main/resources/easyauth.accesswidener b/src/main/resources/easyauth.accesswidener index d93c7894..9fc33dd1 100644 --- a/src/main/resources/easyauth.accesswidener +++ b/src/main/resources/easyauth.accesswidener @@ -1,5 +1,4 @@ accessWidener v1 named accessible class net/minecraft/server/network/ServerLoginNetworkHandler$State -accessible method net/minecraft/server/network/ServerLoginNetworkHandler createOfflineProfile (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile; accessible field net/minecraft/server/network/ServerLoginNetworkHandler profile Lcom/mojang/authlib/GameProfile; \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 21d5c236..123e79fd 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ "depends": { "fabric-api": "*", "fabricloader": "*", - "minecraft": ">=1.20.2-" + "minecraft": ">=1.20.3-" }, "suggests": { "fabric-permissions-api-v0": "*"