From 945d951ef37969e69894e999032d205f08da4cd0 Mon Sep 17 00:00:00 2001 From: Vincent Bolta Date: Mon, 1 Feb 2021 16:41:43 +0100 Subject: [PATCH] Update to latest version of Towny. --- .../pluginlibrary/autorank/hooks/TownyAdvancedHook.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/me/staartvin/utils/pluginlibrary/autorank/hooks/TownyAdvancedHook.java b/src/me/staartvin/utils/pluginlibrary/autorank/hooks/TownyAdvancedHook.java index 428405e..c94f2be 100644 --- a/src/me/staartvin/utils/pluginlibrary/autorank/hooks/TownyAdvancedHook.java +++ b/src/me/staartvin/utils/pluginlibrary/autorank/hooks/TownyAdvancedHook.java @@ -84,6 +84,8 @@ public boolean isKing(String playerName) { if (resident == null) return false; + if (!resident.hasNation()) return false; + return resident.isKing(); } @@ -98,6 +100,8 @@ public boolean isMayor(String playerName) { if (resident == null) return false; + if (!resident.hasTown()) return false; + return resident.isMayor(); } @@ -126,6 +130,8 @@ public int getNumberOfTownBlocks(String playerName) { if (resident == null) return 0; + if (!resident.hasTown()) return 0; + return resident.getTownBlocks().size(); }