mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-11-22 10:36:11 +01:00
Adds setting option for async golum checking
https://github.com/BentoBoxWorld/Limits/issues/127
This commit is contained in:
parent
0ae58db8a9
commit
6a2768e572
@ -19,6 +19,7 @@ public class Settings {
|
||||
private final Map<EntityType, Integer> limits = new EnumMap<>(EntityType.class);
|
||||
private final Map<EntityType, List<EntityGroup>> groupLimits = new EnumMap<>(EntityType.class);
|
||||
private final List<String> gameModes;
|
||||
private final boolean asyncGolums;
|
||||
private static final List<EntityType> DISALLOWED = Arrays.asList(
|
||||
EntityType.PRIMED_TNT,
|
||||
EntityType.EVOKER_FANGS,
|
||||
@ -65,6 +66,9 @@ public class Settings {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Async Golums
|
||||
asyncGolums = addon.getConfig().getBoolean("async-golums", true);
|
||||
|
||||
addon.log("Entity limits:");
|
||||
limits.entrySet().stream().map(e -> "Limit " + e.getKey().toString() + " to " + e.getValue()).forEach(addon::log);
|
||||
|
||||
@ -193,4 +197,11 @@ public class Settings {
|
||||
return "EntityGroup{" + "name=" + name + ", types=" + types + ", limit=" + limit + '}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the asyncGolums
|
||||
*/
|
||||
public boolean isAsyncGolums() {
|
||||
return asyncGolums;
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public class EntityLimitListener implements Listener {
|
||||
switch (e.getSpawnReason()) {
|
||||
case BUILD_SNOWMAN:
|
||||
case BUILD_IRONGOLEM:
|
||||
checkLimit(e, e.getEntity(), e.getSpawnReason(), bypass, true);
|
||||
checkLimit(e, e.getEntity(), e.getSpawnReason(), bypass, addon.getSettings().isAsyncGolums());
|
||||
default:
|
||||
// Check limit sync
|
||||
checkLimit(e, e.getEntity(), e.getSpawnReason(), bypass, false);
|
||||
|
@ -13,6 +13,9 @@ gamemodes:
|
||||
# Cooldown for player recount command in seconds
|
||||
cooldown: 120
|
||||
|
||||
# Use async checks for snowmen and iron golums. Set to false if you see problems.
|
||||
async-golums: true
|
||||
|
||||
# General block limiting
|
||||
# Use this section to limit how many blocks can be added to an island.
|
||||
# 0 means the item will be blocked from placement completely.
|
||||
|
Loading…
Reference in New Issue
Block a user