vanilla-fixes

Minecraft: Better than Adventure! mod that fixes some issues
git clone git://memoryshards.xyz/vanilla-fixes.git
Log | Files | Refs | README | LICENSE

commit f9394b6862c9a075504f80462b0c6531e4fe32d8
parent 5042b4015d61065bdc84cf35d908e1f02ad76f18
Author: Amb0s <ambos@disroot.org>
Date:   Mon,  7 Aug 2023 00:47:42 +0200

Changed group, package and contact links

Diffstat:
Mgradle.properties | 2+-
Dsrc/main/java/ambos/vanillafixes/VanillaFixes.java | 15---------------
Dsrc/main/java/ambos/vanillafixes/mixin/DisplayListMixin.java | 42------------------------------------------
Dsrc/main/java/ambos/vanillafixes/mixin/GuiMainMenuMixin.java | 37-------------------------------------
Asrc/main/java/turniplabs/vanillafixes/VanillaFixes.java | 15+++++++++++++++
Asrc/main/java/turniplabs/vanillafixes/mixin/DisplayListMixin.java | 42++++++++++++++++++++++++++++++++++++++++++
Asrc/main/java/turniplabs/vanillafixes/mixin/GuiMainMenuMixin.java | 37+++++++++++++++++++++++++++++++++++++
Msrc/main/resources/fabric.mod.json | 12++++--------
Msrc/main/resources/vanillafixes.mixins.json | 2+-
9 files changed, 100 insertions(+), 104 deletions(-)

diff --git a/gradle.properties b/gradle.properties @@ -8,5 +8,5 @@ loader_version=0.14.19-babric.1-bta # Mod mod_version=4.0.0 -mod_group=ambos +mod_group=turniplabs mod_name=vanilla-fixes diff --git a/src/main/java/ambos/vanillafixes/VanillaFixes.java b/src/main/java/ambos/vanillafixes/VanillaFixes.java @@ -1,15 +0,0 @@ -package ambos.vanillafixes; - -import net.fabricmc.api.ModInitializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class VanillaFixes implements ModInitializer { - public static final String MOD_ID = "vanillafixes"; - public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); - - @Override - public void onInitialize() { - LOGGER.info("VanillaFixes initialized"); - } -} diff --git a/src/main/java/ambos/vanillafixes/mixin/DisplayListMixin.java b/src/main/java/ambos/vanillafixes/mixin/DisplayListMixin.java @@ -1,42 +0,0 @@ -package ambos.vanillafixes.mixin; - -import net.minecraft.client.render.DisplayList; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyArgs; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.invoke.arg.Args; - -@Mixin(value = DisplayList.class, remap = false) -final class DisplayListMixin { - private double offsetX; - private double offsetY; - private double offsetZ; - - @Shadow - private int posX; - - @Shadow - private int posY; - - @Shadow - private int posZ; - - @Inject(method = "setToPos", at = @At("RETURN"), require = 0) - private void onSetToPos(int blockX, int blockY, int blockZ, double offsetX, double offsetY, double offsetZ, - CallbackInfo ci) { - this.offsetX = offsetX; - this.offsetY = offsetY; - this.offsetZ = offsetZ; - } - - @ModifyArgs(method = "call", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glTranslatef(FFF)V"), - require = 0) - private void changeType(Args args) { - args.set(0, (float) ((double) this.posX - this.offsetX)); - args.set(1, (float) ((double) this.posY - this.offsetY)); - args.set(2, (float) ((double) this.posZ - this.offsetZ)); - } -} diff --git a/src/main/java/ambos/vanillafixes/mixin/GuiMainMenuMixin.java b/src/main/java/ambos/vanillafixes/mixin/GuiMainMenuMixin.java @@ -1,36 +0,0 @@ -package ambos.vanillafixes.mixin; - -import net.minecraft.client.gui.GuiMainMenu; -import net.minecraft.client.gui.GuiScreen; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.*; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.invoke.arg.Args; - -@Mixin(value = GuiMainMenu.class, remap = false) -final class GuiMainMenuMixin extends GuiScreen { - - @Inject(method = "initGui", at = @At("RETURN"), require = 0) - private void removeLinks(CallbackInfo ci) { - controlList.removeIf(button -> button.id == 5 || button.id == 6 || button.id == 7); - } - - @Inject(method = "initGui", at = @At("RETURN"), require = 0) - private void removeButtons(CallbackInfo ci) { - controlList.removeIf(button -> button.id == 3 || button.id == 8 || button.id == 100); - } - - @ModifyArgs(method = "drawScreen", at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/render/FontRenderer;drawCenteredString(Ljava/lang/String;III)V"), - require = 0) - private void removeDownloadingResourcesString(Args args) { - args.set(0, ""); - } - - /* - @ModifyConstant(method = "drawScreen", constant = @Constant(stringValue = "")) - private String removeConstantString(String value) { - return ""; - } - */ -} -\ No newline at end of file diff --git a/src/main/java/turniplabs/vanillafixes/VanillaFixes.java b/src/main/java/turniplabs/vanillafixes/VanillaFixes.java @@ -0,0 +1,15 @@ +package turniplabs.vanillafixes; + +import net.fabricmc.api.ModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class VanillaFixes implements ModInitializer { + public static final String MOD_ID = "vanillafixes"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + + @Override + public void onInitialize() { + LOGGER.info("VanillaFixes initialized"); + } +} diff --git a/src/main/java/turniplabs/vanillafixes/mixin/DisplayListMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/DisplayListMixin.java @@ -0,0 +1,42 @@ +package turniplabs.vanillafixes.mixin; + +import net.minecraft.client.render.DisplayList; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArgs; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.invoke.arg.Args; + +@Mixin(value = DisplayList.class, remap = false) +final class DisplayListMixin { + private double offsetX; + private double offsetY; + private double offsetZ; + + @Shadow + private int posX; + + @Shadow + private int posY; + + @Shadow + private int posZ; + + @Inject(method = "setToPos", at = @At("RETURN"), require = 0) + private void onSetToPos(int blockX, int blockY, int blockZ, double offsetX, double offsetY, double offsetZ, + CallbackInfo ci) { + this.offsetX = offsetX; + this.offsetY = offsetY; + this.offsetZ = offsetZ; + } + + @ModifyArgs(method = "call", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glTranslatef(FFF)V"), + require = 0) + private void changeType(Args args) { + args.set(0, (float) ((double) this.posX - this.offsetX)); + args.set(1, (float) ((double) this.posY - this.offsetY)); + args.set(2, (float) ((double) this.posZ - this.offsetZ)); + } +} diff --git a/src/main/java/turniplabs/vanillafixes/mixin/GuiMainMenuMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/GuiMainMenuMixin.java @@ -0,0 +1,36 @@ +package turniplabs.vanillafixes.mixin; + +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.*; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.invoke.arg.Args; + +@Mixin(value = GuiMainMenu.class, remap = false) +final class GuiMainMenuMixin extends GuiScreen { + + @Inject(method = "initGui", at = @At("RETURN"), require = 0) + private void removeLinks(CallbackInfo ci) { + controlList.removeIf(button -> button.id == 5 || button.id == 6 || button.id == 7); + } + + @Inject(method = "initGui", at = @At("RETURN"), require = 0) + private void removeButtons(CallbackInfo ci) { + controlList.removeIf(button -> button.id == 3 || button.id == 8 || button.id == 100); + } + + @ModifyArgs(method = "drawScreen", at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/render/FontRenderer;drawCenteredString(Ljava/lang/String;III)V"), + require = 0) + private void removeDownloadingResourcesString(Args args) { + args.set(0, ""); + } + + /* + @ModifyConstant(method = "drawScreen", constant = @Constant(stringValue = "")) + private String removeConstantString(String value) { + return ""; + } + */ +} +\ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json @@ -2,31 +2,27 @@ "schemaVersion": 1, "id": "vanillafixes", "version": "${version}", - "name": "Vanilla Fixes", "description": "Fixes some issues present in the base game.", "authors": [ "Ambos" ], "contact": { - "homepage": "https://github.com/Amb0s/vanilla-fixes", - "sources": "https://github.com/Amb0s/vanilla-fixes", - "issues": "https://github.com/Amb0s/vanilla-fixes/issues" + "homepage": "https://github.com/Turnip-Labs", + "sources": "https://github.com/Turnip-Labs/vanilla-fixes", + "issues": "https://github.com/Turnip-Labs/vanilla-fixes/issues" }, - "license": "MIT", "icon": "icon.png", - "environment": "*", "entrypoints": { "main": [ - "ambos.vanillafixes.VanillaFixes" + "turniplabs.vanillafixes.VanillaFixes" ] }, "mixins": [ "vanillafixes.mixins.json" ], - "depends": { "fabricloader": ">=0.13.3" }, diff --git a/src/main/resources/vanillafixes.mixins.json b/src/main/resources/vanillafixes.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "ambos.vanillafixes.mixin", + "package": "turniplabs.vanillafixes.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ ],