|
| 1 | +/* |
| 2 | + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). |
| 3 | + * Copyright (c) Meteor Development. |
| 4 | + */ |
| 5 | + |
| 6 | +package meteordevelopment.meteorclient.mixin.indigo; |
| 7 | + |
| 8 | +import com.llamalad7.mixinextras.injector.ModifyReturnValue; |
| 9 | +import meteordevelopment.meteorclient.systems.modules.Modules; |
| 10 | +import meteordevelopment.meteorclient.systems.modules.render.Xray; |
| 11 | +import net.fabricmc.fabric.impl.client.indigo.renderer.render.BlockRenderInfo; |
| 12 | +import net.minecraft.block.BlockState; |
| 13 | +import net.minecraft.util.math.BlockPos; |
| 14 | +import net.minecraft.util.math.Direction; |
| 15 | +import net.minecraft.world.BlockRenderView; |
| 16 | +import org.spongepowered.asm.mixin.Mixin; |
| 17 | +import org.spongepowered.asm.mixin.Shadow; |
| 18 | +import org.spongepowered.asm.mixin.injection.At; |
| 19 | + |
| 20 | +@Mixin(BlockRenderInfo.class) |
| 21 | +public class BlockRenderInfoMixin { |
| 22 | + @Shadow |
| 23 | + public BlockState blockState; |
| 24 | + |
| 25 | + @Shadow |
| 26 | + public BlockRenderView blockView; |
| 27 | + |
| 28 | + @Shadow |
| 29 | + public BlockPos blockPos; |
| 30 | + |
| 31 | + @ModifyReturnValue(method = "shouldDrawSide", at = @At("RETURN")) |
| 32 | + private boolean modifyShouldDrawSide(boolean original, Direction side) { |
| 33 | + Xray xray = Modules.get().get(Xray.class); |
| 34 | + |
| 35 | + if (xray.isActive()) { |
| 36 | + return xray.modifyDrawSide(blockState, blockView, blockPos, side, original); |
| 37 | + } |
| 38 | + |
| 39 | + return original; |
| 40 | + } |
| 41 | +} |
0 commit comments