use of mathax.client.systems.modules.render.Chams in project Client by MatHax.
the class LivingEntityRendererMixin method renderHead.
// Through walls chams
@Inject(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At("HEAD"), cancellable = true)
private void renderHead(T livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo info) {
if (Modules.get().get(NoRender.class).noDeadEntities() && livingEntity.isDead())
info.cancel();
Chams chams = Modules.get().get(Chams.class);
if (chams.isActive() && chams.shouldRender(livingEntity)) {
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, -1100000.0f);
}
}
use of mathax.client.systems.modules.render.Chams in project Client by MatHax.
the class LivingEntityRendererMixin method renderTail.
@Inject(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At("TAIL"))
private void renderTail(T livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo info) {
Chams chams = Modules.get().get(Chams.class);
if (chams.isActive() && chams.shouldRender(livingEntity)) {
glPolygonOffset(1.0f, 1100000.0f);
glDisable(GL_POLYGON_OFFSET_FILL);
}
}
use of mathax.client.systems.modules.render.Chams in project Client by MatHax.
the class LivingEntityRendererMixin method modifyColor.
@ModifyArgs(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/EntityModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V"))
private void modifyColor(Args args, T livingEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
Chams module = Modules.get().get(Chams.class);
if (!module.isActive() || !module.players.get() || !(livingEntity instanceof PlayerEntity))
return;
if (module.ignoreSelf.get() && livingEntity == mc.player)
return;
Color color = PlayerUtils.getPlayerColor(((PlayerEntity) livingEntity), module.playersColor.get());
args.set(4, color.r / 255f);
args.set(5, color.g / 255f);
args.set(6, color.b / 255f);
args.set(7, module.playersColor.get().a / 255f);
}
use of mathax.client.systems.modules.render.Chams in project Client by MatHax.
the class PlayerEntityRendererMixin method redirectRenderMain.
@Redirect(method = "renderArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPart;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;II)V", ordinal = 0))
private void redirectRenderMain(ModelPart modelPart, MatrixStack matrices, VertexConsumer vertices, int light, int overlay) {
Chams chams = Modules.get().get(Chams.class);
if (chams.isActive() && chams.hand.get()) {
Color color = chams.handColor.get();
modelPart.render(matrices, vertices, light, overlay, color.r / 255f, color.g / 255f, color.b / 255f, color.a / 255f);
} else
modelPart.render(matrices, vertices, light, overlay);
}
use of mathax.client.systems.modules.render.Chams in project Client by MatHax.
the class PlayerEntityRendererMixin method modifyRenderLayer.
@ModifyArgs(method = "renderArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPart;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;II)V", ordinal = 0))
private void modifyRenderLayer(Args args, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, AbstractClientPlayerEntity player, ModelPart arm, ModelPart sleeve) {
Chams chams = Modules.get().get(Chams.class);
if (chams.isActive() && chams.hand.get()) {
Identifier texture = chams.handTexture.get() ? player.getSkinTexture() : Chams.BLANK;
args.set(1, vertexConsumers.getBuffer(RenderLayer.getEntityTranslucent(texture)));
}
}
Aggregations