From 457e18be64bd319f030b71a60ef84a37826f9aea Mon Sep 17 00:00:00 2001 From: gamax92 Date: Fri, 15 Jan 2016 15:00:56 -0700 Subject: [PATCH] Added `playSoundAt` to debug card. --- .../scala/li/cil/oc/server/component/DebugCard.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/scala/li/cil/oc/server/component/DebugCard.scala b/src/main/scala/li/cil/oc/server/component/DebugCard.scala index e48535289..e3f94f15e 100644 --- a/src/main/scala/li/cil/oc/server/component/DebugCard.scala +++ b/src/main/scala/li/cil/oc/server/component/DebugCard.scala @@ -388,6 +388,16 @@ object DebugCard { null } + @Callback(doc = """function(x:number, y:number, z:number, sound:string, range:number) -- Play a sound at the specified coordinates.""") + def playSoundAt(context: Context, args: Arguments): Array[AnyRef] = { + checkEnabled() + val (x, y, z) = (args.checkInteger(0), args.checkInteger(1), args.checkInteger(2)) + val sound = args.checkString(3) + val range = args.checkInteger(4) + world.playSoundEffect(x, y, z, sound, range / 15 + 0.5F, 1.0F) + null + } + // ----------------------------------------------------------------------- // @Callback(doc = """function(x:number, y:number, z:number):number -- Get the ID of the block at the specified coordinates.""")