Skip to content

Commit

Permalink
Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Jul 22, 2013
1 parent 1dd907b commit 0846e70
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -201,26 +201,40 @@ public String getAttribute(Attribute attribute) {

if (player_name == null) return "null";

// <player.entity> -> dEntity
// returns the dEntity object of the player
if (attribute.startsWith("entity"))
return new dEntity(getPlayerEntity())
.getAttribute(attribute.fulfill(1));


// <player.has_played_before> -> Element(boolean)
// returns true if the player has played before
if (attribute.startsWith("has_played_before"))
return new Element(String.valueOf(getOfflinePlayer().hasPlayedBefore()))
.getAttribute(attribute.fulfill(1));

// <player.is_op> -> Element(boolean)
// returns true if the player has 'op status'
if (attribute.startsWith("is_op"))
return new Element(String.valueOf(getOfflinePlayer().isOp()))
.getAttribute(attribute.fulfill(1));

// <player.first_played> -> Element(number)
// returns the 'System.currentTimeMillis()' of when the player
// first logged on. Will return '0' if player has never played.
if (attribute.startsWith("first_played"))
return new Element(String.valueOf(getOfflinePlayer().getFirstPlayed()))
.getAttribute(attribute.fulfill(1));

// <player.last_played> -> Element(number)
// returns the 'System.currentTimeMillis()' of when the player
// was last seen. Will return '0' if player has never played.
if (attribute.startsWith("last_played"))
return new Element(String.valueOf(getOfflinePlayer().getLastPlayed()))
.getAttribute(attribute.fulfill(1));

// <player.is_banned> -> Element(boolean)
// returns true if the player is banned
if (attribute.startsWith("is_banned"))
return new Element(String.valueOf(getOfflinePlayer().isBanned()))
.getAttribute(attribute.fulfill(1));
Expand Down
Expand Up @@ -263,7 +263,7 @@ public void registerCoreMembers() {
"SHOOT", "shoot [entities:<entity>|...] (origin:<player>/<npc>) (destination:<location>) (speed:<#.#>) (script:<name>)", 1);

registerCoreMember(ShowFakeCommand.class,
"SHOWFAKE", "showfake [<material>] [<location>|...] (duration:<duration>{10s})", 2);
"SHOWFAKE", "showfake [<material>] [<location>|...] (d:<duration>{10s})", 2);

registerCoreMember(SignCommand.class,
"SIGN", "sign (type:{sign_post}/wall_sign) [\"<line>|...\"] [<location>]", 1);
Expand Down

0 comments on commit 0846e70

Please sign in to comment.