From 2a89eab100976db1affecf78dba2d5e53e3edd10 Mon Sep 17 00:00:00 2001 From: David Choo Date: Tue, 7 Jun 2022 20:10:12 -0400 Subject: [PATCH] Update for Java 1.19 and Geyser 2.0.4-SNAPSHOT (#53) * Update for 1.19 and 2.0.4-SNAPSHOT * Use mod version in Geyser dependency --- bootstrap/fabric/build.gradle | 8 ++++---- bootstrap/fabric/gradle.properties | 12 ++++++------ .../platform/fabric/command/FabricCommandSender.java | 4 ++-- .../fabric/mixin/client/IntegratedServerMixin.java | 4 ++-- .../mixin/server/MinecraftDedicatedServerMixin.java | 10 +++------- bootstrap/fabric/src/main/resources/fabric.mod.json | 2 +- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/bootstrap/fabric/build.gradle b/bootstrap/fabric/build.gradle index 112760009..e120ba1b2 100644 --- a/bootstrap/fabric/build.gradle +++ b/bootstrap/fabric/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.10-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' id 'com.github.johnrengelman.shadow' version '7.0.0' id 'java' @@ -27,8 +27,8 @@ dependencies { // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. - implementation 'org.geysermc:core:2.0.3-SNAPSHOT' - shadow('org.geysermc:core:2.0.3-SNAPSHOT') { + implementation "org.geysermc:core:${project.mod_version}" + shadow("org.geysermc:core:${project.mod_version}") { exclude group: 'com.google.guava', module: "guava" exclude group: 'com.google.code.gson', module: "gson" exclude group: 'org.slf4j' @@ -93,7 +93,7 @@ jar { remapJar { dependsOn(shadowJar) - input.set shadowJar.archiveFile.get() + input = tasks.shadowJar.archiveFile } // configure the maven publication diff --git a/bootstrap/fabric/gradle.properties b/bootstrap/fabric/gradle.properties index 1d9b12e67..8e6528e25 100644 --- a/bootstrap/fabric/gradle.properties +++ b/bootstrap/fabric/gradle.properties @@ -1,14 +1,14 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.1 -loader_version=0.12.8 +minecraft_version=1.19 +yarn_mappings=1.19+build.1 +loader_version=0.14.6 # Mod Properties -mod_version=2.0.3-SNAPSHOT +mod_version=2.0.4-SNAPSHOT maven_group=org.geysermc.platform archives_base_name=Geyser-Fabric # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.43.1+1.18 +fabric_version=0.55.2+1.19 \ No newline at end of file diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/command/FabricCommandSender.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/command/FabricCommandSender.java index 1fa9f55ae..57f877637 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/command/FabricCommandSender.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/command/FabricCommandSender.java @@ -27,7 +27,7 @@ package org.geysermc.platform.fabric.command; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.text.ChatColor; @@ -49,7 +49,7 @@ public class FabricCommandSender implements CommandSender { @Override public void sendMessage(String message) { if (source.getEntity() instanceof ServerPlayerEntity) { - ((ServerPlayerEntity) source.getEntity()).sendMessage(new LiteralText(message), false); + ((ServerPlayerEntity) source.getEntity()).sendMessage(Text.literal(message), false); } else { GeyserImpl.getInstance().getLogger().info(ChatColor.toANSI(message + ChatColor.RESET)); } diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java index 1fc945f28..6a6d3e0e6 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java @@ -30,7 +30,7 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.server.MinecraftServer; import net.minecraft.server.integrated.IntegratedServer; -import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; import net.minecraft.world.GameMode; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.platform.fabric.GeyserFabricMod; @@ -58,7 +58,7 @@ public class IntegratedServerMixin implements GeyserServerPortGetter { // Ensure player locale has been loaded, in case it's different from Java system language GeyserLocale.loadGeyserLocale(this.client.options.language); // Give indication that Geyser is loaded - this.client.player.sendMessage(new LiteralText(GeyserLocale.getPlayerLocaleString("geyser.core.start", + this.client.player.sendMessage(Text.literal(GeyserLocale.getPlayerLocaleString("geyser.core.start", this.client.options.language, "localhost", String.valueOf(this.lanPort))), false); } } diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java index e30181f00..a41a08342 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java @@ -25,27 +25,23 @@ package org.geysermc.platform.fabric.mixin.server; -import com.mojang.authlib.GameProfileRepository; -import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.datafixers.DataFixer; import net.minecraft.resource.ResourcePackManager; import net.minecraft.server.MinecraftServer; import net.minecraft.server.SaveLoader; import net.minecraft.server.WorldGenerationProgressListenerFactory; import net.minecraft.server.dedicated.MinecraftDedicatedServer; -import net.minecraft.util.UserCache; +import net.minecraft.util.ApiServices; import net.minecraft.world.level.storage.LevelStorage; import org.geysermc.platform.fabric.GeyserServerPortGetter; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import java.net.Proxy; @Mixin(MinecraftDedicatedServer.class) public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter { - // Constructor to compile - public MinecraftDedicatedServerMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, @Nullable MinecraftSessionService sessionService, @Nullable GameProfileRepository gameProfileRepo, @Nullable UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { - super(serverThread, session, dataPackManager, saveLoader, proxy, dataFixer, sessionService, gameProfileRepo, userCache, worldGenerationProgressListenerFactory); + public MinecraftDedicatedServerMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, ApiServices apiServices, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { + super(serverThread, session, dataPackManager, saveLoader, proxy, dataFixer, apiServices, worldGenerationProgressListenerFactory); } @Override diff --git a/bootstrap/fabric/src/main/resources/fabric.mod.json b/bootstrap/fabric/src/main/resources/fabric.mod.json index 54478f150..fd04f8ecf 100644 --- a/bootstrap/fabric/src/main/resources/fabric.mod.json +++ b/bootstrap/fabric/src/main/resources/fabric.mod.json @@ -25,6 +25,6 @@ "depends": { "fabricloader": ">=0.11.3", "fabric": "*", - "minecraft": ">=1.18.2" + "minecraft": ">=1.19" } }