Skip to content

Commit

Permalink
Add <player.equipment> tags back in.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Jul 3, 2013
1 parent d30fdf3 commit 1d2ef9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -290,6 +290,22 @@ else if (attribute.startsWith("list.offline")) {
return new Element(String.valueOf(getPlayerEntity().getExp() * 100))
.getAttribute(attribute.fulfill(1));

if (attribute.startsWith("equipment.boots"))
return new dItem(getPlayerEntity().getInventory().getBoots())
.getAttribute(attribute.fulfill(1));

if (attribute.startsWith("equipment.chestplate"))
return new dItem(getPlayerEntity().getInventory().getChestplate())
.getAttribute(attribute.fulfill(1));

if (attribute.startsWith("equipment.helmet"))
return new dItem(getPlayerEntity().getInventory().getHelmet())
.getAttribute(attribute.fulfill(1));

if (attribute.startsWith("equipment.leggings"))
return new dItem(getPlayerEntity().getInventory().getLeggings())
.getAttribute(attribute.fulfill(1));

if (attribute.startsWith("equipment"))
// The only way to return correct size for dInventory
// created from equipment is to use a CRAFTING type
Expand Down
Expand Up @@ -61,13 +61,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
if (aH.matchesScript(arg)) {
script = aH.getScriptFrom(arg);

} else if (aH.matchesDuration(arg)) {
duration = aH.getDurationFrom(arg);

} else if (aH.matchesValueArg("STEP", arg, aH.ArgumentType.String)
|| aH.matchesInteger(arg)) {
step = aH.getStringFrom(arg);
dB.echoDebug(Messages.DEBUG_SET_STEP, step);

} else if (aH.matchesDuration(arg)) {
duration = aH.getDurationFrom(arg);

} else throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT, arg);
}
Expand Down

0 comments on commit 1d2ef9e

Please sign in to comment.