mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
Made boots work when power is disabled.
This commit is contained in:
parent
ce0ec1dc54
commit
e647e37243
@ -17,6 +17,7 @@ object HoverBootsHandler {
|
|||||||
val hadHoverBoots = nbt.getBoolean(Settings.namespace + "hasHoverBoots")
|
val hadHoverBoots = nbt.getBoolean(Settings.namespace + "hasHoverBoots")
|
||||||
val hasHoverBoots = !player.isSneaking && equippedArmor(player).exists(stack => stack.getItem match {
|
val hasHoverBoots = !player.isSneaking && equippedArmor(player).exists(stack => stack.getItem match {
|
||||||
case boots: HoverBoots =>
|
case boots: HoverBoots =>
|
||||||
|
Settings.get.ignorePower || {
|
||||||
if (player.onGround && !player.capabilities.isCreativeMode && player.worldObj.getTotalWorldTime % 20 == 0) {
|
if (player.onGround && !player.capabilities.isCreativeMode && player.worldObj.getTotalWorldTime % 20 == 0) {
|
||||||
val velocity = player.motionX * player.motionX + player.motionY * player.motionY + player.motionZ * player.motionZ
|
val velocity = player.motionX * player.motionX + player.motionY * player.motionY + player.motionZ * player.motionZ
|
||||||
if (velocity > 0.015f) {
|
if (velocity > 0.015f) {
|
||||||
@ -24,6 +25,7 @@ object HoverBootsHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boots.getCharge(stack) > 0
|
boots.getCharge(stack) > 0
|
||||||
|
}
|
||||||
case _ => false
|
case _ => false
|
||||||
})
|
})
|
||||||
if (hasHoverBoots != hadHoverBoots) {
|
if (hasHoverBoots != hadHoverBoots) {
|
||||||
@ -43,7 +45,7 @@ object HoverBootsHandler {
|
|||||||
case stack if stack.getItem.isInstanceOf[HoverBoots] =>
|
case stack if stack.getItem.isInstanceOf[HoverBoots] =>
|
||||||
val boots = stack.getItem.asInstanceOf[HoverBoots]
|
val boots = stack.getItem.asInstanceOf[HoverBoots]
|
||||||
val hoverJumpCost = -Settings.get.hoverBootJump
|
val hoverJumpCost = -Settings.get.hoverBootJump
|
||||||
val isCreative = player.capabilities.isCreativeMode
|
val isCreative = Settings.get.ignorePower || player.capabilities.isCreativeMode
|
||||||
if (isCreative || boots.charge(stack, hoverJumpCost, simulate = true) == 0) {
|
if (isCreative || boots.charge(stack, hoverJumpCost, simulate = true) == 0) {
|
||||||
if (!isCreative) boots.charge(stack, hoverJumpCost, simulate = false)
|
if (!isCreative) boots.charge(stack, hoverJumpCost, simulate = false)
|
||||||
if (player.isSprinting)
|
if (player.isSprinting)
|
||||||
@ -62,7 +64,7 @@ object HoverBootsHandler {
|
|||||||
case stack if stack.getItem.isInstanceOf[HoverBoots] =>
|
case stack if stack.getItem.isInstanceOf[HoverBoots] =>
|
||||||
val boots = stack.getItem.asInstanceOf[HoverBoots]
|
val boots = stack.getItem.asInstanceOf[HoverBoots]
|
||||||
val hoverFallCost = -Settings.get.hoverBootAbsorb
|
val hoverFallCost = -Settings.get.hoverBootAbsorb
|
||||||
val isCreative = player.capabilities.isCreativeMode
|
val isCreative = Settings.get.ignorePower || player.capabilities.isCreativeMode
|
||||||
if (isCreative || boots.charge(stack, hoverFallCost, simulate = true) == 0) {
|
if (isCreative || boots.charge(stack, hoverFallCost, simulate = true) == 0) {
|
||||||
if (!isCreative) boots.charge(stack, hoverFallCost, simulate = false)
|
if (!isCreative) boots.charge(stack, hoverFallCost, simulate = false)
|
||||||
e.distance *= 0.3f
|
e.distance *= 0.3f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user