Skip to content

Commit

Permalink
add LocationTag.towny_type, fixes #311
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 12, 2020
1 parent 988272b commit 0c0ac26
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -91,6 +91,22 @@ public String getAttribute(Attribute attribute) {
}
}

// <--[tag]
// @attribute <LocationTag.towny_type>
// @returns ElementTag
// @plugin Depenizen, Towny
// @description
// Returns the type of the Towny area this location is in.
// Can be RESIDENTIAL, COMMERCIAL, ARENA, EMBASSY, WILDS, SPLEEF, INN, JAIL, FARM, or BANK.
// -->
if (attribute.startsWith("towny_type")) {
TownBlock block = TownyUniverse.getTownBlock(location);
if (block != null) {
return new ElementTag(block.getType().name()).getAttribute(attribute.fulfill(1));
}
return null;
}

// <--[tag]
// @attribute <LocationTag.has_town>
// @returns ElementTag(Boolean)
Expand Down

0 comments on commit 0c0ac26

Please sign in to comment.