Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 18 additions & 5 deletions build-mod.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ loom {
mixin.defaultRefmapName = refmap_file
}

val shade by configurations.registering
val modShade by configurations.registering
val allShade by configurations.registering

val shade by configurations.registering { allShade.get().extendsFrom(this) }

@Suppress("UnstableApiUsage")
configurations {
implementation.extendsFrom(shade)
modImplementation.extendsFrom(modShade)
}

sourceSets.main {
Expand All @@ -73,6 +73,12 @@ sourceSets.main {
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.hypixel.net/repository/Hypixel/") {
name = "Hypixel Maven"
content {
includeGroup("net.hypixel")
}
}
maven("https://jitpack.io") {
name = "Jitpack Maven"
content {
Expand All @@ -91,7 +97,7 @@ repositories {
maven("https://repo.polyfrost.org/releases") {
name = "Polyfrost Maven"
content {
excludeGroup("com\\.github\\.(.)+")
excludeGroupByRegex("com\\.github\\.(.)+")
}
}
maven("https://cursemaven.com") {
Expand Down Expand Up @@ -126,6 +132,8 @@ dependencies {
compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha223:full")
compileOnly("cc.polyfrost:oneconfig-loader-launchwrapper:1.0.0-beta17")

modImplementation("net.hypixel:mod-api-forge:1.0.1.2")
modRuntimeOnly("curse.maven:in-game-account-switcher-232676:3413259a")
runtimeOnly("com.github.boopwdn:YqlossClientMixin:master-SNAPSHOT:dev") {
isChanging = true
}
Expand Down Expand Up @@ -178,8 +186,13 @@ tasks {

shadowJar {
archiveClassifier = "dev"
configurations = listOf(shade.get(), modShade.get())
configurations = listOf(allShade.get())
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

relocate(
"net.hypixel.modapi.tweaker.HypixelModAPITweaker",
"net.llvg.exec.preload.vanilla_tweaker.HypixelModAPITweaker"
)
}

remapJar {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/net/llvg/exec/mixin/mixin/MixinMinecraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public abstract class MixinMinecraft implements IThreadListener, IPlayerUsage {
@Shadow
public GameSettings gameSettings;

@Inject (method = "startGame", at = @At ("TAIL"))
private void startGameInject(CallbackInfo ci) {
CallbackMinecraft.postGameStartEventPost();
}

@Inject (method = "clickMouse", at = @At ("HEAD"), cancellable = true)
private void clickMouseInject(CallbackInfo ci) {
if (FreeCam.isEnabled()) {
Expand Down Expand Up @@ -68,6 +73,16 @@ private void runTickInject(CallbackInfo ci) {
}
}

@Inject (method = "runTick", at = @At (value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;startSection(Ljava/lang/String;)V", ordinal = 0))
private void runTickInject1(CallbackInfo ci) {
CallbackMinecraft.postTickEventClientPre();
}

@Inject (method = "runTick", at = @At (value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;endSection()V", ordinal = 1))
private void runTickInject2(CallbackInfo ci) {
CallbackMinecraft.postTickEventClientPost();
}

@Inject (method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At ("HEAD"))
private void loadWorldInject(WorldClient worldClientIn, String loadingMessage, CallbackInfo ci) {
CallbackMinecraft.postWorldClientEventLoadPre(worldClientIn);
Expand Down
17 changes: 15 additions & 2 deletions src/main/kotlin/net/llvg/exec/ExeClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,45 @@

package net.llvg.exec

import java.io.File
import net.llvg.exec.api.command.ExeCCommandManager
import net.llvg.exec.api.config.ExeClientConfig
import net.llvg.exec.api.event.ExeCEventManager
import net.llvg.exec.api.feature.ExeCFeatureManager
import net.llvg.exec.hypixel.HypixelModApiHelper
import net.llvg.exec.preload.vanilla_tweaker.ExeCTweaker
import net.llvg.exec.utils.classNameLogger
import net.llvg.exec.vanilla.utils.chat_component.ChatColor
import net.llvg.exec.vanilla.utils.chat_component.ChatComponentBuildScope
import net.llvg.exec.vanilla.utils.chat_component.buildChat
import net.llvg.exec.vanilla.utils.player
import net.llvg.exec.vanilla.utils.mc
import net.minecraft.util.IChatComponent

object ExeClient {
@JvmField
val logger = classNameLogger<ExeClient>()

@JvmField
val directory: File = File(ExeCTweaker.gameDir, "Exe Client")

const val MIXIN_ID = "exec"

@JvmStatic
fun initialize() {
ExeCEventManager
ExeClientConfig
ExeCFeatureManager
ExeClientConfig
ExeCCommandManager
HypixelModApiHelper
}

fun send(
message: IChatComponent
) {
val player = mc.thePlayer
if (player === null) {
logger.warn("Try to send \"{}\" to player but player is null", message.formattedText)
}
buildChat {
of(
empty()
Expand Down
18 changes: 12 additions & 6 deletions src/main/kotlin/net/llvg/exec/api/command/ExeCCommandManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ object ExeCCommandManager : Registry<ExeCCommand>(
override fun event(
elements: MutableList<ExeCCommand>
): RegisterEvent<ExeCCommand> =
Event.Impl {
elements += it
}
EventImpl(elements)

interface Event : RegisterEvent<ExeCCommand>

sealed interface Event : RegisterEvent<ExeCCommand> {
fun interface Impl : Event
private data class EventImpl(
private val elements: MutableList<ExeCCommand>
) : Event {
override fun register(
element: ExeCCommand
) {
elements += element
}
}

init {
Expand Down Expand Up @@ -263,7 +269,7 @@ object ExeCCommandManager : Registry<ExeCCommand>(
override fun completeTab(
args: Array<String>
): List<String> = if (args.size == 1) {
commandsStartsWith(name)
commandsStartsWith(args[0])
} else {
emptyList()
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/net/llvg/exec/api/config/ExeClientConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import cc.polyfrost.oneconfig.config.Config
import cc.polyfrost.oneconfig.config.annotations.SubConfig
import cc.polyfrost.oneconfig.config.data.Mod
import cc.polyfrost.oneconfig.config.data.ModType
import net.llvg.exec.feature.catacombs_scan.CatacombsScanConfig
import net.llvg.exec.feature.freecam.FreeCamConfig
import net.llvg.exec.utils.classNameLogger

Expand All @@ -37,6 +38,10 @@ object ExeClientConfig : Config(
@Transient
private val logger = classNameLogger<ExeClientConfig>()

@SubConfig
val configCatacombsScan =
CatacombsScanConfig

@SubConfig
val configFreeCamera =
FreeCamConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

package net.llvg.exec.api.feature

import net.llvg.exec.feature.catacombs_scan.CatacombsScan
import net.llvg.exec.feature.freecam.FreeCam
import net.llvg.exec.utils.registry.RegisterEvent
import net.llvg.exec.utils.registry.Registry

object ExeCFeatureManager : Registry<ExeCFeature<*>>(
CatacombsScan,
FreeCam
) {
override fun event(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (C) 2025 Water-OR
*
* This file is part of ExeClient
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.llvg.exec.feature.catacombs_scan

import kotlinx.coroutines.Dispatchers
import net.llvg.exec.api.command.ExeCCommandManager
import net.llvg.exec.api.config.ExeClientConfig
import net.llvg.exec.api.event.onEvent
import net.llvg.exec.api.feature.ExeCFeature
import net.llvg.exec.hypixel.skyblock.catacombs.isInCatacombsBoss
import net.llvg.exec.hypixel.skyblock.catacombs.map.scan.CatacombsScanner
import net.llvg.exec.hypixel.skyblock.isInCatacombs
import net.llvg.exec.vanilla.event.TickEvent

object CatacombsScan : ExeCFeature<CatacombsScanConfig> {
init {
onEvent(Dispatchers.Default, always = true) { e: ExeCCommandManager.Event ->
e register CatacombsScanCommand
}

onEvent(Dispatchers.Default) { _: TickEvent.Client.Post ->
if (config.autoScan) {
CatacombsScanner.scan()
}
}
}

override fun initialize() {}

fun checkInCatacombs(): Boolean =
!config.onlyInCatacombs || isInCatacombs

fun checkNotInBoss(): Boolean =
!config.onlyNotInBoss || !isInCatacombsBoss

override val config: CatacombsScanConfig
get() = ExeClientConfig.configCatacombsScan

override val active: Boolean
get() = config.active
}
Loading