Skip to content

Commit

Permalink
Add player oxygen tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 22, 2013
1 parent 48ffcf4 commit c4ef6ef
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -872,6 +872,26 @@ else if (getPlayerEntity().getFoodLevel() / maxHunger < 1)
return new Element(getPlayerEntity().getFoodLevel())
.getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <p@player.oxygen.max>
// @returns Element(number)
// @description
// returns how much air the player can have.
// -->
if (attribute.startsWith("oxygen.max"))
return new Element(getPlayerEntity().getMaximumAir())
.getAttribute(attribute.fulfill(2));

// <--[tag]
// @attribute <p@player.oxygen>
// @returns Element(number)
// @description
// returns how much air the player has.
// -->
if (attribute.startsWith("oxygen"))
return new Element(getPlayerEntity().getRemainingAir())
.getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <p@player.gamemode.id>
// @returns Element(number)
Expand Down

0 comments on commit c4ef6ef

Please sign in to comment.