mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 01:39:36 -04:00
Merge branch 'master-MC1.11' into master-MC1.12
This commit is contained in:
commit
497714b50b
@ -186,7 +186,13 @@ class Drone(world: World) extends Entity(world) with MachineHost with internal.D
|
||||
|
||||
override def isPaused: Boolean = machine.isPaused
|
||||
|
||||
override def start(): Boolean = machine.start()
|
||||
override def start(): Boolean = {
|
||||
if (world.isRemote || machine.isRunning) {
|
||||
return false
|
||||
}
|
||||
preparePowerUp()
|
||||
machine.start()
|
||||
}
|
||||
|
||||
override def pause(seconds: Double): Boolean = machine.pause(seconds)
|
||||
|
||||
@ -487,7 +493,6 @@ class Drone(world: World) extends Entity(world) with MachineHost with internal.D
|
||||
}
|
||||
}
|
||||
else if (!world.isRemote && !machine.isRunning) {
|
||||
preparePowerUp()
|
||||
start()
|
||||
}
|
||||
}
|
||||
|
@ -173,16 +173,18 @@ class NetworkCard(val host: EnvironmentHost) extends AbstractManagedEnvironment
|
||||
}
|
||||
// Accept wake-up messages regardless of port because we close all ports
|
||||
// when our computer shuts down.
|
||||
packet.data match {
|
||||
case Array(message: Array[Byte]) if wakeMessage.contains(new String(message, Charsets.UTF_8)) =>
|
||||
node.sendToNeighbors("computer.start")
|
||||
case Array(message: String) if wakeMessage.contains(message) =>
|
||||
node.sendToNeighbors("computer.start")
|
||||
case Array(message: Array[Byte], _*) if wakeMessageFuzzy && wakeMessage.contains(new String(message, Charsets.UTF_8)) =>
|
||||
node.sendToNeighbors("computer.start")
|
||||
case Array(message: String, _*) if wakeMessageFuzzy && wakeMessage.contains(message) =>
|
||||
node.sendToNeighbors("computer.start")
|
||||
case _ =>
|
||||
val wakeup: Boolean = packet.data match {
|
||||
case Array(message: Array[Byte]) if wakeMessage.contains(new String(message, Charsets.UTF_8)) => true
|
||||
case Array(message: String) if wakeMessage.contains(message) => true
|
||||
case Array(message: Array[Byte], _*) if wakeMessageFuzzy && wakeMessage.contains(new String(message, Charsets.UTF_8)) => true
|
||||
case Array(message: String, _*) if wakeMessageFuzzy && wakeMessage.contains(message) => true
|
||||
case _ => false
|
||||
}
|
||||
if (wakeup) {
|
||||
host match {
|
||||
case ctx: Context => ctx.start()
|
||||
case _ => node.sendToNeighbors("computer.start")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,8 @@ object InventoryUtils {
|
||||
(!stack.isEmpty && limit > 0 && stack.getCount > 0) && {
|
||||
var amount = stack.getMaxStackSize min stack.getCount min limit
|
||||
inventory.extractItem(slot, amount, true) match {
|
||||
case extracted: ItemStack =>
|
||||
case simExtracted: ItemStack =>
|
||||
val extracted = simExtracted.copy
|
||||
amount = extracted.getCount
|
||||
consumer(extracted)
|
||||
if(extracted.getCount >= amount) return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user