Merge branch 'master' of github.com:MightyPirates/OpenComputers into master-MC1.7.10

This commit is contained in:
Florian Nücke 2014-09-19 11:41:07 +02:00
commit 326858ff56

View File

@ -86,15 +86,15 @@ object DebugCard {
null null
}) })
@Callback(doc = """function():number, number, number -- Get the player's position.""") @Callback(doc = """function():number -- Get the player's health.""")
def getHealth(context: Context, args: Arguments): Array[AnyRef] = def getHealth(context: Context, args: Arguments): Array[AnyRef] =
withPlayer(player => Array(float2Float(player.getHealth))) withPlayer(player => Array(float2Float(player.getHealth)))
@Callback(doc = """function():number, number, number -- Get the player's position.""") @Callback(doc = """function():number -- Get the player's max health.""")
def getMaxHealth(context: Context, args: Arguments): Array[AnyRef] = def getMaxHealth(context: Context, args: Arguments): Array[AnyRef] =
withPlayer(player => Array(float2Float(player.getMaxHealth))) withPlayer(player => Array(float2Float(player.getMaxHealth)))
@Callback(doc = """function():number, number, number -- Get the player's position.""") @Callback(doc = """function(health:number) -- Set the player's health.""")
def setHealth(context: Context, args: Arguments): Array[AnyRef] = def setHealth(context: Context, args: Arguments): Array[AnyRef] =
withPlayer(player => { withPlayer(player => {
player.setHealth(args.checkDouble(0).toFloat) player.setHealth(args.checkDouble(0).toFloat)
@ -236,4 +236,4 @@ object DebugCard {
} }
} }
} }