Clears permission limits when owner joins

Fixes https://github.com/BentoBoxWorld/Limits/issues/63
This commit is contained in:
tastybento 2020-01-11 09:49:15 -08:00
parent 8fa551ff7c
commit ea76a6deeb
1 changed files with 7 additions and 1 deletions

View File

@ -40,7 +40,11 @@ public class JoinListener implements Listener {
private void checkPerms(Player player, String permissionPrefix, String islandId, String gameMode) {
IslandBlockCount ibc = addon.getBlockLimitListener().getIsland(islandId);
if (ibc != null) {
// Clear permission limits
ibc.getEntityLimits().clear();
ibc.getBlockLimits().clear();
}
for (PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
if (!perms.getPermission().startsWith(permissionPrefix)) continue;
// No wildcards
@ -87,6 +91,8 @@ public class JoinListener implements Listener {
}
}
}
// Check removed permissions
// If any changes have been made then store it - don't make files unless they are needed
if (ibc != null) addon.getBlockLimitListener().setIsland(islandId, ibc);
}