diff options
| author | Reagan | 2026-06-24 03:01:30 +1200 |
|---|---|---|
| committer | GitHub | 2026-06-23 17:01:30 +0200 |
| commit | 2fa3699d0440034b23fd769e81c1965a31dd0fe8 (patch) | |
| tree | b826380dc0dcdbc855a20f8216bb9114a97fb1b6 /src | |
| parent | 6ae2536dfe3e89bb88a952a7e02dea0a2b4c6f7c (diff) | |
Update to 26.2 (#551)
* Bump version numbers for 26.2
* Update Minecraft references to 26.2
* Remove JAVA_25 compatibility specified in Mixin configs for Forge
Not sure why Forge broke it, but e.g. 50ap5ud5/BoatItemView@8b699cc6247d9ae80febdd638f102b0ed38b1873 does the same.
* Remove Cloth Config from Forge
Cloth Config on Forge is dead: shedaniel/cloth-config#322 and doesn't
work, attempting to open the Config screen doesn't work and logs an
Exception. Still keep it on NeoForge.
* NeoForge: Add Cloth Config as optional dependency for modrinth/cf
* (Neo)Forge: Remove local modmenu dependency
Neither of these loaders use it anyway, Fabric uses a non-local version.
* NeoForge: Switch back to online Cloth Config API artifact
This uses the latest version makes runClient configuration work again.
* build.gradle: cleanup repositories
* Fix Forge build
* Use NeoForge Cloth Config for Forge build
* List tibequadorian and xbjfk as contributors
* List Cloth Config Forge port in project relations
---------
Co-authored-by: Aizistral <admin@aizistral.com>
Diffstat (limited to 'src')
11 files changed, 26 insertions, 38 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/common/NCRClient.java b/src/main/java/com/aizistral/nochatreports/common/NCRClient.java index 0f9aff9..9df6ce0 100644 --- a/src/main/java/com/aizistral/nochatreports/common/NCRClient.java +++ b/src/main/java/com/aizistral/nochatreports/common/NCRClient.java @@ -2,7 +2,6 @@ package com.aizistral.nochatreports.common; import java.util.function.Function; -import com.aizistral.nochatreports.common.config.ClothConfigIntegration; import com.aizistral.nochatreports.common.config.NCRConfig; import com.aizistral.nochatreports.common.core.ServerDataExtension; import com.aizistral.nochatreports.common.core.ServerSafetyLevel; @@ -35,14 +34,6 @@ public class NCRClient { ClientEvents.PLAY_READY.register(NCRClient::onPlayReady); } - @Nullable - public static Function<Screen, Screen> getConfigScreen() { - if (ClothConfigIntegration.ACTIVE) return ClothConfigIntegration::getConfigScreen; - - NCRCore.LOGGER.warn("ClothConfig API not found, cannot provide config screen factory."); - return null; - } - private static void onDisconnect(Minecraft client) { if (!NCRConfig.getClient().enableMod()) return; @@ -62,7 +53,7 @@ public class NCRClient { if (!client.isLocalServer()) { if (ServerSafetyState.isOnRealms()) { // NO-OP - } else if (!handler.getConnection().isEncrypted()) { + } else if (!handler.onlineMode()) { ServerSafetyState.updateCurrent(ServerSafetyLevel.SECURE); } else if (client.getCurrentServer() instanceof ServerDataExtension ext && ext.preventsChatReports()) { @@ -98,7 +89,7 @@ public class NCRClient { public static void resendLastChatMessage() { var mc = Minecraft.getInstance(); - var chatScr = mc.screen instanceof ChatScreen chat ? chat : null; + var chatScr = mc.gui.screen() instanceof ChatScreen chat ? chat : null; if (chatScr == null) { chatScr = new ChatScreen("", false); diff --git a/src/main/java/com/aizistral/nochatreports/common/config/ClothConfigIntegration.java b/src/main/java/com/aizistral/nochatreports/common/config/ClothConfigIntegration.java index af765db..302f6ae 100644 --- a/src/main/java/com/aizistral/nochatreports/common/config/ClothConfigIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/common/config/ClothConfigIntegration.java @@ -69,7 +69,7 @@ public final class ClothConfigIntegration { protected static Screen getConfigScreen(Screen parent) { // Get the previous screen ConfigBuilder builder = ConfigBuilder.create() - .setParentScreen(Minecraft.getInstance().screen) + .setParentScreen(Minecraft.getInstance().gui.screen()) .setTitle(Component.translatable("configuration.NoChatReports.config")); // Set category diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/RealmsWarningScreen.java b/src/main/java/com/aizistral/nochatreports/common/gui/RealmsWarningScreen.java index 75d5d61..dd4c2a5 100644 --- a/src/main/java/com/aizistral/nochatreports/common/gui/RealmsWarningScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/gui/RealmsWarningScreen.java @@ -32,7 +32,7 @@ public class RealmsWarningScreen extends WarningScreen { } protected void onProceed(Button button) { - this.minecraft.setScreen(this.realms); + this.minecraft.gui.setScreen(this.realms); if (this.stopShowing.selected()) { NCRConfig.getClient().setSkipRealmsWarning(true); } @@ -41,7 +41,7 @@ public class RealmsWarningScreen extends WarningScreen { } protected void onBack(Button button) { - this.minecraft.setScreen(this.previous); + this.minecraft.gui.setScreen(this.previous); } public static boolean shouldShow() { @@ -53,12 +53,12 @@ public class RealmsWarningScreen extends WarningScreen { LinearLayout linearLayout = LinearLayout.horizontal().spacing(8); linearLayout.addChild(Button.builder(CommonComponents.GUI_PROCEED, this::onProceed).build()); linearLayout.addChild(Button.builder(LEARN, button -> { - Minecraft.getInstance().setScreen(new ConfirmLinkScreen(agree -> { + Minecraft.getInstance().gui.setScreen(new ConfirmLinkScreen(agree -> { if (agree) { Util.getPlatform().openUri(WIKI_LINK); } - Minecraft.getInstance().setScreen(this); + Minecraft.getInstance().gui.setScreen(this); }, WIKI_LINK, true)); }).build()); linearLayout.addChild(Button.builder(CommonComponents.GUI_BACK, this::onBack).build()); diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java b/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java index dd1c199..fe5e3f1 100644 --- a/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java @@ -41,13 +41,13 @@ public final class UnsafeServerScreen extends WarningScreen { LinearLayout linearLayout = LinearLayout.horizontal().spacing(8); linearLayout.addChild(Button.builder(Component.translatable("gui.nochatreports.signing_required.allow_signing"), button -> { ServerSafetyState.setAllowChatSigning(true); - this.minecraft.setScreen(this.previous); + this.minecraft.gui.setScreen(this.previous); }).build()); linearLayout.addChild(Button.builder(Component.translatable("gui.nochatreports.signing_required.cancel"), button -> { if (this.stopShowing.selected()) { hideThisSession = true; } - this.minecraft.setScreen(this.previous); + this.minecraft.gui.setScreen(this.previous); }).build()); return linearLayout; } diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java index 0480908..bb84fc5 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java @@ -71,10 +71,10 @@ public class MixinChatListener { } if (NCRConfig.getServerPreferences().hasModeCurrent(SigningMode.PROMPT)) { - Screen returnScreen = Minecraft.getInstance().screen instanceof ChatScreen chat ? chat + Screen returnScreen = Minecraft.getInstance().gui.screen() instanceof ChatScreen chat ? chat : new ChatScreen("", false); Screen unsafeScreen = new UnsafeServerScreen(returnScreen); - Minecraft.getInstance().setScreen(unsafeScreen); + Minecraft.getInstance().gui.setScreen(unsafeScreen); if (NCRConfig.getClient().hideSigningRequestMessage()) { info.cancel(); diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java index 9673848..5b2c846 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java @@ -67,7 +67,7 @@ public abstract class MixinChatScreen extends Screen { @Inject(method = "handleChatInput", at = @At("HEAD"), cancellable = true) private void onHandleChatInput(String string, boolean bl, CallbackInfo info) { if (NCRConfig.getServerPreferences().hasModeCurrent(SigningMode.ALWAYS) && !ServerSafetyState.allowChatSigning()) { - if (this.minecraft.getConnection().getConnection().isEncrypted()) { + if (this.minecraft.getConnection().onlineMode()) { if (!this.normalizeChatMessage(string).isEmpty()) { ServerSafetyState.updateCurrent(ServerSafetyLevel.INSECURE); ServerSafetyState.scheduleSigningAction(NCRClient::resendLastChatMessage); @@ -141,7 +141,7 @@ public abstract class MixinChatScreen extends Screen { String signing = "gui.nochatreports.signing_status."; - if (!this.minecraft.getConnection().getConnection().isEncrypted()) { + if (!this.minecraft.getConnection().onlineMode()) { signing += "disabled_offline"; } else if (ServerSafetyState.getCurrent() == ServerSafetyLevel.REALMS) { signing += "allowed_realms"; diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinOnlineServerEntry.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinOnlineServerEntry.java index cdc1aef..0895521 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinOnlineServerEntry.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinOnlineServerEntry.java @@ -46,9 +46,9 @@ public abstract class MixinOnlineServerEntry extends ServerSelectionList.Entry { int xOffset = NCRConfig.getClient().getVerifiedIconOffsetX(), yOffset = NCRConfig.getClient().getVerifiedIconOffsetY(); - GlStateManager._enableBlend(); + GlStateManager._enableBlend(0); graphics.blitSprite(RenderPipelines.GUI_TEXTURED, VERIFIED_ICON, this.getContentRight() - 35 + xOffset, this.getContentY() - 1 + yOffset, 14, 14); - GlStateManager._disableBlend(); + GlStateManager._disableBlend(0); int t = mouseX - this.getContentX(); int u = mouseY - this.getContentY(); diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinTitleScreen.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinTitleScreen.java index b005f5b..113076d 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinTitleScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinTitleScreen.java @@ -20,10 +20,10 @@ public class MixinTitleScreen extends Screen { throw new IllegalStateException("Can't touch this"); } - @Inject(method = { "lambda$createNormalMenuOptions$2" }, at = @At("HEAD"), cancellable = true) + @Inject(method = { "lambda$createNormalMenuOptions$4" }, at = @At("HEAD"), cancellable = true) private void onRealmsButtonClicked(Button button, CallbackInfo info) { if (RealmsWarningScreen.shouldShow()) { - this.minecraft.setScreen(new RealmsWarningScreen(new TitleScreen(), new RealmsMainScreen(this))); + this.minecraft.gui.setScreen(new RealmsWarningScreen(new TitleScreen(), new RealmsMainScreen(this))); info.cancel(); } } diff --git a/src/main/java/com/aizistral/nochatreports/fabric/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/fabric/config/ModMenuIntegration.java index 86c1ea6..d719ac7 100644 --- a/src/main/java/com/aizistral/nochatreports/fabric/config/ModMenuIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/fabric/config/ModMenuIntegration.java @@ -1,11 +1,7 @@ package com.aizistral.nochatreports.fabric.config; -import java.util.function.Function; - -import net.minecraft.client.gui.screens.Screen; - -import com.aizistral.nochatreports.common.NCRClient; - +import com.aizistral.nochatreports.common.NCRCore; +import com.aizistral.nochatreports.common.config.ClothConfigIntegration; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; @@ -20,8 +16,8 @@ public final class ModMenuIntegration implements ModMenuApi { @Override public ConfigScreenFactory<?> getModConfigScreenFactory() { - Function<Screen, Screen> configScreenFactory = NCRClient.getConfigScreen(); - if (configScreenFactory != null) return configScreenFactory::apply; + if (ClothConfigIntegration.ACTIVE) return ClothConfigIntegration::getConfigScreen; + NCRCore.LOGGER.warn("ClothConfig API not found, cannot provide config screen factory."); return ModMenuApi.super.getModConfigScreenFactory(); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 0e54d36..cf11719 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -9,7 +9,9 @@ "${mod_author}" ], "contributors": [ - "${contributor_0}" + "${contributor_0}", + "${contributor_1}", + "${contributor_2}" ], "contact": { "homepage": "${mod_url}", @@ -38,9 +40,9 @@ ], "depends": { - "fabricloader": ">=0.18.4", + "fabricloader": ">=${fabric_loader_version}", "fabric-api": "*", - "minecraft": [ ">=26.1" ], + "minecraft": [ ">=${minecraft_version}" ], "java": ">=25" }, "suggests": {}, diff --git a/src/main/resources/mixins/common/nochatreports.mixins.json b/src/main/resources/mixins/common/nochatreports.mixins.json index 0261dd3..0dd20df 100644 --- a/src/main/resources/mixins/common/nochatreports.mixins.json +++ b/src/main/resources/mixins/common/nochatreports.mixins.json @@ -2,7 +2,6 @@ "required": true, "minVersion": "0.8", "package": "com.aizistral.nochatreports.common.mixins", - "compatibilityLevel": "JAVA_25", "mixins": [ "common.MixinJsonByteBufCodec", "server.MixinServerboundChatPacket", |
