diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-26 22:01:52 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-26 22:01:52 -0500 |
commit | cacc7c10365c4ff9c20adde0f2bef7edd3c1cda0 (patch) | |
tree | 3dc4f9a05385d084cb0d4c9c43ead22503b57cd9 /src/main/java/com/dulkirfabric/mixin/render | |
parent | 4e6af3727fc930d00a78fe91e19ba46f2dc63a28 (diff) | |
download | DulkirMod-Fabric-cacc7c10365c4ff9c20adde0f2bef7edd3c1cda0.tar.gz DulkirMod-Fabric-cacc7c10365c4ff9c20adde0f2bef7edd3c1cda0.tar.bz2 DulkirMod-Fabric-cacc7c10365c4ff9c20adde0f2bef7edd3c1cda0.zip |
fixed inventory scaling
Diffstat (limited to 'src/main/java/com/dulkirfabric/mixin/render')
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/LoomScreenMixin.java | 25 | ||||
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/MinecraftClientMixin.java | 9 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/com/dulkirfabric/mixin/render/LoomScreenMixin.java b/src/main/java/com/dulkirfabric/mixin/render/LoomScreenMixin.java new file mode 100644 index 0000000..0270251 --- /dev/null +++ b/src/main/java/com/dulkirfabric/mixin/render/LoomScreenMixin.java @@ -0,0 +1,25 @@ +package com.dulkirfabric.mixin.render; + +import com.dulkirfabric.features.InventoryScale; +import net.minecraft.block.entity.BannerPattern; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.ingame.LoomScreen; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtList; +import net.minecraft.registry.entry.RegistryEntry; +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.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +@Mixin(LoomScreen.class) +public class LoomScreenMixin { + @Inject(method = "drawBanner", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD) + public void onCreateMatrix(DrawContext context, RegistryEntry<BannerPattern> pattern, int x, int y, CallbackInfo ci, NbtCompound nbtCompound, NbtList nbtList, ItemStack itemStack, MatrixStack matrixStack) { + matrixStack.scale(InventoryScale.INSTANCE.getScale(), InventoryScale.INSTANCE.getScale(), 1F); + } +} + diff --git a/src/main/java/com/dulkirfabric/mixin/render/MinecraftClientMixin.java b/src/main/java/com/dulkirfabric/mixin/render/MinecraftClientMixin.java new file mode 100644 index 0000000..9ab55ae --- /dev/null +++ b/src/main/java/com/dulkirfabric/mixin/render/MinecraftClientMixin.java @@ -0,0 +1,9 @@ +package com.dulkirfabric.mixin.render; + +import net.minecraft.client.MinecraftClient; +import org.spongepowered.asm.mixin.Mixin; + +@Mixin(MinecraftClient.class) +public class MinecraftClientMixin { + +} |