mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-08 23:06:58 -04:00
Returning failure reason of first attempt in robot.swing(), closes #555.
This commit is contained in:
parent
e75b25c06e
commit
9d9d3f1639
@ -37,8 +37,8 @@ object OpenComputers {
|
||||
|
||||
@EventHandler
|
||||
def preInit(e: FMLPreInitializationEvent) {
|
||||
proxy.preInit(e)
|
||||
log = e.getModLog
|
||||
proxy.preInit(e)
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -521,7 +521,7 @@ class Robot extends traits.Computer with traits.PowerInformation with api.machin
|
||||
case _ => false
|
||||
})
|
||||
|
||||
def isUpgradeSlot(slot: Int) = false // slot == 3 TODO upgrade synching for rendering
|
||||
def isUpgradeSlot(slot: Int) = containerSlotType(slot) == Slot.Upgrade
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -312,6 +312,7 @@ class Robot(val robot: tileentity.Robot) extends ManagedComponent {
|
||||
(broke, "block")
|
||||
}
|
||||
|
||||
var reason: Option[String] = None
|
||||
for (side <- sides) {
|
||||
val player = robot.player(facing, side)
|
||||
player.setSneaking(sneaky)
|
||||
@ -341,9 +342,10 @@ class Robot(val robot: tileentity.Robot) extends ManagedComponent {
|
||||
if (success) {
|
||||
return result(true, what)
|
||||
}
|
||||
reason = reason.orElse(Option(what))
|
||||
}
|
||||
|
||||
result(false)
|
||||
result(false, reason.orNull)
|
||||
}
|
||||
|
||||
@Callback
|
||||
|
Loading…
x
Reference in New Issue
Block a user