Skip to content

Commit 71f8396

Browse files
committed
Complaint color vector util usage
1 parent 575b3c8 commit 71f8396

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

common/src/main/java/com/lambda/mixin/world/ClientWorldMixin.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.lambda.event.EventFlow;
44
import com.lambda.event.events.WorldEvent;
55
import com.lambda.module.modules.render.WorldColors;
6+
import com.lambda.util.math.ColorKt;
67
import net.minecraft.block.BlockState;
78
import net.minecraft.client.world.ClientWorld;
89
import net.minecraft.entity.Entity;
@@ -31,20 +32,14 @@ private void addEntity(Entity entity, CallbackInfo ci) {
3132
@Inject(method = "getCloudsColor", at = @At("HEAD"), cancellable = true)
3233
private void getCloudsColorInject(float tickDelta, CallbackInfoReturnable<Vec3d> cir) {
3334
if (WorldColors.INSTANCE.isEnabled() && WorldColors.getCustomClouds()) {
34-
var color = WorldColors.getCloudColor();
35-
36-
cir.setReturnValue(
37-
new Vec3d(color.getRed(), color.getGreen(), color.getBlue()));
35+
cir.setReturnValue(ColorKt.getVec3d(WorldColors.getCloudColor()));
3836
}
3937
}
4038

4139
@Inject(method = "getSkyColor", at = @At("HEAD"), cancellable = true)
4240
private void getSkyColorInject(Vec3d cameraPos, float tickDelta, CallbackInfoReturnable<Vec3d> cir) {
4341
if (WorldColors.INSTANCE.isEnabled() && WorldColors.getCustomSky()) {
44-
var color = WorldColors.getSkyColor();
45-
46-
cir.setReturnValue(
47-
new Vec3d(color.getRed(), color.getGreen(), color.getBlue()));
42+
cir.setReturnValue(ColorKt.getVec3d(WorldColors.getSkyColor()));
4843
}
4944
}
5045
}

common/src/main/kotlin/com/lambda/module/modules/render/WorldColors.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.lambda.module.modules.render
22

33
import com.lambda.module.Module
44
import com.lambda.module.tag.ModuleTag
5-
import com.lambda.util.math.asVec3d
5+
import com.lambda.util.math.vec3d
66
import net.minecraft.util.math.Vec3d
77
import java.awt.Color
88

@@ -26,5 +26,5 @@ object WorldColors : Module(
2626

2727
@JvmStatic
2828
fun backgroundColor(base: Vec3d) =
29-
if (customFog && isEnabled) fogColor.asVec3d else base
29+
if (customFog && isEnabled) fogColor.vec3d else base
3030
}

common/src/main/kotlin/com/lambda/util/math/Color.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ val Color.g get() = green / 255.0
2424
val Color.b get() = blue / 255.0
2525
val Color.a get() = alpha / 255.0
2626

27-
val Color.asVec3d get() = Vec3d(r, g, b)
27+
val Color.vec3d get() = Vec3d(r, g, b)

0 commit comments

Comments
 (0)