Skip to content

Commit

Permalink
Fix some Forge stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Aizistral committed May 10, 2024
1 parent 43c3ce7 commit 6865a2f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
30 changes: 14 additions & 16 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,29 @@ minecraft {
copyIdeResources = true

runs {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
}


client {
properties 'org.gradle.jvmargs': '-Xms4G -Xmx4G'
properties 'fml.earlyprogresswindow': 'false'
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')

property 'forge.enabledGameTestNamespaces', mod_id
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'

mods {
nochatreports {
source sourceSets.main
}
}
}

server {
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')

property 'forge.enabledGameTestNamespaces', mod_id
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'

mods {
nochatreports {
source sourceSets.main
}
}
args '--nogui'
}
}
}
Expand All @@ -129,6 +124,9 @@ dependencies {
implementation "generic:fabric-annotations:v1.0.0"
implementation "generic:cloth-config-api:14.0.126"
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"

// Hack fix for now, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transtive dependencies request 6.0+
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "com.aizistral.nochatreports.forge.mixins",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_18",
"mixins": [],
"client": [
"client.MixinClientConnection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "com.aizistral.nochatreports.neoforge.mixins",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_18",
"mixins": [],
"client": [
"client.MixinClientConnection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.chat.ChatListener;
import net.minecraft.client.multiplayer.chat.ChatTrustLevel;
import net.minecraft.core.RegistryAccess;
Expand Down Expand Up @@ -64,8 +65,10 @@ private void onHandleSystemMessage(Component message, boolean overlay, CallbackI
}

if (NCRConfig.getServerPreferences().hasModeCurrent(SigningMode.PROMPT)) {
Minecraft.getInstance().setScreen(new UnsafeServerScreen(Minecraft.getInstance().screen
instanceof ChatScreen chat ? chat : new ChatScreen("")));
Screen returnScreen = Minecraft.getInstance().screen instanceof ChatScreen chat ? chat
: new ChatScreen("");
Screen unsafeScreen = new UnsafeServerScreen(returnScreen);
Minecraft.getInstance().setScreen(unsafeScreen);

if (NCRConfig.getClient().hideSigningRequestMessage()) {
info.cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected MixinTitleScreen() {
throw new IllegalStateException("Can't touch this");
}

@Inject(method = "method_55814", at = @At("HEAD"), cancellable = true)
@Inject(method = { "realmsButtonClicked", "method_55814", "lambda$createNormalMenuOptions$9" }, 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)));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mixins/common/nochatreports.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "com.aizistral.nochatreports.common.mixins",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_18",
"mixins": [
"common.MixinServerStatus",
"common.MixinFriendlyByteBuf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "com.aizistral.nochatreports.fabric.mixins",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_18",
"mixins": [
],
"client": [
Expand Down

0 comments on commit 6865a2f

Please sign in to comment.