From a6fba864c4a39d171778377410fc9cbaff3613cc Mon Sep 17 00:00:00 2001 From: mcmonkey4eva Date: Wed, 11 Mar 2015 13:47:23 -0700 Subject: [PATCH] Add tau, deprecate bad util tags --- .../denizen/tags/core/UtilTags.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/aufdemrand/denizen/tags/core/UtilTags.java b/src/main/java/net/aufdemrand/denizen/tags/core/UtilTags.java index 9e4487f287..a02aea4f42 100644 --- a/src/main/java/net/aufdemrand/denizen/tags/core/UtilTags.java +++ b/src/main/java/net/aufdemrand/denizen/tags/core/UtilTags.java @@ -964,11 +964,27 @@ else if (subType.equalsIgnoreCase("DUUID")) .getAttribute(attribute.fulfill(2))); } + // <--[tag] + // @attribute + // @returns Element + // @description + // Returns PI: 3.141592653589793 + // --> else if (type.equalsIgnoreCase("pi")) { event.setReplaced(new Element(Math.PI) .getAttribute(attribute.fulfill(1))); } + // <--[tag] + // @attribute + // @returns Element + // @description + // Returns Tau: 6.283185307179586 + // --> + else if (type.equalsIgnoreCase("tau")) { + event.setReplaced(new Element(Math.PI * 2) + .getAttribute(attribute.fulfill(1))); + } else if (type.equalsIgnoreCase("SUBSTR") || type.equalsIgnoreCase("TRIM") @@ -1018,12 +1034,7 @@ else if (type.equalsIgnoreCase("REPLACE")) { .getAttribute(attribute.fulfill(3))); } - // <--[tag] - // @attribute ]> - // @returns Element(Boolean) - // @description - // Returns whether an entity is spawned and valid. - // --> + // TODO: Deprecate in favor of server tag else if (type.equalsIgnoreCase("ENTITY_IS_SPAWNED") && typeContext.length() != 0) { dEntity ent = dEntity.valueOf(typeContext); @@ -1031,24 +1042,14 @@ else if (type.equalsIgnoreCase("ENTITY_IS_SPAWNED") .getAttribute(attribute.fulfill(1))); } - // <--[tag] - // @attribute ]> - // @returns Element(Boolean) - // @description - // Returns whether a player exists under the specified name. - // --> + // TODO: Deprecate in favor of server tag else if (type.equalsIgnoreCase("PLAYER_IS_VALID") && typeContext.length() != 0) { event.setReplaced(new Element(dPlayer.playerNameIsValid(typeContext)) .getAttribute(attribute.fulfill(1))); } - // <--[tag] - // @attribute ]> - // @returns Element(Boolean) - // @description - // Returns whether an NPC exists and is usable. - // --> + // TODO: Deprecate in favor of server tag else if (type.equalsIgnoreCase("NPC_IS_VALID") && typeContext.length() != 0) { dNPC npc = dNPC.valueOf(typeContext);