Skip to content

Commit 688931c

Browse files
committed
camel case enums
1 parent e91b21c commit 688931c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+379
-383
lines changed

src/main/java/com/lambda/mixin/input/KeyBindingMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void autoSprint(CallbackInfoReturnable<Boolean> cir) {
3636
if (!Objects.equals(instance.getTranslationKey(), "key.sprint")) return;
3737

3838
if (Sprint.INSTANCE.isEnabled()) cir.setReturnValue(true);
39-
if (Speed.INSTANCE.isEnabled() && Speed.getMode() == Speed.Mode.GRIM_STRAFE) cir.setReturnValue(true);
39+
if (Speed.INSTANCE.isEnabled() && Speed.getMode() == Speed.Mode.GrimStrafe) cir.setReturnValue(true);
4040
if (TargetStrafe.INSTANCE.isEnabled() && TargetStrafe.isActive()) cir.setReturnValue(true);
4141
}
4242
}

src/main/kotlin/com/lambda/brigadier/CommandExecution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ sealed class CommandResult {
5353
}
5454

5555
fun failure(message: String): Failure {
56-
return Failure(Communication.LogLevel.ERROR.text(message))
56+
return Failure(Communication.LogLevel.Error.text(message))
5757
}
5858

5959
/** Creates a [CommandResult.Failure] with the given throwable [t]. */

src/main/kotlin/com/lambda/command/CommandManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ object CommandManager {
103103
literal(syntax.input.substring(max(0, (position - ERROR_PADDING)), position))
104104
}
105105
if (position < syntax.input.length) {
106-
styled(color = Communication.LogLevel.ERROR.logoColor, underlined = true) {
106+
styled(color = Communication.LogLevel.Error.logoColor, underlined = true) {
107107
literal(syntax.input.substring(position))
108108
}
109109
}
110-
styled(color = Communication.LogLevel.ERROR.logoColor, italic = true) {
110+
styled(color = Communication.LogLevel.Error.logoColor, italic = true) {
111111
translatable("command.context.here")
112112
}
113113
}

src/main/kotlin/com/lambda/config/groups/Targeting.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ abstract class Targeting(
144144
/**
145145
* The field of view limit for targeting entities. Configurable between 5 and 180 degrees.
146146
*/
147-
val fov by owner.setting("FOV Limit", 180, 5..180, 1) { predicate() && priority == Priority.FOV }.group(baseGroup)
147+
val fov by owner.setting("FOV Limit", 180, 5..180, 1) { predicate() && priority == Priority.Fov }.group(baseGroup)
148148

149149
/**
150-
* The priority used to determine which entity is targeted. Configurable with default set to [Priority.DISTANCE].
150+
* The priority used to determine which entity is targeted. Configurable with default set to [Priority.Distance].
151151
*/
152-
val priority by owner.setting("Priority", Priority.DISTANCE) { predicate() }.group(baseGroup)
152+
val priority by owner.setting("Priority", Priority.Distance) { predicate() }.group(baseGroup)
153153

154154
/**
155155
* Validates whether a given entity is targetable for combat based on the field of view limit and other settings.
@@ -201,16 +201,16 @@ abstract class Targeting(
201201
/**
202202
* Prioritizes entities based on their distance from the player.
203203
*/
204-
DISTANCE({ player.pos distSq it.pos }),
204+
Distance({ player.pos distSq it.pos }),
205205

206206
/**
207207
* Prioritizes entities based on their health.
208208
*/
209-
HEALTH({ it.fullHealth }),
209+
Health({ it.fullHealth }),
210210

211211
/**
212212
* Prioritizes entities based on their angle relative to the player's field of view.
213213
*/
214-
FOV({ player.rotation dist player.eyePos.rotationTo(it.pos) })
214+
Fov({ player.rotation dist player.eyePos.rotationTo(it.pos) })
215215
}
216216
}

src/main/kotlin/com/lambda/config/settings/complex/KeybindSetting.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class KeybindSetting(
113113
// If a mod key is pressed first ignore it unless it was released without any other keys
114114
if ((it.isPressed && !isModKey) || (it.isReleased && isModKey)) {
115115
when (it.translated) {
116-
KeyCode.ESCAPE -> {}
117-
KeyCode.BACKSPACE, KeyCode.DELETE -> value = Bind.EMPTY
116+
KeyCode.Escape -> {}
117+
KeyCode.Backspace, KeyCode.Delete -> value = Bind.EMPTY
118118
else -> value = Bind(it.keyCode, it.modifiers, -1)
119119
}
120120

@@ -166,12 +166,12 @@ data class Bind(
166166
val mouse: Int = -1,
167167
) {
168168
val truemods = buildList {
169-
if (modifiers and GLFW_MOD_SHIFT != 0) add(KeyCode.LEFT_SHIFT)
170-
if (modifiers and GLFW_MOD_CONTROL != 0) add(KeyCode.LEFT_CONTROL)
171-
if (modifiers and GLFW_MOD_ALT != 0) add(KeyCode.LEFT_ALT)
172-
if (modifiers and GLFW_MOD_SUPER != 0) add(KeyCode.LEFT_SUPER)
173-
if (modifiers and GLFW_MOD_CAPS_LOCK != 0) add(KeyCode.CAPS_LOCK)
174-
if (modifiers and GLFW_MOD_NUM_LOCK != 0) add(KeyCode.NUM_LOCK)
169+
if (modifiers and GLFW_MOD_SHIFT != 0) add(KeyCode.LeftShift)
170+
if (modifiers and GLFW_MOD_CONTROL != 0) add(KeyCode.LeftControl)
171+
if (modifiers and GLFW_MOD_ALT != 0) add(KeyCode.LeftAlt)
172+
if (modifiers and GLFW_MOD_SUPER != 0) add(KeyCode.LeftSuper)
173+
if (modifiers and GLFW_MOD_CAPS_LOCK != 0) add(KeyCode.CapsLock)
174+
if (modifiers and GLFW_MOD_NUM_LOCK != 0) add(KeyCode.NumLock)
175175
}
176176

177177
val name: String

src/main/kotlin/com/lambda/graphics/buffer/vertex/attributes/VertexMode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ import org.lwjgl.opengl.GL11C.GL_LINES
2121
import org.lwjgl.opengl.GL11C.GL_TRIANGLES
2222

2323
enum class VertexMode(val mode: Int) {
24-
LINES(GL_LINES),
25-
TRIANGLES(GL_TRIANGLES)
24+
Lines(GL_LINES),
25+
Triangles(GL_TRIANGLES)
2626
}

src/main/kotlin/com/lambda/graphics/gl/Matrices.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,20 @@ object Matrices {
169169
*
170170
* @param pos The position in world coordinates.
171171
* @param scale The scaling factor. Defaults to `1.0`.
172-
* @param mode The rotation mode to apply. Defaults to [ProjRotationMode.TO_CAMERA].
172+
* @param mode The rotation mode to apply. Defaults to [ProjRotationMode.ToCamera].
173173
* @return A [Matrix4f] representing the world projection.
174174
*/
175175
fun buildWorldProjection(
176176
pos: Vec3d,
177177
scale: Double = 1.0,
178-
mode: ProjRotationMode = ProjRotationMode.TO_CAMERA
178+
mode: ProjRotationMode = ProjRotationMode.ToCamera
179179
): Matrix4f =
180180
Matrix4f().apply {
181181
val s = 0.025f * scale.toFloat()
182182

183183
val rotation = when (mode) {
184-
ProjRotationMode.TO_CAMERA -> mc.gameRenderer.camera.rotation
185-
ProjRotationMode.UP -> RotationAxis.POSITIVE_X.rotationDegrees(90f)
184+
ProjRotationMode.ToCamera -> mc.gameRenderer.camera.rotation
185+
ProjRotationMode.Up -> RotationAxis.POSITIVE_X.rotationDegrees(90f)
186186
}
187187

188188
translate(pos.x.toFloat(), pos.y.toFloat(), pos.z.toFloat())
@@ -194,7 +194,7 @@ object Matrices {
194194
* Modes for determining the rotation of the world projection.
195195
*/
196196
enum class ProjRotationMode {
197-
TO_CAMERA,
198-
UP
197+
ToCamera,
198+
Up
199199
}
200200
}

src/main/kotlin/com/lambda/graphics/renderer/esp/DirectionMask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ object DirectionMask {
6868

6969
enum class OutlineMode(val check: (Boolean, Boolean) -> Boolean) {
7070
// Render engine will add a line if BOTH touching sides are included into the mask
71-
AND(Boolean::and),
71+
And(Boolean::and),
7272

7373
// Render engine will add a line if ANY OF touching sides is included into the mask
74-
OR(Boolean::or)
74+
Or(Boolean::or)
7575
}
7676
}

src/main/kotlin/com/lambda/graphics/renderer/esp/ShapeDsl.kt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class ShapeBuilder(
153153
box : DynamicAABB,
154154
color : Color,
155155
sides : Int = DirectionMask.ALL,
156-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
156+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
157157
) = edges.apply {
158158
val boxes = box.pair ?: return@apply
159159
val camera = cameraPos
@@ -201,7 +201,7 @@ class ShapeBuilder(
201201
bottomColor : Color,
202202
topColor : Color = bottomColor,
203203
sides : Int = DirectionMask.ALL,
204-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
204+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
205205
) = edges.apply {
206206
val camera = cameraPos
207207
val pos1 = box.min - camera
@@ -245,7 +245,7 @@ class ShapeBuilder(
245245
state : BlockState,
246246
color : Color,
247247
sides : Int = DirectionMask.ALL,
248-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
248+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
249249
) = runSafe {
250250
val shape = outlineShape(state, pos)
251251
if (shape.isEmpty) {
@@ -260,7 +260,7 @@ class ShapeBuilder(
260260
pos : BlockPos,
261261
color : Color,
262262
sides : Int = DirectionMask.ALL,
263-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
263+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
264264
) = runSafe { outline(pos, blockState(pos), color, sides, mode) }
265265

266266
@ShapeDsl
@@ -269,15 +269,15 @@ class ShapeBuilder(
269269
entity : BlockEntity,
270270
color : Color,
271271
sides : Int = DirectionMask.ALL,
272-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
272+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
273273
) = runSafe { outline(pos, entity.cachedState, color, sides, mode) }
274274

275275
@ShapeDsl
276276
fun outline(
277277
shape : VoxelShape,
278278
color : Color,
279279
sides : Int = DirectionMask.ALL,
280-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
280+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
281281
) {
282282
shape.boundingBoxes
283283
.forEach { outline(it, color, sides, mode) }
@@ -288,7 +288,7 @@ class ShapeBuilder(
288288
box : Box,
289289
color : Color,
290290
sides : Int = DirectionMask.ALL,
291-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
291+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
292292
) {
293293
outline(box, color, color, sides, mode)
294294
}
@@ -300,7 +300,7 @@ class ShapeBuilder(
300300
filled : Color,
301301
outline : Color,
302302
sides : Int = DirectionMask.ALL,
303-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
303+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
304304
) = runSafe {
305305
filled(pos, state, filled, sides)
306306
outline(pos, state, outline, sides, mode)
@@ -312,7 +312,7 @@ class ShapeBuilder(
312312
filled : Color,
313313
outline : Color,
314314
sides : Int = DirectionMask.ALL,
315-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
315+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
316316
) = runSafe {
317317
filled(pos, filled, sides)
318318
outline(pos, outline, sides, mode)
@@ -324,7 +324,7 @@ class ShapeBuilder(
324324
filled : Color,
325325
outline : Color,
326326
sides : Int = DirectionMask.ALL,
327-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
327+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
328328
) {
329329
filled(box, filled, sides)
330330
outline(box, outline, sides, mode)
@@ -336,7 +336,7 @@ class ShapeBuilder(
336336
filled : Color,
337337
outline : Color,
338338
sides : Int = DirectionMask.ALL,
339-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
339+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
340340
) {
341341
filled(box, filled, sides)
342342
outline(box, outline, sides, mode)
@@ -347,7 +347,7 @@ class ShapeBuilder(
347347
entity : BlockEntity,
348348
color : Color,
349349
sides : Int = DirectionMask.ALL,
350-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
350+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
351351
) = runSafe {
352352
filled(entity.pos, entity, color, sides)
353353
outline(entity.pos, entity, color, sides, mode)
@@ -358,7 +358,7 @@ class ShapeBuilder(
358358
entity : Entity,
359359
color : Color,
360360
sides : Int = DirectionMask.ALL,
361-
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.OR,
361+
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
362362
) = runSafe {
363363
filled(entity.boundingBox, color, sides)
364364
outline(entity.boundingBox, color, sides, mode)

src/main/kotlin/com/lambda/graphics/renderer/esp/Treed.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import net.minecraft.util.math.Vec3d
3535
open class Treed(static: Boolean) {
3636
val shader = if (static) staticMode.first else dynamicMode.first
3737

38-
val faces = VertexPipeline(VertexMode.TRIANGLES, if (static) staticMode.second else dynamicMode.second)
39-
val edges = VertexPipeline(VertexMode.LINES, if (static) staticMode.second else dynamicMode.second)
38+
val faces = VertexPipeline(VertexMode.Triangles, if (static) staticMode.second else dynamicMode.second)
39+
val edges = VertexPipeline(VertexMode.Lines, if (static) staticMode.second else dynamicMode.second)
4040

4141
var faceBuilder = VertexBuilder(); private set
4242
var edgeBuilder = VertexBuilder(); private set

0 commit comments

Comments
 (0)