From 6c708e108d56a25ed44e4977fc156cd67603ecc1 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Thu, 6 Oct 2022 15:17:38 +0800 Subject: [PATCH] Update to 1.19.2 --- build.gradle | 21 ++++++++++++++----- .../lightfall/client/LightfallClient.java | 5 +++-- .../client/gui/LightfallHandshakeScreen.java | 9 ++++---- src/main/resources/META-INF/MANIFEST.MF | 1 - src/main/resources/META-INF/mods.toml | 2 +- 5 files changed, 24 insertions(+), 14 deletions(-) delete mode 100644 src/main/resources/META-INF/MANIFEST.MF diff --git a/build.gradle b/build.gradle index 41f1231..f8e89aa 100644 --- a/build.gradle +++ b/build.gradle @@ -14,13 +14,13 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' group = 'io.izzel.lightfall' -version = '1.0.3' +version = '1.1.0' archivesBaseName = 'lightfallclient' java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - mappings channel: 'official', version: "1.18.2" + mappings channel: 'official', version: "1.19.2" runs { client { workingDirectory project.file('run') @@ -45,12 +45,13 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.1.0' + minecraft 'net.minecraftforge:forge:1.19.2-43.1.1' annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' } mixin { add sourceSets.main, 'mixins.lightfall.refmap.json' + config 'mixins.lightfall.json' } processResources { @@ -61,5 +62,15 @@ processResources { } jar { - manifest.attributes MixinConfigs: 'mixins.lightfall.json' -} \ No newline at end of file + manifest.attributes([ + "Specification-Title" : "lightfallclient", + //"Specification-Vendor": "mirror authors", + "Specification-Version" : "1", // We are version 1 of ourselves + "Implementation-Title" : project.name, + "Implementation-Version" : project.jar.archiveVersion, + //"Implementation-Vendor": "mirror authors", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) +} + +jar.finalizedBy('reobfJar') diff --git a/src/main/java/io/izzel/lightfall/client/LightfallClient.java b/src/main/java/io/izzel/lightfall/client/LightfallClient.java index 5c2dc68..fafe3c8 100644 --- a/src/main/java/io/izzel/lightfall/client/LightfallClient.java +++ b/src/main/java/io/izzel/lightfall/client/LightfallClient.java @@ -18,6 +18,7 @@ import net.minecraftforge.fml.IExtensionPoint; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.network.NetworkConstants; import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.registries.GameData; @@ -32,7 +33,7 @@ public class LightfallClient { public LightfallClient() { DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClientSetup::registerChannel); ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, - () -> new IExtensionPoint.DisplayTest(() -> "", (a, b) -> true)); + () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true)); } public static class ClientSetup { @@ -65,7 +66,7 @@ private static void handleReset(NetworkEvent.ServerCustomPayloadEvent event) { var netHandler = new ClientHandshakePacketListenerImpl(netManager, client, new JoinMultiplayerScreen(new TitleScreen()), screen::setComponent); ((ClientLoginNetHandlerBridge) netHandler).bridge$reusePlayHandler((ClientPacketListener) netManager.getPacketListener()); netManager.setListener(netHandler); - }); + }).join(); context.setPacketHandled(true); } } diff --git a/src/main/java/io/izzel/lightfall/client/gui/LightfallHandshakeScreen.java b/src/main/java/io/izzel/lightfall/client/gui/LightfallHandshakeScreen.java index 51ffb2c..c026201 100644 --- a/src/main/java/io/izzel/lightfall/client/gui/LightfallHandshakeScreen.java +++ b/src/main/java/io/izzel/lightfall/client/gui/LightfallHandshakeScreen.java @@ -1,8 +1,8 @@ package io.izzel.lightfall.client.gui; import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.GameNarrator; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.chat.NarratorChatListener; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.TitleScreen; @@ -10,7 +10,6 @@ import net.minecraft.network.Connection; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TranslatableComponent; import org.jetbrains.annotations.NotNull; public class LightfallHandshakeScreen extends Screen { @@ -19,7 +18,7 @@ public class LightfallHandshakeScreen extends Screen { private Component component; public LightfallHandshakeScreen(Connection netManager) { - super(NarratorChatListener.NO_TITLE); + super(GameNarrator.NO_TITLE); this.networkManager = netManager; } @@ -41,7 +40,7 @@ protected void init() { new Button(this.width / 2 - 100, this.height / 4 + 120 + 12, 200, 20, CommonComponents.GUI_CANCEL, button -> { if (this.networkManager.isConnected()) { - this.networkManager.disconnect(new TranslatableComponent("connect.aborted")); + this.networkManager.disconnect(Component.translatable("connect.aborted")); } this.minecraft.setScreen(new JoinMultiplayerScreen(new TitleScreen())); } @@ -55,7 +54,7 @@ public void setComponent(Component component) { public void render(@NotNull PoseStack poseStack, int p_96531_, int p_96532_, float p_96533_) { this.renderDirtBackground(0); - drawCenteredString(poseStack, this.font, component != null ? component : new TranslatableComponent("connect.connecting"), + drawCenteredString(poseStack, this.font, component != null ? component : Component.translatable("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215); super.render(poseStack, p_96531_, p_96532_, p_96533_); } diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 6ffb7e3..0000000 --- a/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -MixinConnector: io.izzel.lightfall.client.LightfallConnector diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 54d9106..23d527e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader = "javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion = "[28,)" #mandatory (26 is current forge version) +loaderVersion = "[42,)" #mandatory (26 is current forge version) license="MIT License" # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory