Merge pull request #115 from Baterka/develop

Fixed https://github.com/BentoBoxWorld/Limits/issues/114
This commit is contained in:
tastybento 2020-11-26 17:05:58 -08:00 committed by GitHub
commit 368443a413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -443,6 +443,14 @@ public class EntityLimitListener implements Listener {
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)