From 5bbe5cc33c0c9311a6ac9f39a0c0b86fa7b8615b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Goossens?= Date: Mon, 24 Oct 2022 19:50:56 +0200 Subject: [PATCH] Fix lighting issues with walls in HITW --- README.md | 3 ++- gradle.properties | 2 +- .../mixin/client/PistonRenderingMixin.java | 18 ++++++++++++++++++ src/main/resources/noxesium.mixins.json | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/noxcrew/noxesium/mixin/client/PistonRenderingMixin.java diff --git a/README.md b/README.md index b7f391d1..91b86fca 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,5 @@ A fabric mod with feature additions, bugfixes and various performance improvemen ### Bugfixes - Always display head layer in TAB menu -- Change teleport packets to teleport vehicle passengers to their vehicle \ No newline at end of file +- Change teleport packets to teleport vehicle passengers to their vehicle +- Fixes lighting issues with moving piston walls \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 33c575fb..d2411cd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ loader_version=0.14.9 #Fabric api fabric_version=0.60.0+1.19.2 # Mod Properties -mod_version=0.1.0 +mod_version=0.1.1 maven_group=com.noxcrew archives_base_name=noxesium diff --git a/src/main/java/com/noxcrew/noxesium/mixin/client/PistonRenderingMixin.java b/src/main/java/com/noxcrew/noxesium/mixin/client/PistonRenderingMixin.java new file mode 100644 index 00000000..72c704b3 --- /dev/null +++ b/src/main/java/com/noxcrew/noxesium/mixin/client/PistonRenderingMixin.java @@ -0,0 +1,18 @@ +package com.noxcrew.noxesium.mixin.client; + +import net.minecraft.client.renderer.blockentity.PistonHeadRenderer; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(PistonHeadRenderer.class) +public class PistonRenderingMixin { + + @Redirect(method = "render(Lnet/minecraft/world/level/block/piston/PistonMovingBlockEntity;FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/BlockPos;relative(Lnet/minecraft/core/Direction;)Lnet/minecraft/core/BlockPos;", ordinal = 0), allow = 1) + private BlockPos redirected(BlockPos instance, Direction direction) { + // Refuse to do the first relative in the method! + return instance; + } +} diff --git a/src/main/resources/noxesium.mixins.json b/src/main/resources/noxesium.mixins.json index d3e165a2..daeade2e 100644 --- a/src/main/resources/noxesium.mixins.json +++ b/src/main/resources/noxesium.mixins.json @@ -10,6 +10,7 @@ "client.ClientPacketListenerMixin", "client.LivingEntityMixin", "client.MinecraftMixin", + "client.PistonRenderingMixin", "client.PlayerTabOverlayMixin", "client.adventure.GameRendererMixin", "client.adventure.ItemStackMixin",