Skip to content

Commit

Permalink
Merge pull request #7039 from TownyAdvanced/refactor/simplify_town_co…
Browse files Browse the repository at this point in the history
…mmand

Refactor/simplify town command
  • Loading branch information
LlmDl authored Nov 5, 2023
2 parents 55ebf6d + 14ba33e commit df260e9
Show file tree
Hide file tree
Showing 5 changed files with 833 additions and 911 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.exceptions.NoPermissionException;
import com.palmergames.bukkit.towny.exceptions.ResidentNPCException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Nation;
import com.palmergames.bukkit.towny.object.Resident;
Expand Down Expand Up @@ -384,4 +385,9 @@ public static void checkPermOrThrow(Permissible permissible, String node) throws
public static void checkPermOrThrowWithMessage(Permissible permissible, String node, Translatable errormsg) throws NoPermissionException {
TownyUniverse.getInstance().getPermissionSource().testPermissionOrThrow(permissible, node, errormsg);
}

public static void catchNPCResident(Resident resident) throws ResidentNPCException {
if (resident.isNPC())
throw new ResidentNPCException();
}
}
Loading

0 comments on commit df260e9

Please sign in to comment.