Skip to content

Commit

Permalink
Clears permission limits when owner joins
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
tastybento committed Jan 11, 2020
1 parent 8fa551f commit ea76a6d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public JoinListener(Limits addon) {

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
Expand Down Expand Up @@ -87,6 +91,8 @@ private void checkPerms(Player player, String permissionPrefix, String islandId,
}
}
}
// 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);
}
Expand Down

0 comments on commit ea76a6d

Please sign in to comment.