From 2baa46b323dcb6377790637e95359389475d01c0 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sat, 27 Apr 2024 15:15:55 -0400 Subject: [PATCH] Alpha --- gradle.properties | 2 +- .../mixin/client/HttpTextureMixin.java | 20 +++++++++++++++++++ .../mixin/client/PlayerRendererMixin.java | 16 +++++++++++++++ src/main/resources/railwaystweaks.mixins.json | 2 ++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/main/java/dev/ithundxr/railwaystweaks/mixin/client/HttpTextureMixin.java create mode 100644 src/main/java/dev/ithundxr/railwaystweaks/mixin/client/PlayerRendererMixin.java diff --git a/gradle.properties b/gradle.properties index d15ec00..349a71a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2G # Mod Properties -mod_version = 0.0.5 +mod_version = 0.0.6 maven_group = dev.ithundxr archives_base_name = RailwaysTweaks diff --git a/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/HttpTextureMixin.java b/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/HttpTextureMixin.java new file mode 100644 index 0000000..0385229 --- /dev/null +++ b/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/HttpTextureMixin.java @@ -0,0 +1,20 @@ +package dev.ithundxr.railwaystweaks.mixin.client; + +import net.minecraft.client.renderer.texture.HttpTexture; +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; + +@Mixin(HttpTexture.class) +public class HttpTextureMixin { + @Inject(method = "setNoAlpha", at = @At("HEAD"), cancellable = true) + private static void railwaysTweaks$noAlpha(CallbackInfo ci) { + ci.cancel(); + } + + @Inject(method = "doNotchTransparencyHack", at = @At("HEAD"), cancellable = true) + private static void railwaysTweaks$noTransparencyHack(CallbackInfo ci) { + ci.cancel(); + } +} diff --git a/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/PlayerRendererMixin.java b/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/PlayerRendererMixin.java new file mode 100644 index 0000000..16b4ffa --- /dev/null +++ b/src/main/java/dev/ithundxr/railwaystweaks/mixin/client/PlayerRendererMixin.java @@ -0,0 +1,16 @@ +package dev.ithundxr.railwaystweaks.mixin.client; + +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.player.PlayerRenderer; +import net.minecraft.resources.ResourceLocation; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(PlayerRenderer.class) +public class PlayerRendererMixin { + @Redirect(method = "renderHand", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderType;entitySolid(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType;")) + private RenderType railwaysTweaks$fixHandTranslucency(ResourceLocation location) { + return RenderType.entityTranslucent(location); + } +} diff --git a/src/main/resources/railwaystweaks.mixins.json b/src/main/resources/railwaystweaks.mixins.json index 934b718..45cb0ee 100644 --- a/src/main/resources/railwaystweaks.mixins.json +++ b/src/main/resources/railwaystweaks.mixins.json @@ -7,6 +7,8 @@ "LivingEntityMixin" ], "client": [ + "client.HttpTextureMixin", + "client.PlayerRendererMixin" ], "injectors": { "defaultRequire": 1