mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2025-02-20 06:12:31 +01:00
Fixes bug where permission limits were given to everyone
Fixes https://github.com/BentoBoxWorld/Limits/issues/79
This commit is contained in:
parent
100f5ea026
commit
b58859ae3f
@ -1,6 +1,7 @@
|
||||
package world.bentobox.limits;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -70,7 +71,7 @@ public class Settings {
|
||||
* @return the limits
|
||||
*/
|
||||
public Map<EntityType, Integer> getLimits() {
|
||||
return limits;
|
||||
return Collections.unmodifiableMap(limits);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package world.bentobox.limits.commands;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
@ -105,7 +106,7 @@ public class LimitPanel {
|
||||
pb.item(pib.build());
|
||||
}
|
||||
// Entity limits
|
||||
Map<EntityType, Integer> map = addon.getSettings().getLimits();
|
||||
Map<EntityType, Integer> map = new HashMap<>(addon.getSettings().getLimits());
|
||||
// Merge in any permission-based limits
|
||||
if (ibc != null) ibc.getEntityLimits().forEach(map::put);
|
||||
map.forEach((k,v) -> {
|
||||
|
@ -1,6 +1,11 @@
|
||||
package world.bentobox.limits.commands;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user