From 683ee4e7c1dc1b4566806bfc62c7a9f9ab53ad2d Mon Sep 17 00:00:00 2001 From: Jeremy Schroeder Date: Sat, 24 Aug 2013 22:21:20 -0400 Subject: [PATCH] Fix dScript and dWorld meta. --- .../aufdemrand/denizen/objects/dScript.java | 24 ++++--- .../aufdemrand/denizen/objects/dWorld.java | 66 ++++++++++++------- 2 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/main/java/net/aufdemrand/denizen/objects/dScript.java b/src/main/java/net/aufdemrand/denizen/objects/dScript.java index 12e915c000..3c35a564cf 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dScript.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dScript.java @@ -135,16 +135,20 @@ public dObject setPrefix(String prefix) { public String getAttribute(Attribute attribute) { if (attribute == null) return "null"; - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // Returns the container type of a dScript. // --> if (attribute.startsWith("container_type")) return new Element(container.getType()) .getAttribute(attribute.fulfill(1)); - // <-- - // ]> -> Element(Boolean) + // <--[tag] + // @attribute ]> + // @returns Element(Boolean) + // @descripion // Returns true if the script has been cooled down for the // player (defaults to current). Otherwise, returns false. // --> @@ -155,8 +159,10 @@ public String getAttribute(Attribute attribute) { .getAttribute(attribute.fulfill(1)); } - // <-- - // ].check[]> -> Element + // <--[tag] + // @attribute ].check[]> + // @returns Element + // @description // Returns true if the player specified (defaults to current) has the // requirement. Otherwise, returns false. // --> @@ -170,8 +176,10 @@ public String getAttribute(Attribute attribute) { .getAttribute(attribute.fulfill(2)); } - // <-- - // ]> -> Duration + // <--[tag] + // @attribute ]> + // @returns Duration + // @description // Returns the time left for the player to cooldown for the script. // --> if (attribute.startsWith("cooldown")) { diff --git a/src/main/java/net/aufdemrand/denizen/objects/dWorld.java b/src/main/java/net/aufdemrand/denizen/objects/dWorld.java index 26f8b296fd..e66e28ff41 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dWorld.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dWorld.java @@ -128,8 +128,10 @@ public String getAttribute(Attribute attribute) { if (attribute == null) return null; - // <-- - // -> Element(boolean) + // <--[tag] + // @attribute + // @returns Element(boolean) + // @description // returns whether the world will generate structures. // --> if (attribute.startsWith("can_generate_structures")) @@ -151,8 +153,10 @@ public String getAttribute(Attribute attribute) { // getWorld().getAnimalSpawnLimit()) // .getAttribute(attribute.fulfill(1)); - // <-- - // -> dLocation + // <--[tag] + // @attribute + // @returns dLocation + // @description // returns the location of the highest non-air block. // --> if (attribute.startsWith("highest_block")) { @@ -166,24 +170,30 @@ public String getAttribute(Attribute attribute) { // getWorld().getChunkAt() - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // returns the name of the difficulty level // --> if (attribute.startsWith("difficulty")) return new Element(getWorld().getDifficulty().name()) .getAttribute(attribute.fulfill(1)); - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // returns the name of the world // --> if (attribute.startsWith("name")) return new Element(String.valueOf(getWorld().getName())) .getAttribute(attribute.fulfill(1)); - // <-- - // -> dList(dPlayer) + // <--[tag] + // @attribute + // @returns dList(dPlayer) + // @description // returns a list of online players // --> if (attribute.startsWith("players")) { @@ -195,16 +205,20 @@ public String getAttribute(Attribute attribute) { .getAttribute(attribute.fulfill(1)); } - // <-- - // -> Element(number) + // <--[tag] + // @attribute + // @returns Element(number) + // @description // returns the level of the sea // --> if (attribute.startsWith("sea_level")) return new Element(String.valueOf(getWorld().getSeaLevel())) .getAttribute(attribute.fulfill(1)); - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // returns the world seed // --> if (attribute.startsWith("seed")) @@ -221,8 +235,10 @@ public String getAttribute(Attribute attribute) { // .getAttribute(attribute.fulfill(1)); // Return "day", "night", "dawn" or "dusk" - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // returns the time as day, night, dawn, or dusk // --> if (attribute.startsWith("time.period")) { @@ -238,24 +254,30 @@ public String getAttribute(Attribute attribute) { return new Element(period).getAttribute(attribute.fulfill(2)); } - // <-- - // -> Element(number) + // <--[tag] + // @attribute + // @returns Element(number) + // @description // returns the current time in ticks // --> if (attribute.startsWith("time")) return new Element(String.valueOf(getWorld().getTime())) .getAttribute(attribute.fulfill(1)); - // <-- - // -> Element + // <--[tag] + // @attribute + // @returns Element + // @description // returns the duration of storms in ticks // --> if (attribute.startsWith("weather_duration")) return Duration.valueOf(String.valueOf(getWorld().getWeatherDuration()) + "t") .getAttribute(attribute.fulfill(1)); - // <-- - // -> Element(boolean) + // <--[tag] + // @attribute + // @returns Element(boolean) + // @description // returns whether there is currently a storm in this world // --> if (attribute.startsWith("has_storm"))