From 55f1f9c9b5c232411e66c52eb4b25807961e7099 Mon Sep 17 00:00:00 2001 From: carlrobert Date: Sat, 14 Feb 2015 10:41:42 +0100 Subject: [PATCH] Flying adapted to CanaryMod CanaryMod requires a bit more code, I'm afraid. --- src/docs/templates/ypgpm.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/docs/templates/ypgpm.md b/src/docs/templates/ypgpm.md index 71ba98e..18c4d8b 100644 --- a/src/docs/templates/ypgpm.md +++ b/src/docs/templates/ypgpm.md @@ -623,29 +623,31 @@ things... compare the ages of your friends or siblings to your own age. ## More fun with `true` or `false` -TODO: This needs to be changed for CanaryMod -You can find out if you can Fly in minecraft by typing the following statement... +You can find out if you can Fly in minecraft by typing the following statement ... - /js self.allowFlight + /js self.getCapabilities().mayFly() ... the result will be `true` or `false` depending on whether you can fly or not. You can turn on and off your ability to fly by setting -your `allowFlight` property to `true` or `false`. Try it... +your `mayFly` property to `true` or `false`. Try it ... - /js self.allowFlight = true + /js self.getCapabilities().setMayFly(true) + /js self.updateCapabilities() -... Now you can fly! To turn off flight... +... Now you can fly! To turn off flight ... - /js self.allowFlight = false + /js self.getCapabilities().setMayFly(false) + /js self.setFlying(false) + /js self.updateCapabilities() ... and you come crashing down to earth. This is just one example of -how `true` and `false` are used throughout ScriptCraft - these are -called `boolean` values - named after [George Boole][boole], a 19th Century +how `true` and `false` are used throughout ScriptCraft – these are +called `boolean` values – named after [George Boole][boole], a 19th Century Maths Professor at University College Cork. There are plenty more examples of boolean values in Minecraft. You can find out if monsters are allowed in your minecraft world by typing the following -statement... +statement ... /js self.location.world.allowMonsters