mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-29 07:51:12 -04:00
Merge branch 'master' of https://github.com/MightyPirates/OpenComputers into MC1.7
This commit is contained in:
commit
92e1abad17
@ -40,7 +40,6 @@ class Proxy {
|
||||
def call = FileSystem.fromClass(OpenComputers.getClass, Settings.resourceDomain, "lua/rom")
|
||||
},
|
||||
Settings.resourceDomain + "/lua/rom")
|
||||
|
||||
}
|
||||
|
||||
def init(e: FMLInitializationEvent) {
|
||||
|
@ -82,14 +82,18 @@ class Hologram extends Environment with SidedEnvironment with Analyzable {
|
||||
@Callback(direct = true, doc = """function(x:number, z:number):number -- Returns the bit mask representing the specified column.""")
|
||||
def get(computer: Context, args: Arguments): Array[AnyRef] = this.synchronized {
|
||||
val x = args.checkInteger(0) - 1
|
||||
if (x < 0 || x >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
val z = args.checkInteger(1) - 1
|
||||
if (z < 0 || z >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
result(volume(x + z * width))
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 256, doc = """function(x:number, z:number, value:number) -- Set the bit mask for the specified column.""")
|
||||
def set(computer: Context, args: Arguments): Array[AnyRef] = this.synchronized {
|
||||
val x = args.checkInteger(0) - 1
|
||||
if (x < 0 || x >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
val z = args.checkInteger(1) - 1
|
||||
if (z < 0 || z >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
val value = args.checkInteger(2)
|
||||
volume(x + z * width) = value
|
||||
setDirty(x, z)
|
||||
@ -99,7 +103,9 @@ class Hologram extends Environment with SidedEnvironment with Analyzable {
|
||||
@Callback(direct = true, limit = 128, doc = """function(x:number, z:number, height:number) -- Fills a column to the specified height.""")
|
||||
def fill(computer: Context, args: Arguments): Array[AnyRef] = this.synchronized {
|
||||
val x = args.checkInteger(0) - 1
|
||||
if (x < 0 || x >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
val z = args.checkInteger(1) - 1
|
||||
if (z < 0 || z >= width) throw new ArrayIndexOutOfBoundsException()
|
||||
val height = math.min(32, math.max(0, args.checkInteger(2)))
|
||||
// Bit shifts in the JVM only use the lowest five bits... so we have to
|
||||
// manually check the height, to avoid the shift being a no-op.
|
||||
|
@ -53,7 +53,10 @@ class Router extends Hub with IPeripheral {
|
||||
case "transmit" =>
|
||||
val sendPort = checkPort(arguments, 0)
|
||||
val answerPort = checkPort(arguments, 1)
|
||||
plugs.foreach(_.node.sendToReachable("network.message", Seq(Int.box(sendPort), Int.box(answerPort)) ++ arguments.drop(2): _*))
|
||||
val data = Seq(Int.box(answerPort)) ++ arguments.drop(2)
|
||||
plugs.foreach(plug => {
|
||||
plug.node.sendToReachable("network.message", new Packet(plug.node.address, None, sendPort, data))
|
||||
})
|
||||
null
|
||||
case "isWireless" => Array(java.lang.Boolean.FALSE)
|
||||
case _ => null
|
||||
|
Loading…
x
Reference in New Issue
Block a user