diff --git a/src/main/java/net/aufdemrand/denizen/arguments/aH.java b/src/main/java/net/aufdemrand/denizen/arguments/aH.java index 3bcde8f29a..28f9a5ad6c 100644 --- a/src/main/java/net/aufdemrand/denizen/arguments/aH.java +++ b/src/main/java/net/aufdemrand/denizen/arguments/aH.java @@ -33,34 +33,6 @@ */ public class aH { - /** - * To be used with the dBuggers' .report to provide debug output for - * objects. - * - * @param prefix name/type/simple description of the object being reported - * @param value object being reported will report the value of toString() - * - * @return color coded debug report - */ - public static String debugObj(String prefix, Object value) { - return "" + prefix + "='" + value.toString() + "' "; - } - - /** - * To be used with the dBuggers' .report to provide debug output for - * objects that may have some kind of id or type also associated with - * the object. - * - * @param prefix name/type/simple description of the object being reported - * @param id additional id/type of the object - * @param value object being reported will report the value of toString() - * - * @return color coded debug report - */ - public static String debugUniqueObj(String prefix, String id, Object value) { - return "" + prefix + "='" + id + "(" + value.toString() + ")' "; - } - public enum PrimitiveType { Float, Double, Integer, Boolean, String, Word} final static Pattern floatPrimitive = Pattern.compile("^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$"); @@ -164,7 +136,6 @@ public T asType(Class cla return null; } - } @@ -200,6 +171,35 @@ public static List interpret(List args) { // OLD SKOOL METHODS + /** + * To be used with the dBuggers' .report to provide debug output for + * objects. + * + * @param prefix name/type/simple description of the object being reported + * @param value object being reported will report the value of toString() + * + * @return color coded debug report + */ + public static String debugObj(String prefix, Object value) { + return "" + prefix + "='" + value.toString() + "' "; + } + + /** + * To be used with the dBuggers' .report to provide debug output for + * objects that may have some kind of id or type also associated with + * the object. + * + * @param prefix name/type/simple description of the object being reported + * @param id additional id/type of the object + * @param value object being reported will report the value of toString() + * + * @return color coded debug report + */ + public static String debugUniqueObj(String prefix, String id, Object value) { + return "" + prefix + "='" + id + "(" + value.toString() + ")' "; + } + + public enum ArgumentType { LivingEntity, Item, diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/ScriptCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/ScriptCommand.java new file mode 100644 index 0000000000..09020593b7 --- /dev/null +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/ScriptCommand.java @@ -0,0 +1,14 @@ +package net.aufdemrand.denizen.scripts.commands; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ScriptCommand { + + String value(); + +} diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/AnchorCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/AnchorCommand.java index bf74a26e99..ab71c49a0b 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/AnchorCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/AnchorCommand.java @@ -25,6 +25,22 @@ */ public class AnchorCommand extends AbstractCommand { + public String getHelp() { + return "Controls NPCs' anchors. Anchors are 'bookmarked locations'" + + "stored at the NPC-level. Valid actions are Add, Remove, " + + "Assume Walk_To, and Walk_Near. \n" + + " \n" + + "Use to add or remove an anchor from a NPC. \n" + + "- anchor add id:pride_rock location: \n" + + "- anchor remove id:the_jungle \n" + + "Use to 'teleport' the npc directly to an existing anchor. \n" + + "- anchor assume id:bedroom \n" + + "Use to make a NPC navigate to or near an anchor for easy" + + "'waypoint behavior'. \n" + + "- anchor walkto id:anchor_1 \n" + + "- anchor walknear id:front_porch range:5"; + } + private enum Action { ADD, REMOVE, ASSUME, WALKTO, WALKNEAR } @Override @@ -98,8 +114,8 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { return; case WALKNEAR: - npc.getNavigator().setTarget(Utilities - .getWalkableLocationNear(npc.getCitizen().getTrait(Anchors.class) + npc.getNavigator().setTarget( + Utilities.getWalkableLocationNear(npc.getCitizen().getTrait(Anchors.class) .getAnchor(id.asString()).getLocation(), range.asInt())); return;