diff --git a/.gitmodules b/.gitmodules index aa94bdf..0e1b309 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "build_src/quilt-mappings-on-loom"] path = build_src/quilt-mappings-on-loom url = https://git.lavender.software/hibiscus-client/quilt-mappings-on-loom.git -[submodule "build_src/fabric-loom"] - path = build_src/fabric-loom - url = https://git.lavender.software/hibiscus-client/fabric-loom.git [submodule "vendor"] path = vendor url = https://git.lavender.software/hibiscus-client/vendored-jars.git diff --git a/build.gradle.kts b/build.gradle.kts index 009091d..31bc815 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import org.gradle.kotlin.dsl.accessors.runtime.extensionOf +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.quiltmc.quiltmappings.loom.QuiltMappingsOnLoomPlugin plugins { @@ -66,6 +67,7 @@ dependencies { modImplementation(files("vendor/mods/iris-mc1.18.2-1.2.1-rc2-0cc372f0.jar")) modImplementation(files("vendor/mods/sodium-fabric-mc1.18.2-0.4.1+build.15.jar")) modRuntimeOnly(files("vendor/mods/lazydfu-0.1.2.jar")) + implementation(kotlin("stdlib-jdk8")) } loom { @@ -106,3 +108,11 @@ tasks { withSourcesJar() } } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} diff --git a/build_src/fabric-loom b/build_src/fabric-loom deleted file mode 160000 index 71c28bb..0000000 --- a/build_src/fabric-loom +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 71c28bbcd075d6d0c45dcdde71246e61ccb661e3 diff --git a/gradle.properties b/gradle.properties index 430fcd8..c832270 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,13 +5,13 @@ org.gradle.warning.mode=all minecraftVersion=1.18.2 quiltMappings=1.18.2+build.7 # Fabric https://fabricmc.net/develop/ -loaderVersion=0.13.3 -fabricVersion=0.47.10+1.18.2 -loomVersion=0.10-SNAPSHOT +loaderVersion=0.14.9 +fabricVersion=0.58.0+1.18.2 +loomVersion=1.0-SNAPSHOT # Mod Properties modVersion=1.0.0 mavenGroup=codes.som archivesBaseName=hibiscus-client # Kotlin systemProp.kotlinVersion=1.6.10 -fabricKotlinVersion=1.7.1+kotlin.1.6.10 +fabricKotlinVersion=1.8.3+kotlin.1.7.10 diff --git a/settings.gradle.kts b/settings.gradle.kts index 856987f..59d668c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,3 @@ -includeBuild("build_src/fabric-loom") includeBuild("build_src/quilt-mappings-on-loom") pluginManagement { diff --git a/src/main/kotlin/codes/som/hibiscus/features/FeaturesRegistry.kt b/src/main/kotlin/codes/som/hibiscus/features/FeaturesRegistry.kt index deebe25..9e46f4b 100644 --- a/src/main/kotlin/codes/som/hibiscus/features/FeaturesRegistry.kt +++ b/src/main/kotlin/codes/som/hibiscus/features/FeaturesRegistry.kt @@ -2,8 +2,7 @@ package codes.som.hibiscus.features import codes.som.hibiscus.api.feature.Feature import codes.som.hibiscus.features.combat.Criticals -import codes.som.hibiscus.features.exploits.AntiGhost -import codes.som.hibiscus.features.exploits.Ghost +import codes.som.hibiscus.features.exploits.* import codes.som.hibiscus.features.movement.Flight import codes.som.hibiscus.features.movement.Speed import codes.som.hibiscus.features.overlay.Overlay @@ -33,6 +32,9 @@ fun FEATURE_CONSTRUCTORS(): Array<() -> Feature> = arrayOf( ::Fullbright, ::NoFog, ::SpeedMine, + ::CivBreak, + ::DropDirt, + ::BotPretend, ) class FeaturesRegistry : Resettable { diff --git a/src/main/kotlin/codes/som/hibiscus/features/exploits/BotPretend.kt b/src/main/kotlin/codes/som/hibiscus/features/exploits/BotPretend.kt new file mode 100644 index 0000000..688165c --- /dev/null +++ b/src/main/kotlin/codes/som/hibiscus/features/exploits/BotPretend.kt @@ -0,0 +1,64 @@ +package codes.som.hibiscus.features.exploits + +import codes.som.hibiscus.api.command.Command +import codes.som.hibiscus.api.feature.Feature +import codes.som.hibiscus.api.feature.FeatureCategory +import codes.som.hibiscus.events.NetworkMovingEvent +import codes.som.hibiscus.events.PlayerPreTickEvent +import codes.som.hibiscus.events.SendPacketEvent +import codes.som.hibiscus.mc +import codes.som.hibiscus.player +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket + +class BotPretend : Feature("Bot Pretend", FeatureCategory.EXPLOITS) { + init { + on { e -> + val x = ((e.x * 100).toLong()) / 100.0 + val z = ((e.z * 100).toLong()) / 100.0 + + // TODO: Collisions? + /* for (x in arrayOf(-1, 0, 1)) { + for (z in arrayOf(-1, 0, 1)) { + + if (world.getCollisions(player, player.boundingBox.offset())) + } + } */ + + e.x = x + e.z = z + } + + on { + // player.updatePosition(player.x.roundToLong().toDouble(), player.y, player.z.roundToLong().toDouble()) + } + + on { e -> + val packet = e.packet + if (packet is PlayerMoveC2SPacket) { + if (packet.changesPosition()) { + println("Move: ${packet.getX(player.x)}, ${packet.getZ(player.z)}") + } + } + } + } + + override fun createFeatureCommand(): Command { + return super.createFeatureCommand().apply { + branch("send", { + val x = (player.x * 10).toLong() / 10.0 + val z = (player.z * 10).toLong() / 10.0 + + player.updatePosition(x, player.y, z) + + mc.networkHandler!!.connection!!.send( + PlayerMoveC2SPacket.PositionAndOnGround( + x, + player.y, + z, + player.isOnGround + ) + ) + }) + } + } +} diff --git a/src/main/kotlin/codes/som/hibiscus/features/exploits/CivBreak.kt b/src/main/kotlin/codes/som/hibiscus/features/exploits/CivBreak.kt new file mode 100644 index 0000000..47e6c2b --- /dev/null +++ b/src/main/kotlin/codes/som/hibiscus/features/exploits/CivBreak.kt @@ -0,0 +1,33 @@ +package codes.som.hibiscus.features.exploits + +import codes.som.hibiscus.api.feature.Feature +import codes.som.hibiscus.api.feature.FeatureCategory +import codes.som.hibiscus.events.PlayerTickEvent +import codes.som.hibiscus.events.SendPacketEvent +import codes.som.hibiscus.player +import net.minecraft.network.Packet +import net.minecraft.network.listener.ServerPlayPacketListener +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket + +class CivBreak : Feature("Civ Break", FeatureCategory.EXPLOITS) { + private var endBreakPacket: Packet? = null + + init { + on { event: SendPacketEvent -> + val packet = event.packet + + if (packet is PlayerActionC2SPacket) { + when (packet.action) { + PlayerActionC2SPacket.Action.START_DESTROY_BLOCK -> endBreakPacket = null + PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK -> endBreakPacket = packet + else -> {} + } + } + } + + on { + if (endBreakPacket != null) + player.networkHandler.sendPacket(endBreakPacket) + } + } +} diff --git a/src/main/kotlin/codes/som/hibiscus/features/exploits/DropDirt.kt b/src/main/kotlin/codes/som/hibiscus/features/exploits/DropDirt.kt new file mode 100644 index 0000000..1ed227c --- /dev/null +++ b/src/main/kotlin/codes/som/hibiscus/features/exploits/DropDirt.kt @@ -0,0 +1,17 @@ +package codes.som.hibiscus.features.exploits + +import codes.som.hibiscus.api.feature.Feature +import codes.som.hibiscus.api.feature.FeatureCategory +import codes.som.hibiscus.events.PlayerTickEvent +import codes.som.hibiscus.player +import net.minecraft.item.Items + +class DropDirt : Feature("Drop Dirt", FeatureCategory.EXPLOITS) { + init { + on { + if (player.age % 2 == 0) + if (player.mainHandStack?.item == Items.DIRT) + player.dropSelectedItem(false) + } + } +} diff --git a/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt b/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt index 3d3d55a..ea2dfcc 100644 --- a/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt +++ b/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt @@ -91,7 +91,7 @@ class Flight : Feature("Flight", FeatureCategory.MOVEMENT) { on(cond = { spoofAbilityPackets }) { event: SendPacketEvent -> val (packet) = event - + if (packet is UpdatePlayerAbilitiesC2SPacket) { requireExtension(packet) packet.setFlying(player.abilities.allowFlying) diff --git a/src/main/kotlin/codes/som/hibiscus/subsystems/accounts/AccountsSubsystem.kt b/src/main/kotlin/codes/som/hibiscus/subsystems/accounts/AccountsSubsystem.kt index 831f00c..10f664b 100644 --- a/src/main/kotlin/codes/som/hibiscus/subsystems/accounts/AccountsSubsystem.kt +++ b/src/main/kotlin/codes/som/hibiscus/subsystems/accounts/AccountsSubsystem.kt @@ -48,8 +48,10 @@ object AccountsSubsystem { fun deleteAccount(account: MinecraftAccount) { val id = account.id.value - accounts = accounts.filter { it.id.value == id } - account.delete() + accounts = accounts.filter { it.id.value != id } + Hibiscus.data.txn { + account.delete() + } } fun reload() {