Skip to content

Commit

Permalink
v1.0.3 Fix compatibility with Tweakeroo
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzzh committed Aug 5, 2024
1 parent 7595030 commit aa54abf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
path: |
urlimg-fabric/urlimg-fabric-1.20.4-1.20.2/build/libs/**.jar
# Fabric 1.20.1-1.20
- name: Upload Artifact (Fabric 1.20)
- name: Upload Artifact (Fabric 1.20.1-1.20)
uses: actions/upload-artifact@v4
with:
name: 'urlimg Fabric 1.20.1-1.20'
Expand Down
14 changes: 1 addition & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ plugins {
id("fabric-loom") version "1.6-SNAPSHOT" apply false
}

def gitCommitHash = {
def cmd = "git rev-parse --short HEAD"
try {
def ver = cmd.execute().text.trim()
if (ver == "") return ""
return "+" + ver
} catch (Exception e) {
e.printStackTrace()
return ""
}
}

allprojects {
repositories {
mavenCentral()
Expand All @@ -32,7 +20,7 @@ subprojects {
apply plugin: 'java-library'

group = "com.paulzzh"
version = "1.0.2"
version = "1.0.3"

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import com.mojang.blaze3d.systems.RenderSystem;
import com.paulzzh.urlimg.Image;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.OrderedText;
import net.minecraft.text.StringVisitable;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static com.paulzzh.urlimg.Mod.IM;
import static com.paulzzh.urlimg.Mod.line_map;
Expand All @@ -21,10 +22,9 @@
@Mixin(net.minecraft.client.gui.hud.ChatHud.class)
public abstract class MixinChatHud {

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V", ordinal = 0))
private void injected2(MatrixStack matrixStack, int i, int j, int k, int l, int m, @Share("indexY") LocalIntRef argRef) {
argRef.set(j);
ChatHud.fill(matrixStack, i, j, k, l, m);
@ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V"))
private void injected1(Args args, @Share("indexY") LocalIntRef argRef) {
argRef.set(args.get(2));
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;drawWithShadow(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/text/OrderedText;FFI)I"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static com.paulzzh.urlimg.Mod.IM;
import static com.paulzzh.urlimg.Mod.line_map;

@Mixin(net.minecraft.client.gui.hud.ChatHud.class)
public abstract class MixinChatHud {

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected2(DrawContext instance, int i, int j, int k, int l, int m, @Share("indexY") LocalIntRef argRef) {
argRef.set(j);
instance.fill(i, j, k, l, m);
@ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected1(Args args, @Share("indexY") LocalIntRef argRef) {
argRef.set(args.get(1));
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawTextWithShadow(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/OrderedText;III)I"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static com.paulzzh.urlimg.Mod.IM;
import static com.paulzzh.urlimg.Mod.line_map;

@Mixin(net.minecraft.client.gui.hud.ChatHud.class)
public abstract class MixinChatHud {

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected2(DrawContext instance, int i, int j, int k, int l, int m, @Share("indexY") LocalIntRef argRef) {
argRef.set(j);
instance.fill(i, j, k, l, m);
@ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected1(Args args, @Share("indexY") LocalIntRef argRef) {
argRef.set(args.get(1));
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawTextWithShadow(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/OrderedText;III)I"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static com.paulzzh.urlimg.Mod.IM;
import static com.paulzzh.urlimg.Mod.line_map;

@Mixin(net.minecraft.client.gui.hud.ChatHud.class)
public abstract class MixinChatHud {

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected2(DrawContext instance, int i, int j, int k, int l, int m, @Share("indexY") LocalIntRef argRef) {
argRef.set(j);
instance.fill(i, j, k, l, m);
@ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fill(IIIII)V"))
private void injected1(Args args, @Share("indexY") LocalIntRef argRef) {
argRef.set(args.get(1));
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawTextWithShadow(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/OrderedText;III)I"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import com.paulzzh.urlimg.Image;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.NewChatGui;
import net.minecraft.util.IReorderingProcessor;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextProperties;
import org.spongepowered.asm.mixin.Final;
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.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static com.paulzzh.urlimg.Mod.IM;
import static com.paulzzh.urlimg.Mod.line_map;
Expand All @@ -26,10 +27,9 @@ public abstract class MixinChatHud {
private Minecraft minecraft;
private int indexY;

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/NewChatGui;fill(Lcom/mojang/blaze3d/matrix/MatrixStack;IIIII)V", ordinal = 0))
private void injected2(MatrixStack matrixStack, int i, int j, int k, int l, int m) {
indexY = j;
NewChatGui.fill(matrixStack, i, j, k, l, m);
@ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/NewChatGui;fill(Lcom/mojang/blaze3d/matrix/MatrixStack;IIIII)V"))
private void injected1(Args args) {
indexY = args.get(2);
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawShadow(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/util/IReorderingProcessor;FFI)I"))
Expand Down

0 comments on commit aa54abf

Please sign in to comment.