Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
13373ec
chore: remove direction function in favor of a constructor
twiston-7 Jul 13, 2026
659058d
chore: extract movement evaluation into seperate method
twiston-7 Jul 13, 2026
8fc3ee9
chore: make config an actual config and move Type in Movement to Move…
twiston-7 Jul 13, 2026
7a4bbb5
chore: remove magic number in max calculation time
twiston-7 Jul 13, 2026
70dd937
chore: make PathFinderConfig singleton
twiston-7 Jul 13, 2026
7a293f4
chore: rename PathExecutor to PathFindingFacade for clarity on object…
twiston-7 Jul 13, 2026
e207653
chore: cleanup pathrendering method to reduce nesting
twiston-7 Jul 13, 2026
ac0ab21
chore: cleanup shouldJump
twiston-7 Jul 13, 2026
4ec3cac
chore: remove redundant checks in shouldStartFlying
twiston-7 Jul 13, 2026
7fa7b22
feat: add command to stop pathfinder
twiston-7 Jul 13, 2026
f4d688a
feat: made fly pathfinder work (technically)
twiston-7 Jul 13, 2026
5e678d0
chore: remove some crappy claude comments
twiston-7 Jul 13, 2026
412c3c4
chore: remove debug messages
twiston-7 Jul 13, 2026
a8372f6
chore: rename PathFinderConfig to PathFindingConfig for consistency
twiston-7 Jul 13, 2026
3bba3e0
chore: clean up AStar like... a lot
twiston-7 Jul 13, 2026
7ff959e
chore: make AStar a singleton object
twiston-7 Jul 13, 2026
cea375b
chore: run intellij code cleanup
twiston-7 Jul 13, 2026
fd949c2
chore: extract constants in ChatUtils
twiston-7 Jul 13, 2026
bfaf696
chore: thank you nathan for this incredible code.
twiston-7 Jul 13, 2026
5cac328
chore: cleanup attempt
quiteboring Jul 13, 2026
dc163c2
Revert "chore: cleanup attempt"
quiteboring Jul 13, 2026
ff5983a
chore: cleanup code..?
quiteboring Jul 13, 2026
c9701ff
chore: oops
quiteboring Jul 13, 2026
b46841e
chore: rearrange files in org.cobalt.util + cleanup
quiteboring Jul 13, 2026
fd319bb
chore: cleanup
quiteboring Jul 14, 2026
7365dc8
chore: cleanup (start working on costs)
quiteboring Jul 14, 2026
8da678e
Merge branch 'master' into chore/nathan-cleanup
quiteboring Jul 14, 2026
d3f6c54
fix: merge conflict with Notification.kt
quiteboring Jul 14, 2026
9a2bd3c
fix: detekt issues
quiteboring Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ style:
active: true
maxJumpCount: 3
WildcardImport:
active: false
active: true
excludeImports:
- 'org.lwjgl.vulkan.*'
- 'io.github.humbleui.skija.*'
- 'net.minecraft.world.level.block.*'
ForbiddenComment:
active: false
UnusedPrivateProperty:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cobalt/mixin/client/MinecraftMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.cobalt.event.impl.TickEvent;
import org.cobalt.module.ModuleManager;
import org.cobalt.util.config.SettingContainer;
import org.cobalt.util.helper.Multithreading;
import org.cobalt.util.scheduling.Multithreading;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/cobalt/mixin/client/MouseHandlerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import org.cobalt.event.EventBus;
import org.cobalt.event.impl.MouseEvent;
import org.cobalt.event.impl.MouseScrollEvent;
import org.cobalt.util.MouseAction;
import org.cobalt.util.MouseButton;
import org.cobalt.util.MouseMode;
import org.cobalt.util.MouseUtils;
import org.cobalt.util.input.Mouse;
import org.cobalt.util.input.MouseAction;
import org.cobalt.util.input.MouseButton;
import org.cobalt.util.input.MouseMode;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand Down Expand Up @@ -74,14 +74,14 @@ private void onMouseScroll(long handle, double xoffset, double yoffset, Callback

@Inject(method = "turnPlayer", at = @At("HEAD"), cancellable = true)
private void onUpdateMouse(CallbackInfo callbackInfo) {
if (MouseUtils.getMouseMode() == MouseMode.LOCK_MOUSE) {
if (Mouse.getMouseMode() == MouseMode.LOCK_MOUSE) {
callbackInfo.cancel();
}
}

@Inject(method = "isMouseGrabbed", at = @At("HEAD"), cancellable = true)
private void onIsCursorLocked(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
if (MouseUtils.getMouseMode() == MouseMode.UNGRAB_MOUSE) {
if (Mouse.getMouseMode() == MouseMode.UNGRAB_MOUSE) {
if (this.mouseGrabbed) {
this.releaseMouse();
}
Expand All @@ -92,7 +92,7 @@ private void onIsCursorLocked(CallbackInfoReturnable<Boolean> callbackInfoReturn

@Inject(method = "grabMouse", at = @At("HEAD"), cancellable = true)
private void onLockCursor(CallbackInfo callbackInfo) {
if (MouseUtils.getMouseMode() == MouseMode.UNGRAB_MOUSE) {
if (Mouse.getMouseMode() == MouseMode.UNGRAB_MOUSE) {
callbackInfo.cancel();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cobalt/mixin/gui/FontMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.network.chat.Style;
import net.minecraft.util.FormattedCharSequence;
import org.cobalt.module.impl.misc.NickHider;
import org.cobalt.util.PlayerUtils;
import org.cobalt.util.client.PlayerUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cobalt/Cobalt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.cobalt.event.EventBus
import org.cobalt.event.impl.WorldEvent
import org.cobalt.module.ModuleManager
import org.cobalt.ui.theme.ThemeManager
import org.cobalt.util.skia.SkiaPIP
import org.cobalt.util.render.skia.SkiaPIP
import org.slf4j.LoggerFactory

object Cobalt : ClientModInitializer {
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/org/cobalt/command/Command.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package org.cobalt.command

import com.mojang.brigadier.arguments.*
import com.mojang.brigadier.arguments.ArgumentType
import com.mojang.brigadier.arguments.BoolArgumentType
import com.mojang.brigadier.arguments.DoubleArgumentType
import com.mojang.brigadier.arguments.FloatArgumentType
import com.mojang.brigadier.arguments.IntegerArgumentType
import com.mojang.brigadier.arguments.StringArgumentType
import com.mojang.brigadier.builder.LiteralArgumentBuilder
import com.mojang.brigadier.builder.RequiredArgumentBuilder
import com.mojang.brigadier.context.CommandContext
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cobalt/command/CommandManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException
import net.minecraft.client.multiplayer.ClientSuggestionProvider
import org.cobalt.Cobalt.minecraft
import org.cobalt.command.impl.MainCommand
import org.cobalt.util.ChatUtils
import org.cobalt.util.chat.ChatUtils

object CommandManager {

Expand Down
30 changes: 8 additions & 22 deletions src/main/kotlin/org/cobalt/command/impl/MainCommand.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cobalt.command.impl

import kotlin.time.Duration.Companion.milliseconds
import org.cobalt.Cobalt.minecraft
import org.cobalt.command.Command
import org.cobalt.command.annotation.DefaultHandler
Expand All @@ -9,11 +8,9 @@ import org.cobalt.pathfinder.PathConfig
import org.cobalt.pathfinder.PathExecutor
import org.cobalt.pathfinder.calculate.PathMode
import org.cobalt.pathfinder.goal.GoalBlock
import org.cobalt.ui.notification.NotificationManager
import org.cobalt.ui.screen.ConfigScreen
import org.cobalt.ui.screen.HudEditorScreen
import org.cobalt.util.helper.Multithreading
import org.cobalt.util.helper.TickScheduler
import org.cobalt.util.scheduling.TickScheduler

object MainCommand : Command(name = "cobalt", aliases = listOf("cb")) {

Expand All @@ -33,31 +30,20 @@ object MainCommand : Command(name = "cobalt", aliases = listOf("cb")) {
}
}

@SubCommand
fun testNotif() {
Multithreading.runAsync {

NotificationManager.queue("Hi", "", 2000.milliseconds)
Thread.sleep(750)
NotificationManager.queue("Hi", "Hello", 2000.milliseconds)
Thread.sleep(750)
NotificationManager.queue(
"Hi",
"HeASDASDHOUASHDOUASHDUOAHSDOUAHSDOUHASOUDHASDlloHeASDASDHOUASHDOUASHDUOAHSDOUAHSDOUHASOUDHASDlloHeASDASDHOUASHDOUASHDUOAHSDOUAHSDOUHASOUDHASDlloHeASDASDHOUASHDOUASHDUOAHSDOUAHSDOUHASOUDHASDlloHeASDASDHOUASHDOUASHDUOAHSDOUAHSDOUHASOUDHASDllo",
2000.milliseconds
)
}
}

@SubCommand
fun goTo(x: Int, y: Int, z: Int, fly: Boolean) {
val mode = if (fly) PathMode.FLY else PathMode.WALK
val pathMode = if (fly) PathMode.FLY else PathMode.WALK
val config = PathConfig(
goal = GoalBlock(x, y, z),
movements = mode.movements
mode = pathMode
)

PathExecutor.goTo(config)
}

@SubCommand
fun stopPathfinder() {
PathExecutor.stop()
}

}
20 changes: 0 additions & 20 deletions src/main/kotlin/org/cobalt/dsl/Block.kt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/kotlin/org/cobalt/event/impl/MouseEvent.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.cobalt.event.impl

import org.cobalt.event.Event
import org.cobalt.util.MouseAction
import org.cobalt.util.MouseButton
import org.cobalt.util.input.MouseAction
import org.cobalt.util.input.MouseButton

class MouseEvent(
val button: MouseButton,
Expand Down
27 changes: 16 additions & 11 deletions src/main/kotlin/org/cobalt/module/ModuleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@ import org.cobalt.event.EventBus
import org.cobalt.event.annotation.SubscribeEvent
import org.cobalt.event.impl.RenderEvent
import org.cobalt.module.impl.combat.AutoClicker
import org.cobalt.module.impl.misc.*
import org.cobalt.module.impl.misc.AutoHarp
import org.cobalt.module.impl.misc.AutoSprint
import org.cobalt.module.impl.misc.Debug
import org.cobalt.module.impl.misc.DiscordRPC
import org.cobalt.module.impl.misc.NickHider
import org.cobalt.module.impl.misc.Rotations
import org.cobalt.module.impl.skills.Fishing
import org.cobalt.module.impl.visual.PerformanceHUD
import org.cobalt.module.type.RenderableModule
import org.cobalt.module.type.Script
import org.cobalt.ui.screen.HudEditorScreen
import org.cobalt.util.ChatUtils
import org.cobalt.util.WindowUtils.scaleX
import org.cobalt.util.WindowUtils.scaleY
import org.cobalt.util.skia.Skia
import org.cobalt.util.skia.SkiaPIP
import org.cobalt.util.chat.ChatUtils
import org.cobalt.util.client.WindowUtils.scaleX
import org.cobalt.util.client.WindowUtils.scaleY
import org.cobalt.util.render.SkiaRenderer
import org.cobalt.util.render.skia.SkiaPIP

object ModuleManager {

Expand Down Expand Up @@ -132,19 +137,19 @@ object ModuleManager {
modules.filterIsInstance<RenderableModule>()
.filter { module -> module.enabled }
.forEach { module ->
Skia.push()
SkiaRenderer.push()

val renderX = module.xPos * scaleX
val renderY = module.yPos * scaleY
val finalScale = module.scale * scaleY

Skia.translate(renderX, renderY)
Skia.scale(finalScale, finalScale)
Skia.translate(-module.xPos, -module.yPos)
SkiaRenderer.translate(renderX, renderY)
SkiaRenderer.scale(finalScale, finalScale)
SkiaRenderer.translate(-module.xPos, -module.yPos)

module.renderComponent()

Skia.pop()
SkiaRenderer.pop()
}
}
}
Expand Down
20 changes: 12 additions & 8 deletions src/main/kotlin/org/cobalt/module/impl/combat/AutoClicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import org.cobalt.event.annotation.SubscribeEvent
import org.cobalt.event.impl.WorldEvent
import org.cobalt.module.Module
import org.cobalt.module.ModuleCategory
import org.cobalt.ui.component.setting.impl.*
import org.cobalt.util.KeybindUtils
import org.cobalt.util.MouseUtils
import org.cobalt.util.helper.Clock
import org.cobalt.ui.component.setting.impl.CheckboxSetting
import org.cobalt.ui.component.setting.impl.KeyBindSetting
import org.cobalt.ui.component.setting.impl.ModeSetting
import org.cobalt.ui.component.setting.impl.SliderSetting
import org.cobalt.ui.component.setting.impl.TextSetting
import org.cobalt.util.input.Keyboard
import org.cobalt.util.input.Mouse
import org.cobalt.util.scheduling.Clock

object AutoClicker : Module(
name = "AutoClicker",
Expand Down Expand Up @@ -80,18 +84,18 @@ object AutoClicker : Module(

if (
leftClickDelay.passed() &&
KeybindUtils.isKeyDown(leftClickKeybind) &&
Keyboard.isKeyDown(leftClickKeybind) &&
canLeftClick()
) {
MouseUtils.leftClick()
Mouse.leftClick()
leftClickDelay.schedule(nextDelay(leftClickCps))
}

if (
rightClickDelay.passed() &&
KeybindUtils.isKeyDown(rightClickKeybind)
Keyboard.isKeyDown(rightClickKeybind)
) {
KeybindUtils.press(minecraft.options.keyUse)
Keyboard.press(minecraft.options.keyUse)
rightClickDelay.schedule(nextDelay(rightClickCps))
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/org/cobalt/module/impl/misc/AutoHarp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.cobalt.event.annotation.SubscribeEvent
import org.cobalt.event.impl.TickEvent
import org.cobalt.module.Module
import org.cobalt.module.ModuleCategory
import org.cobalt.util.InventoryUtils
import org.cobalt.util.MouseButton
import org.cobalt.util.input.MouseButton
import org.cobalt.util.inventory.InventoryUtils

object AutoHarp : Module(
name = "AutoHarp",
Expand Down
30 changes: 15 additions & 15 deletions src/main/kotlin/org/cobalt/module/impl/misc/Rotations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import org.cobalt.event.impl.WorldEvent
import org.cobalt.module.Module
import org.cobalt.module.ModuleCategory
import org.cobalt.ui.component.setting.impl.SliderSetting
import org.cobalt.util.MouseMode
import org.cobalt.util.MouseUtils
import org.cobalt.util.PlayerUtils
import org.cobalt.util.RotationUtils
import org.cobalt.util.rotation.Rotation
import org.cobalt.util.rotation.RotationTarget
import org.cobalt.util.client.PlayerUtils
import org.cobalt.util.input.Mouse
import org.cobalt.util.input.MouseMode
import org.cobalt.util.rotation.RotationMath
import org.cobalt.util.rotation.data.Rotation
import org.cobalt.util.rotation.data.RotationTarget

object Rotations : Module(
name = "Rotations",
Expand Down Expand Up @@ -91,8 +91,8 @@ object Rotations : Module(
lastFrameMs = System.currentTimeMillis()
running = true

if (MouseUtils.mouseMode == MouseMode.DEFAULT) {
MouseUtils.mouseMode = MouseMode.LOCK_MOUSE
if (Mouse.mouseMode == MouseMode.DEFAULT) {
Mouse.mouseMode = MouseMode.LOCK_MOUSE
returnMouseMode = true
}
}
Expand All @@ -102,8 +102,8 @@ object Rotations : Module(
target = rotationTarget
running = true

if (MouseUtils.mouseMode == MouseMode.DEFAULT) {
MouseUtils.mouseMode = MouseMode.LOCK_MOUSE
if (Mouse.mouseMode == MouseMode.DEFAULT) {
Mouse.mouseMode = MouseMode.LOCK_MOUSE
returnMouseMode = true
}
}
Expand All @@ -113,7 +113,7 @@ object Rotations : Module(
target = null

if (returnMouseMode) {
MouseUtils.mouseMode = MouseMode.DEFAULT
Mouse.mouseMode = MouseMode.DEFAULT
returnMouseMode = false
}
}
Expand All @@ -140,7 +140,7 @@ object Rotations : Module(
}

private fun handleRotate(current: Rotation, target: Rotation, deltaTime: Float) {
if (RotationUtils.approximatelyEquals(current, target, endTolerance.toFloat())) {
if (RotationMath.approximatelyEquals(current, target, endTolerance.toFloat())) {
stop()
return
}
Expand All @@ -157,12 +157,12 @@ object Rotations : Module(
}

private fun handleTrack(current: Rotation, target: Rotation, deltaTime: Float) {
if (RotationUtils.approximatelyEquals(current, target, endTolerance.toFloat())) {
if (RotationMath.approximatelyEquals(current, target, endTolerance.toFloat())) {
return
}

var needYaw = RotationUtils.angleDifference(target.yaw, current.yaw)
var needPitch = RotationUtils.angleDifference(target.pitch, current.pitch)
var needYaw = RotationMath.angleDifference(target.yaw, current.yaw)
var needPitch = RotationMath.angleDifference(target.pitch, current.pitch)
val distance = abs(needYaw) + abs(needPitch)

val randomFactor = (0.8f + Random.nextFloat() * 0.4f)
Expand Down
Loading
Loading