Add Baritone, Gamma, No Sprinting Packet, and ensure Unknit blocks Fabric registration handshake

main
Charlotte Som 2022-02-14 06:54:36 +00:00
parent 461d343362
commit 3265282b30
10 changed files with 88 additions and 1 deletions

View File

@ -55,6 +55,7 @@ dependencies {
runtimeOnly("org.joml:joml:1.10.2")
runtimeOnly("org.anarres:jcpp:1.4.14")
modImplementation(files("vendor/mods/baritone-unoptimized-fabric-1.8.2.jar"))
modRuntimeOnly(files("vendor/mods/iris-mc1.18.1-1.2.0-pre.jar"))
modRuntimeOnly(files("vendor/mods/sodium-fabric-mc1.18.1-0.4.0-alpha6+build.14.jar"))
modRuntimeOnly(files("vendor/mods/lazydfu-0.1.2.jar"))

View File

@ -0,0 +1,15 @@
package site.hackery.unknit.mixin;
import net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = AbstractChanneledNetworkAddon.class, remap = false)
public class MixinFabricAbstractChanneledNetworkAddon {
@Inject(method = "sendInitialChannelRegistrationPacket", at = @At("HEAD"), cancellable = true, remap = false)
private void onSendRegistration(CallbackInfo ci) {
ci.cancel();
}
}

View File

@ -9,6 +9,7 @@ import codes.som.hibiscus.features.FeaturesRegistry
import codes.som.hibiscus.features.combat.Criticals
import codes.som.hibiscus.features.exploits.AntiGhost
import codes.som.hibiscus.features.player.NoFallDamage
import codes.som.hibiscus.features.player.NoSprintingPacket
import codes.som.hibiscus.gui.ImGuiScreen
import codes.som.hibiscus.util.command.ChatCommandListener
import codes.som.hibiscus.util.input.KeybindDispatcher
@ -69,5 +70,6 @@ object HibiscusMod : ModInitializer {
features.getFeature<AntiGhost>().enabled = true
features.getFeature<NoFallDamage>().enabled = true
features.getFeature<Criticals>().enabled = true
features.getFeature<NoSprintingPacket>().enabled = true
}
}

View File

@ -0,0 +1,28 @@
@file:Suppress("UNCHECKED_CAST")
package codes.som.hibiscus.api.command.handler
sealed interface CommandHandler {
fun handle(vararg args: Any?)
}
fun interface CommandHandler0 : CommandHandler {
fun handle()
override fun handle(vararg args: Any?) {
handle()
}
}
fun interface CommandHandler1<A> : CommandHandler {
fun handle(p1: A)
override fun handle(vararg args: Any?) {
handle(args[0] as A)
}
}
fun interface CommandHandler2<A, B> : CommandHandler {
fun handle(p1: A, p2: B)
override fun handle(vararg args: Any?) {
handle(args[0] as A, args[1] as B)
}
}

View File

@ -6,6 +6,7 @@ import codes.som.hibiscus.api.command.CommandManager
fun allCommandClasses(): Array<() -> Command> = arrayOf(
::Reload,
::Vclip,
::Gamma,
)
class CommandRegistry : CommandManager() {

View File

@ -0,0 +1,13 @@
package codes.som.hibiscus.commands
import codes.som.hibiscus.api.command.Command
import codes.som.hibiscus.mc
class Gamma : Command("gamma") {
init {
branch { gamma: Double ->
mc.options.gamma = gamma
Unit
}
}
}

View File

@ -8,6 +8,7 @@ import codes.som.hibiscus.features.movement.Flight
import codes.som.hibiscus.features.movement.Speed
import codes.som.hibiscus.features.overlay.Overlay
import codes.som.hibiscus.features.player.NoFallDamage
import codes.som.hibiscus.features.player.NoSprintingPacket
import codes.som.hibiscus.features.visual.Freecam
import codes.som.hibiscus.util.Resettable
@ -20,6 +21,7 @@ fun allFeatureClasses(): Array<() -> Feature> = arrayOf(
::Ghost,
::AntiGhost,
::Freecam,
::NoSprintingPacket,
)
class FeaturesRegistry : Resettable {

View File

@ -34,6 +34,7 @@ class Overlay : Feature("Overlay", FeatureCategory.OVERLAY) {
ImGui.popStyleColor()
}
hiddenInOverlay = true
enabled = true
}

View File

@ -0,0 +1,22 @@
package codes.som.hibiscus.features.player
import codes.som.hibiscus.api.feature.Feature
import codes.som.hibiscus.api.feature.FeatureCategory
import codes.som.hibiscus.events.SendPacketEvent
import codes.som.hibiscus.player
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket
class NoSprintingPacket : Feature("No Sprinting Packet", FeatureCategory.PLAYER) {
init {
on { event: SendPacketEvent ->
val (packet) = event
if (packet is ClientCommandC2SPacket) {
if (packet.mode == ClientCommandC2SPacket.Mode.START_SPRINTING && !player.isSubmergedInWater) {
event.cancel()
}
}
}
hiddenInOverlay = true
}
}

View File

@ -5,9 +5,11 @@
"injectors": {
"defaultRequire": 1
},
"mixins": [],
"mixins": [
],
"client": [
"MixinClientBrandRetriever",
"MixinFabricAbstractChanneledNetworkAddon",
"MixinMinecraftClient",
"MixinMinecraftMain"
]