2022-02-14 06:54:36 +00:00
|
|
|
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) {
|
2022-02-14 07:08:43 +00:00
|
|
|
if (packet.mode == ClientCommandC2SPacket.Mode.START_SPRINTING && !player.isTouchingWater) {
|
2022-02-14 06:54:36 +00:00
|
|
|
event.cancel()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-14 07:08:43 +00:00
|
|
|
|
2022-02-14 06:54:36 +00:00
|
|
|
hiddenInOverlay = true
|
|
|
|
}
|
|
|
|
}
|