Search in sources :

Example 1 with Ambience

use of mathax.client.systems.modules.world.Ambience in project Client by MatHax.

the class LightningEntityRendererMixin method onSetLightningVertex.

/**
 * @author Walaryne
 */
@Inject(method = "drawBranch", at = @At(value = "HEAD"), cancellable = true)
private static void onSetLightningVertex(Matrix4f matrix4f, VertexConsumer vertexConsumer, float f, float g, int i, float h, float j, float k, float l, float m, float n, float o, boolean bl, boolean bl2, boolean bl3, boolean bl4, CallbackInfo info) {
    Ambience ambience = Modules.get().get(Ambience.class);
    if (ambience.isActive() && ambience.changeLightningColor.get()) {
        Color color = ambience.lightningColor.get();
        vertexConsumer.vertex(matrix4f, f + (bl ? o : -o), (float) (i * 16), g + (bl2 ? o : -o)).color(color.r / 255f, color.g / 255f, color.b / 255f, 0.3F).next();
        vertexConsumer.vertex(matrix4f, h + (bl ? n : -n), (float) ((i + 1) * 16), j + (bl2 ? n : -n)).color(color.r / 255f, color.g / 255f, color.b / 255f, 0.3F).next();
        vertexConsumer.vertex(matrix4f, h + (bl3 ? n : -n), (float) ((i + 1) * 16), j + (bl4 ? n : -n)).color(color.r / 255f, color.g / 255f, color.b / 255f, 0.3F).next();
        vertexConsumer.vertex(matrix4f, f + (bl3 ? o : -o), (float) (i * 16), g + (bl4 ? o : -o)).color(color.r / 255f, color.g / 255f, color.b / 255f, 0.3F).next();
        info.cancel();
    }
}
Also used : Color(mathax.client.utils.render.color.Color) Ambience(mathax.client.systems.modules.world.Ambience) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 2 with Ambience

use of mathax.client.systems.modules.world.Ambience in project Client by MatHax.

the class WorldRendererMixin method onRenderEndSkyDraw.

/**
 * @author Walaryne
 */
@Inject(method = "renderEndSky", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Tessellator;draw()V"))
private void onRenderEndSkyDraw(MatrixStack matrices, CallbackInfo info) {
    Ambience ambience = Modules.get().get(Ambience.class);
    if (ambience.isActive() && ambience.endSky.get() && ambience.customSkyColor.get()) {
        Color customEndSkyColor = ambience.skyColor();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferBuilder = tessellator.getBuffer();
        Matrix4f matrix4f = matrices.peek().getPositionMatrix();
        bufferBuilder.clear();
        bufferBuilder.vertex(matrix4f, -100.0F, -100.0F, -100.0F).texture(0.0F, 0.0F).color(customEndSkyColor.r, customEndSkyColor.g, customEndSkyColor.b, 255).next();
        bufferBuilder.vertex(matrix4f, -100.0F, -100.0F, 100.0F).texture(0.0F, 16.0F).color(customEndSkyColor.r, customEndSkyColor.g, customEndSkyColor.b, 255).next();
        bufferBuilder.vertex(matrix4f, 100.0F, -100.0F, 100.0F).texture(16.0F, 16.0F).color(customEndSkyColor.r, customEndSkyColor.g, customEndSkyColor.b, 255).next();
        bufferBuilder.vertex(matrix4f, 100.0F, -100.0F, -100.0F).texture(16.0F, 0.0F).color(customEndSkyColor.r, customEndSkyColor.g, customEndSkyColor.b, 255).next();
    }
}
Also used : Matrix4f(net.minecraft.util.math.Matrix4f) Color(mathax.client.utils.render.color.Color) Ambience(mathax.client.systems.modules.world.Ambience)

Example 3 with Ambience

use of mathax.client.systems.modules.world.Ambience in project Client by MatHax.

the class FoliageColorsMixin method onGetSpruceColor.

@Inject(method = "getSpruceColor", at = @At("HEAD"), cancellable = true)
private static void onGetSpruceColor(CallbackInfoReturnable<Integer> info) {
    Ambience ambience = Modules.get().get(Ambience.class);
    if (ambience.isActive() && ambience.customFoliageColor.get()) {
        info.setReturnValue(ambience.foliageColor.get().getPacked());
        info.cancel();
    }
}
Also used : Ambience(mathax.client.systems.modules.world.Ambience) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 4 with Ambience

use of mathax.client.systems.modules.world.Ambience in project Client by MatHax.

the class FoliageColorsMixin method onGetBirchColor.

@Inject(method = "getBirchColor", at = @At("HEAD"), cancellable = true)
private static void onGetBirchColor(CallbackInfoReturnable<Integer> info) {
    Ambience ambience = Modules.get().get(Ambience.class);
    if (ambience.isActive() && ambience.customFoliageColor.get()) {
        info.setReturnValue(ambience.foliageColor.get().getPacked());
        info.cancel();
    }
}
Also used : Ambience(mathax.client.systems.modules.world.Ambience) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

Ambience (mathax.client.systems.modules.world.Ambience)4 Inject (org.spongepowered.asm.mixin.injection.Inject)3 Color (mathax.client.utils.render.color.Color)2 Matrix4f (net.minecraft.util.math.Matrix4f)1