23 lines
739 B
Kotlin
23 lines
739 B
Kotlin
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.isTouchingWater) {
|
|
event.cancel()
|
|
}
|
|
}
|
|
}
|
|
|
|
hiddenInOverlay = true
|
|
}
|
|
}
|