|
18 | 18 |
|
19 | 19 | package gg.skytils.skytilsmod.mixins.transformers.renderer; |
20 | 20 |
|
21 | | -import gg.skytils.skytilsmod.mixins.hooks.renderer.TileEntityChestRendererHookKt; |
| 21 | +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
| 22 | +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
| 23 | +import com.llamalad7.mixinextras.sugar.Local; |
| 24 | +import gg.skytils.skytilsmod.features.impl.dungeons.solvers.ThreeWeirdosSolver; |
| 25 | +import net.minecraft.block.entity.BlockEntity; |
| 26 | +import net.minecraft.client.render.OverlayTexture; |
| 27 | +import net.minecraft.client.render.VertexConsumer; |
22 | 28 | import net.minecraft.client.render.block.entity.ChestBlockEntityRenderer; |
23 | | -import net.minecraft.client.render.block.entity.BlockEntityRenderer; |
24 | | -import net.minecraft.block.entity.ChestBlockEntity; |
| 29 | +import net.minecraft.client.render.block.entity.model.ChestBlockModel; |
| 30 | +import net.minecraft.client.util.math.MatrixStack; |
25 | 31 | import org.spongepowered.asm.mixin.Mixin; |
26 | 32 | import org.spongepowered.asm.mixin.injection.At; |
27 | | -import org.spongepowered.asm.mixin.injection.Inject; |
28 | | -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
29 | 33 |
|
30 | 34 | @Mixin(ChestBlockEntityRenderer.class) |
31 | | -public abstract class MixinTileEntityChestRenderer extends BlockEntityRenderer<ChestBlockEntity> { |
| 35 | +public abstract class MixinTileEntityChestRenderer{ |
32 | 36 |
|
33 | | - @Inject(method = "render(Lnet/minecraft/block/entity/ChestBlockEntity;DDDFI)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/ChestEntityModel;method_2799()V", shift = At.Shift.BEFORE)) |
34 | | - private void setChestColor(ChestBlockEntity te, double x, double y, double z, float partialTicks, int destroyStage, CallbackInfo ci) { |
35 | | - TileEntityChestRendererHookKt.setChestColor(te, x, y, z, partialTicks, destroyStage, ci); |
| 37 | + @WrapOperation(method = "render(Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/util/math/Vec3d;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/ChestBlockEntityRenderer;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/render/block/entity/model/ChestBlockModel;FII)V")) |
| 38 | + private void setChestColor(ChestBlockEntityRenderer<?> instance, MatrixStack matrices, VertexConsumer vertices, ChestBlockModel model, float animationProgress, int light, int overlay, Operation<Void> original, @Local(argsOnly = true) BlockEntity entity) { |
| 39 | + // TODO: look into alternatives |
| 40 | + if (entity.getPos() == ThreeWeirdosSolver.riddleChest) { |
| 41 | + original.call(instance, matrices, vertices, model, animationProgress, light, OverlayTexture.getUv(0f, true)); |
| 42 | + return; |
| 43 | + } |
| 44 | + original.call(instance, matrices, vertices, model, animationProgress, light, overlay); |
36 | 45 | } |
37 | | - |
38 | | - @Inject(method = "render(Lnet/minecraft/block/entity/ChestBlockEntity;DDDFI)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/ChestEntityModel;method_2799()V", shift = At.Shift.AFTER)) |
39 | | - private void setChestColorPost(ChestBlockEntity te, double x, double y, double z, float partialTicks, int destroyStage, CallbackInfo ci) { |
40 | | - TileEntityChestRendererHookKt.setChestColorPost(te, x, y, z, partialTicks, destroyStage, ci); |
41 | | - } |
42 | | - |
43 | 46 | } |
0 commit comments