From 872bb46a94649bd2d4510afc93f9d47a4a8be32f Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Fri, 28 Dec 2012 09:16:25 +0000 Subject: [PATCH] Added support for Trees and changed $SCRIPTPATH to the more understandable $SCRIPT_DIR --- CommandScript.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CommandScript.java b/CommandScript.java index f6544c5..857be21 100644 --- a/CommandScript.java +++ b/CommandScript.java @@ -171,7 +171,7 @@ public class CommandScript extends CommandBase { } filename = scriptFile.getAbsolutePath(); ((ScriptableObject)thisObj).defineProperty("$SCRIPT",scriptFile.getAbsolutePath(),ScriptableObject.DONTENUM); - ((ScriptableObject)thisObj).defineProperty("$SCRIPTPATH",scriptFile.getParentFile().getAbsolutePath(),ScriptableObject.DONTENUM); + ((ScriptableObject)thisObj).defineProperty("$SCRIPT_DIR",scriptFile.getParentFile().getAbsolutePath(),ScriptableObject.DONTENUM); try { // Here we evalute the entire contents of the file as @@ -244,6 +244,13 @@ public class CommandScript extends CommandBase { int b = new Double(args[3].toString()).intValue(); int m = new Double(args[4].toString()).intValue(); putBlockImpl(x,y,z,b,m); + switch (b){ + case 6: + EntityPlayer player = (EntityPlayer)CommandScript.sender; + World world = player.worldObj; + ((BlockSapling)Block.sapling).growTree(world,x,y,z,world.rand); + break; + } } public static void putSign(Context cx, Scriptable thisObj,Object[] args, Function funObj){ List jsArray = (List)args[0];