This commit is contained in:
Brianna 2019-08-06 16:42:52 -04:00
parent fb24a3abad
commit 80d3c8f7b9
4 changed files with 11 additions and 3 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "UltimateStacker"
path: "/builds/$CI_PROJECT_PATH"
version: "1.8.12"
version: "1.8.13"
build:
stage: build

View File

@ -18,6 +18,7 @@ public class EntityUtils {
private boolean stackFlyingDown = Setting.ONLY_STACK_FLYING_DOWN.getBoolean();
private boolean keepFire = Setting.KEEP_FIRE.getBoolean();
private boolean keepPotion = Setting.KEEP_POTION.getBoolean();
private boolean stackWholeChunk = Setting.STACK_WHOLE_CHUNK.getBoolean();
private int searchRadius = Setting.SEARCH_RADIUS.getInt();
private final Map<CachedChunk, Entity[]> cachedChunks = new HashMap<>();
@ -34,6 +35,9 @@ public class EntityUtils {
Chunk firstChunk = location.getChunk();
chunks.add(new CachedChunk(firstChunk));
if (stackWholeChunk) return chunks;
int minX = (int) Math.floor(((location.getX() - radius) - 2.0D) / 16.0D);
int maxX = (int) Math.floor(((location.getX() + radius) + 2.0D) / 16.0D);
int minZ = (int) Math.floor(((location.getZ() - radius) - 2.0D) / 16.0D);
@ -61,7 +65,7 @@ public class EntityUtils {
for (Entity e : entityArray) {
if (e.getWorld() != location.getWorld()
|| !(e instanceof LivingEntity)
|| location.distanceSquared(e.getLocation()) >= radius * radius) continue;
|| (!stackWholeChunk && location.distanceSquared(e.getLocation()) >= radius * radius)) continue;
entities.add((LivingEntity) e);
}
}

View File

@ -14,7 +14,7 @@ public enum Category {
SPAWNERS("Stacked Spawner Settings."),
DATABASE("Settings regarding the Database."),
MySQL("Settings regarding the Database."),
SYSTEM("System related settings.");

View File

@ -34,6 +34,10 @@ public enum Setting {
"The minimum amount required before a stack can be formed.",
"Do not set this to lower than 2."),
STACK_WHOLE_CHUNK("Entities.Stack Whole Chunk", false,
"Should all qualifying entities in each chunk be stacked?",
"This will override the stacking radius."),
ENTITY_HOLOGRAMS("Entities.Holograms Enabled", true,
"Should holograms be displayed above stacked entities?"),