-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathFallingBlockEntityRendererMixin.java
More file actions
26 lines (22 loc) · 2.22 KB
/
FallingBlockEntityRendererMixin.java
File metadata and controls
26 lines (22 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package me.pepperbell.continuity.client.mixin;
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 me.pepperbell.continuity.api.client.ContinuityFeatureStates;
import net.minecraft.client.render.entity.FallingBlockEntityRenderer;
@Mixin(FallingBlockEntityRenderer.class)
abstract class FallingBlockEntityRendererMixin {
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;tesselateBlock(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JILnet/neoforged/neoforge/client/model/data/ModelData;Lnet/minecraft/client/render/RenderLayer;)V"))
private void continuity$beforeRenderModel(CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().disable();
states.getEmissiveTexturesState().disable();
}
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;tesselateBlock(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JILnet/neoforged/neoforge/client/model/data/ModelData;Lnet/minecraft/client/render/RenderLayer;)V", shift = At.Shift.AFTER))
private void continuity$afterRenderModel(CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().enable();
states.getEmissiveTexturesState().enable();
}
}