Made search radius adjustable.

This commit is contained in:
Brianna 2019-04-11 17:45:15 -04:00
parent a89230f3c1
commit 5793e4f768
2 changed files with 5 additions and 2 deletions

View File

@ -115,8 +115,10 @@ public class Methods {
public static List<Entity> getSimilarEntitesAroundEntity(Entity initalEntity) {
int searcRadius = SettingsManager.Settings.SEARCH_RADIUS.getInt();
//Create a list of all entities around the initial entity of the same type.
List<Entity> entityList = initalEntity.getNearbyEntities(5, 5, 5).stream()
List<Entity> entityList = initalEntity.getNearbyEntities(searcRadius, searcRadius, searcRadius).stream()
.filter(entity -> entity.getType() == initalEntity.getType() && entity != initalEntity)
.collect(Collectors.toList());

View File

@ -189,7 +189,8 @@ public class SettingsManager implements Listener {
o52("Entity.Kill Whole Stack On Special Death Cause", true),
SPECIAL_DEATH_CAUSE("Entity.Special Death Cause", Arrays.asList("FALL", "DROWNING", "LAVA", "VOID")),
NAME_FORMAT_ENTITY("Entity.Name Format", "&f{TYPE} &6{AMT}x"),
o6("Item.Max Stack Size", 120),
SEARCH_RADIUS("Entity.Search Radius", 5),
MAX_STACK_ITEMS("Item.Max Stack Size", 120),
NAME_FORMAT_ITEM("Item.Name Format", "&f{TYPE} &6{AMT}x"),
o7("Spawners.Holograms Enabled", true),
o8("Spawners.Max Stack Size", 5),