Skip to content

Commit

Permalink
Disabler
Browse files Browse the repository at this point in the history
  • Loading branch information
mingtian1750 committed Jan 8, 2025
1 parent f4c3f76 commit f7d0d91
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package dev.exceptionteam.sakura.features.modules.impl.misc

import dev.exceptionteam.sakura.events.impl.PacketEvents
import dev.exceptionteam.sakura.events.impl.TickEvent
import dev.exceptionteam.sakura.events.nonNullListener
import dev.exceptionteam.sakura.features.modules.Category
import dev.exceptionteam.sakura.features.modules.Module
import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket
import net.minecraft.network.protocol.game.ServerboundContainerClickPacket
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket

object Disabler: Module(
name = "Disabler",
category = Category.MISC,
) {
private val c0f by setting("C0fDisabler", false)
private val C2S by setting("NoMoveC2S", false)
private val MotionPacket by setting("NoMotionPacket", false)

init {
nonNullListener<PacketEvents.Receive> { e ->
//C0f
if (e.packet is ServerboundContainerClickPacket) {
if(c0f) {
e.cancel()
}
}
if (e.packet is ServerboundMovePlayerPacket) {
if(C2S) {
e.cancel()
}
}
if (e.packet is ClientboundSetEntityMotionPacket) {
if(MotionPacket) {
e.cancel()
}
}

}

nonNullListener<TickEvent.Post> {
if(C2S) {
connection.send(
ServerboundMovePlayerPacket.PosRot(
player.x, player.y, player.z,
player.yRot, player.xRot,
player.onGround(),
player.horizontalCollision
)
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ object ModuleManager {
Language,

// Misc
Disabler,
FakePlayer,

// Render
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/sakura/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ modules.water-mark=Water Mark
modules.water-mark.version=Version
modules.water-mark.text-color=Text Color

modules.Disabler=Disabler
modules.Disabler.C0fDisabler=C0fDisabler
modules.Disabler.NoMoveC2S=NoMoveC2S
modules.Disabler.NoMotionPacket=NoMotionPacket

modules.fake-player=Fake Player
modules.fake-player.health=Health

Expand Down

0 comments on commit f7d0d91

Please sign in to comment.