Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BluCobalt committed Apr 17, 2023
1 parent 317b477 commit b6d79a5
Show file tree
Hide file tree
Showing 99 changed files with 1,669 additions and 593 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build/
**/run/
**.iml
**.xml
.name
.name
artifacts/
8 changes: 1 addition & 7 deletions 1.13.2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'legacy-looming' version "${loom_version}"
id 'fabric-loom'
}

loom {
setIntermediaryUrl('https://repo.legacyfabric.net/repository/legacyfabric/net/legacyfabric/intermediary/%1$s/intermediary-%1$s-v2.jar');

runConfigs.configureEach {
ideConfigGenerated = true
}
}

dependencies {
minecraft "com.mojang:minecraft:1.13.2"
mappings "net.legacyfabric:yarn:${project.yarn_1_13_2}:v2"
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
runtimeOnly("net.fabricmc:dev-launch-injector:0.2.1+build.8")
}
20 changes: 0 additions & 20 deletions 1.13.2/src/main/java/dev/blucobalt/rbr/mixin/GameOptionsMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* 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.option.GameOptions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;


@Mixin(GameOptions.class)
public class GameOptionsMixin
{
/**
* don't let if blocks run
*/
@Inject(method = "getIntVideoOptions", at = @At("RETURN"), cancellable = true)
public void getIntVideoOptions(GameOptions.Option option, CallbackInfoReturnable<Boolean> cir)
{
if (option == GameOptions.Option.REALMS_NOTIFICATIONS) {
cir.setReturnValue(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* 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.screen.SettingsScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;


@Mixin(SettingsScreen.class)
public class SettingsScreenMixin
{
/**
* don't draw button/do nothing when it tries to add it
*/
@Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/SettingsScreen;addButton(Lnet/minecraft/client/gui/widget/ButtonWidget;)Lnet/minecraft/client/gui/widget/ButtonWidget;", ordinal = 4))
public ButtonWidget donothing(SettingsScreen instance, ButtonWidget buttonWidget)
{
// do nothing
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
package dev.blucobalt.rbr.mixin;
/**
* 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.screen.TitleScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
Expand All @@ -8,22 +25,26 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;


@Mixin(TitleScreen.class)
public class TitleScreenMixin {
public class TitleScreenMixin
{

/**
* don't let if blocks run
*/
@Inject(method = "areRealmsNotificationsEnabled", at = @At("RETURN"), cancellable = true)
public void areRealmsNotificationsEnabled(CallbackInfoReturnable<Boolean> cir) {
public void areRealmsNotificationsEnabled(CallbackInfoReturnable<Boolean> cir)
{
cir.setReturnValue(false);
}

/**
* don't draw button/do nothing when it tries to add it
*/
@Redirect(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addButton(Lnet/minecraft/client/gui/widget/ButtonWidget;)Lnet/minecraft/client/gui/widget/ButtonWidget;", ordinal = 2))
public ButtonWidget donothing(TitleScreen instance, ButtonWidget buttonWidget) {
public ButtonWidget donothing(TitleScreen instance, ButtonWidget buttonWidget)
{
// do nothing
return null;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions 1.13.2/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"schemaVersion": 1,
"id": "realmfix",
"id": "realmsfix",
"version": "${version}",
"name": "Realm Button Remover",
"description": "Removes the realm button from the title screen.",
"name": "Realms Button Remover",
"description": "Removes the realms button from the title screen.",
"authors": [
"Me!"
"blucobalt"
],
"contact": {
"homepage": "https://legacyfabric.net/",
"sources": "https://github.com/Legacy-Fabric/fabric-example-mod"
"sources": "https://github.com/blucobalt/realmsfix"
},
"license": "CC0-1.0",
"icon": "assets/legacyrealmfix/icon.png",
"license": "LGPL-2.1",
"icon": "assets/realmsfix/icon.png",
"environment": "client",
"mixins": [
"legacyrealmfix.mixins.json"
"realmsfix.mixins.json"
],
"depends": {
"fabricloader": ">=0.12.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "dev.blucobalt.rbr.mixin",
"package": "dev.blucobalt.realmsfix.mixin",
"compatibilityLevel": "JAVA_8",
"injectors": {
"defaultRequire": 1
Expand Down
7 changes: 0 additions & 7 deletions 1.14.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@ plugins {
id 'fabric-loom'
}

loom {
runConfigs.configureEach {
ideConfigGenerated = true
}
}

dependencies {
minecraft "com.mojang:minecraft:1.15.2"
mappings "net.fabricmc:yarn:${project.yarn_1_15_2}:v2"
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
runtimeOnly("net.fabricmc:dev-launch-injector:0.2.1+build.8")
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* 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.screen.SettingsScreen;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;


@Mixin(SettingsScreen.class)
public class SettingsScreenMixin
{
/**
* don't draw button/do nothing when it tries to add it
*/
@Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/SettingsScreen;addButton(Lnet/minecraft/client/gui/widget/AbstractButtonWidget;)Lnet/minecraft/client/gui/widget/AbstractButtonWidget;", ordinal = 3), expect = 0, require = 0)
public AbstractButtonWidget donothing(SettingsScreen instance, AbstractButtonWidget abstractButtonWidget)
{
// do nothing
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
package dev.blucobalt.rbr.mixin;
/**
* 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.screen.TitleScreen;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
Expand All @@ -9,36 +26,38 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;


@Pseudo
@Mixin(TitleScreen.class)
public class TitleScreenMixin {
public class TitleScreenMixin
{

/**
* don't let if blocks run
* 1.14.4-1.15.2
*/
@Inject(method = "areRealmsNotificationsEnabled", at = @At("RETURN"), cancellable = true,
expect = 0, require = 0)
public void areRealmsNotificationsEnabled(CallbackInfoReturnable<Boolean> cir) {
@Inject(method = "areRealmsNotificationsEnabled", at = @At("RETURN"), cancellable = true, expect = 0, require = 0)
public void areRealmsNotificationsEnabled(CallbackInfoReturnable<Boolean> cir)
{
cir.setReturnValue(false);
}

/**
* don't draw button/do nothing when it tries to add it
*/
@Redirect(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addButton(Lnet/minecraft/client/gui/widget/AbstractButtonWidget;)Lnet/minecraft/client/gui/widget/AbstractButtonWidget;", ordinal = 2),
expect = 0, require = 0)
public AbstractButtonWidget donothing(TitleScreen instance, AbstractButtonWidget abstractButtonWidget) {
@Redirect(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addButton(Lnet/minecraft/client/gui/widget/AbstractButtonWidget;)Lnet/minecraft/client/gui/widget/AbstractButtonWidget;", ordinal = 2), expect = 0, require = 0)
public AbstractButtonWidget donothing(TitleScreen instance, AbstractButtonWidget abstractButtonWidget)
{
// do nothing
return null;
}

/**
* don't draw button/do nothing when it tries to add it
*/
@Redirect(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addButton(Lnet/minecraft/client/gui/widget/AbstractButtonWidget;)Lnet/minecraft/client/gui/widget/AbstractButtonWidget;", ordinal = 2),
expect = 0, require = 0)
public AbstractButtonWidget donothing1_15_2(TitleScreen instance, AbstractButtonWidget abstractButtonWidget) {
@Redirect(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addButton(Lnet/minecraft/client/gui/widget/AbstractButtonWidget;)Lnet/minecraft/client/gui/widget/AbstractButtonWidget;", ordinal = 2), expect = 0, require = 0)
public AbstractButtonWidget donothing1_15_2(TitleScreen instance, AbstractButtonWidget abstractButtonWidget)
{
// do nothing
return null;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b6d79a5

Please sign in to comment.