mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 08:50:04 -04:00
Fixed maximum flight height computation involving built-in hover upgrades. Fixes #1156.
This commit is contained in:
parent
a683ff4bf9
commit
359fa0f990
@ -34,9 +34,14 @@ object RobotCommonHandler {
|
||||
(0 until robot.equipmentInventory.getSizeInventory).
|
||||
map(robot.equipmentInventory.getStackInSlot).
|
||||
map(Delegator.subItem).
|
||||
collect { case Some(item: UpgradeHover) => maxFlyingHeight = Settings.get.upgradeFlightHeight(item.tier) }
|
||||
collect { case Some(item: UpgradeHover) => maxFlyingHeight = math.max(maxFlyingHeight, Settings.get.upgradeFlightHeight(item.tier)) }
|
||||
|
||||
(0 until robot.componentCount).
|
||||
map(_ + robot.mainInventory.getSizeInventory + robot.equipmentInventory.getSizeInventory).
|
||||
map(robot.getStackInSlot).
|
||||
map(Delegator.subItem).
|
||||
collect { case Some(item: UpgradeHover) => maxFlyingHeight = math.max(maxFlyingHeight, Settings.get.upgradeFlightHeight(item.tier)) }
|
||||
|
||||
robot.componentCount()
|
||||
def isMovingDown = e.direction == ForgeDirection.DOWN
|
||||
def hasAdjacentBlock(pos: BlockPosition) = ForgeDirection.VALID_DIRECTIONS.exists(side => world.isSideSolid(pos.offset(side), side.getOpposite))
|
||||
def isWithinFlyingHeight(pos: BlockPosition) = (1 to maxFlyingHeight).exists(n => !world.isAirBlock(pos.offset(ForgeDirection.DOWN, n)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user