Skip to content

Commit

Permalink
Fixed #114
Browse files Browse the repository at this point in the history
  • Loading branch information
Baterka committed Nov 24, 2020
1 parent fbf13bd commit 90b5a65
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,14 @@ AtLimitResult atLimit(Island island, Entity ent) {
return new AtLimitResult(ent.getType(), limitAmount);
}

// Merge in any permission-based limits
if (addon.getBlockLimitListener().getIsland(island.getUniqueId()) != null) {
Map<String, EntityGroup> groupbyname = groupsLimits.keySet().stream().collect(Collectors.toMap(e -> e.getName(), e -> e));
addon.getBlockLimitListener().getIsland(island.getUniqueId()).getEntityGroupLimits().entrySet().stream()
.filter(e -> groupbyname.containsKey(e.getKey()))
.forEach(e -> groupsLimits.put(groupbyname.get(e.getKey()), e.getValue()));
}

// Now do the group limits
for (Map.Entry<Settings.EntityGroup, Integer> group : groupsLimits.entrySet()) { //do not use lambda
if (group.getValue() < 0)
Expand Down

0 comments on commit 90b5a65

Please sign in to comment.