mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-27 18:59:10 +00:00
Merge branch 'master' of https://gitlab.com/SamB440/rpgregions-2
This commit is contained in:
@@ -59,6 +59,15 @@ public class PlaceholderRegionHook extends PlaceholderExpansion {
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
case "discovered_percentage":
|
||||
// We have to do a blocking operation :(
|
||||
try {
|
||||
RPGRegionsAccount account = plugin.getManagers().getStorageManager().getAccount(player.getUniqueId()).get();
|
||||
int percent = (account.getDiscoveredRegions().size() / plugin.getManagers().getRegionsCache().getConfiguredRegions().size()) * 100;
|
||||
return String.valueOf(percent);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
case "region_total":
|
||||
return String.valueOf(plugin.getManagers().getRegionsCache().getConfiguredRegions().size());
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user