-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
215 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Apr 12 14:43:03 PDT 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins { | ||
id 'fabric-loom' | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:1.21" | ||
mappings "net.fabricmc:yarn:${project.yarn_1_21}:v2" | ||
implementation project(path: ":base", configuration: "namedElements") | ||
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}") | ||
} | ||
|
||
loom { | ||
mixin { | ||
defaultRefmapName = "realmsfix-1.21.refmap.json" | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
versions/1.21/src/main/java/dev/blucobalt/realmsfix/mixin/RealmsNotificationsScreen1_21.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* This file is part of realmsfix. | ||
* | ||
* realmsfix is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* realmsfix is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with realmsfix. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package dev.blucobalt.realmsfix.mixin; | ||
|
||
|
||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.realms.gui.screen.RealmsNotificationsScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
|
||
@Mixin(RealmsNotificationsScreen.class) | ||
public class RealmsNotificationsScreen1_21 | ||
{ | ||
@Inject(method = "render", at = @org.spongepowered.asm.mixin.injection.At(value = "HEAD"), cancellable = true) | ||
public void donothing(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) | ||
{ | ||
ci.cancel(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
versions/1.21/src/main/java/dev/blucobalt/realmsfix/mixin/TitleScreenAccessor1_21.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* This file is part of realmsfix. | ||
* | ||
* realmsfix is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* realmsfix is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with realmsfix. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package dev.blucobalt.realmsfix.mixin; | ||
|
||
|
||
import net.minecraft.client.gui.Drawable; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.List; | ||
|
||
|
||
@Mixin(Screen.class) | ||
public interface TitleScreenAccessor1_21 | ||
{ | ||
@Accessor(value = "drawables") | ||
List<Drawable> getDrawables(); | ||
} |
58 changes: 58 additions & 0 deletions
58
versions/1.21/src/main/java/dev/blucobalt/realmsfix/mixin/TitleScreenMixin1_21.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* This file is part of realmsfix. | ||
* | ||
* realmsfix is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* realmsfix is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with realmsfix. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package dev.blucobalt.realmsfix.mixin; | ||
|
||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.Drawable; | ||
import net.minecraft.client.gui.screen.TitleScreen; | ||
import net.minecraft.client.gui.widget.ButtonWidget; | ||
import net.minecraft.text.MutableText; | ||
import net.minecraft.text.Text; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.util.List; | ||
|
||
|
||
@Pseudo | ||
@Mixin(TitleScreen.class) | ||
public class TitleScreenMixin1_21 | ||
{ | ||
@Inject(method = "initWidgetsNormal", at = @At(value = "TAIL")) | ||
public void donothing(int y, int spacingY, CallbackInfo ci) | ||
{ | ||
if (MinecraftClient.getInstance().currentScreen instanceof TitleScreen){ | ||
TitleScreenAccessor1_21 ts = (TitleScreenAccessor1_21) MinecraftClient.getInstance().currentScreen; | ||
List<Drawable> drawables = ts.getDrawables(); | ||
for (Drawable drawable : drawables) { | ||
if (drawable instanceof ButtonWidget){ | ||
ButtonWidget buttonWidget = (ButtonWidget) drawable; | ||
Text message = buttonWidget.getMessage(); | ||
MutableText t = (MutableText) message; | ||
TranslatableTextAccessor1_21 accessor = (TranslatableTextAccessor1_21) t.getContent(); | ||
if (accessor.getKey().equals("menu.online")){ | ||
((ButtonWidget) drawable).visible = false; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
versions/1.21/src/main/java/dev/blucobalt/realmsfix/mixin/TranslatableTextAccessor1_21.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* This file is part of realmsfix. | ||
* | ||
* realmsfix is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* realmsfix is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with realmsfix. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package dev.blucobalt.realmsfix.mixin; | ||
|
||
|
||
import net.minecraft.text.TranslatableTextContent; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
|
||
@Mixin(TranslatableTextContent.class) | ||
public interface TranslatableTextAccessor1_21 | ||
{ | ||
@Accessor(value = "key") | ||
String getKey(); | ||
} |
16 changes: 16 additions & 0 deletions
16
versions/1.21/src/main/resources/realmsfix-1.21.mixins.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "dev.blucobalt.realmsfix.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"client": [ | ||
"RealmsNotificationsScreen1_21", | ||
"TitleScreenAccessor1_21", | ||
"TitleScreenMixin1_21", | ||
"TranslatableTextAccessor1_21" | ||
], | ||
"refmap": "realmsfix-1.21.refmap.json" | ||
} |