Skip to content

Commit

Permalink
Update to new Towny API setup, fixes #310
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 13, 2020
1 parent 94ed65c commit 24a97eb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file modified lib/Towny.jar
Binary file not shown.
Expand Up @@ -153,7 +153,7 @@ public String getAttribute(Attribute attribute) {
// -->
if (attribute.startsWith("balance")) {
try {
return new ElementTag(nation.getHoldingBalance()).getAttribute(attribute.fulfill(1));
return new ElementTag(nation.getAccount().getHoldingBalance()).getAttribute(attribute.fulfill(1));
}
catch (EconomyException e) {
if (!attribute.hasAlternative()) {
Expand Down
Expand Up @@ -188,7 +188,7 @@ public String getAttribute(Attribute attribute) {
// -->
else if (attribute.startsWith("balance")) {
try {
return new ElementTag(town.getHoldingBalance()).getAttribute(attribute.fulfill(1));
return new ElementTag(town.getAccount().getHoldingBalance()).getAttribute(attribute.fulfill(1));
}
catch (EconomyException e) {
if (!attribute.hasAlternative()) {
Expand Down
Expand Up @@ -81,7 +81,7 @@ public String getAttribute(Attribute attribute) {
}

// <--[tag]
// @attribute <PlayerTag.townychat.muted_in[<channel name>]>
// @attribute <PlayerTag.townychat.muted_in[<channel_name>]>
// @returns ElementTag(Boolean)
// @plugin Depenizen, Towny
// @description
Expand All @@ -96,7 +96,7 @@ else if (attribute.startsWith("muted_in") && attribute.hasContext(1)) {
}

// <--[tag]
// @attribute <PlayerTag.townychat.has_permission[<channel name>]>
// @attribute <PlayerTag.townychat.has_permission[<channel_name>]>
// @returns ElementTag(Boolean)
// @plugin Depenizen, Towny
// @description
Expand All @@ -108,7 +108,7 @@ else if (attribute.startsWith("has_permission") && attribute.hasContext(1)) {
return null;
}
String perm = c.getPermission();
if (perm == null || !plugin.getTowny().isPermissions()) {
if (perm == null) {
return new ElementTag(true).getAttribute(attribute.fulfill(1));
}
return new ElementTag(TownyUniverse.getPermissionSource().has(player.getPlayerEntity(), perm))
Expand Down

0 comments on commit 24a97eb

Please sign in to comment.