Search in sources :

Example 1 with Chams

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);
    }
}
Also used : Chams(mathax.client.systems.modules.render.Chams)

Example 2 with Chams

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);
    }
}
Also used : Chams(mathax.client.systems.modules.render.Chams)

Example 3 with Chams

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);
}
Also used : Chams(mathax.client.systems.modules.render.Chams) Color(mathax.client.utils.render.color.Color) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity)

Example 4 with Chams

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);
}
Also used : Chams(mathax.client.systems.modules.render.Chams) Color(mathax.client.utils.render.color.Color) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Example 5 with Chams

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)));
    }
}
Also used : Chams(mathax.client.systems.modules.render.Chams) Identifier(net.minecraft.util.Identifier) ModifyArgs(org.spongepowered.asm.mixin.injection.ModifyArgs)

Aggregations

Chams (mathax.client.systems.modules.render.Chams)14 Color (mathax.client.utils.render.color.Color)6 Redirect (org.spongepowered.asm.mixin.injection.Redirect)6 ModifyArgs (org.spongepowered.asm.mixin.injection.ModifyArgs)3 ClientPlayerEntity (net.minecraft.client.network.ClientPlayerEntity)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)2 Identifier (net.minecraft.util.Identifier)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1