From c3e357b3fd517b531bbcc65933374d1e33ccbc43 Mon Sep 17 00:00:00 2001 From: Pierce Corcoran Date: Thu, 3 Oct 2019 00:27:41 -0700 Subject: [PATCH] Fix #26 --- .../thecodewarrior/hooked/common/hook/HookController.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/games/thecodewarrior/hooked/common/hook/HookController.kt b/src/main/java/games/thecodewarrior/hooked/common/hook/HookController.kt index 1cb59bb..b6baa98 100644 --- a/src/main/java/games/thecodewarrior/hooked/common/hook/HookController.kt +++ b/src/main/java/games/thecodewarrior/hooked/common/hook/HookController.kt @@ -19,6 +19,8 @@ import games.thecodewarrior.hooked.HookedMod import net.minecraft.entity.Entity import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.player.EntityPlayer +import net.minecraft.entity.player.EntityPlayerMP +import net.minecraft.network.NetHandlerPlayServer import net.minecraft.util.math.RayTraceResult import net.minecraft.util.math.Vec3d import java.util.LinkedList @@ -332,6 +334,8 @@ abstract class HookController( player.fallDistance = 0f player.jumpTicks = 10 + + (player as? EntityPlayerMP)?.connection?.floatingTickCount = 0 HookedMod.PROXY.setAutoJump(player, false) val waist = getWaistPos(player) val deltaPos = targetPoint - waist @@ -372,5 +376,8 @@ abstract class HookController( private var EntityLivingBase.jumpTicks by MethodHandleHelper.delegateForReadWrite( EntityLivingBase::class.java, "jumpTicks", "field_70773_bE") + private var net.minecraft.network.NetHandlerPlayServer.floatingTickCount by MethodHandleHelper + .delegateForReadWrite( + NetHandlerPlayServer::class.java, "floatingTickCount", "field_147365_f") } }