From 80d3c8f7b925cbf13de4a1ea686dc93c8c2f72f9 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 6 Aug 2019 16:42:52 -0400 Subject: [PATCH] Version --- .gitlab-ci.yml | 2 +- .../java/com/songoda/ultimatestacker/utils/EntityUtils.java | 6 +++++- .../songoda/ultimatestacker/utils/settings/Category.java | 2 +- .../com/songoda/ultimatestacker/utils/settings/Setting.java | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3366d7f..84c58b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "UltimateStacker" path: "/builds/$CI_PROJECT_PATH" - version: "1.8.12" + version: "1.8.13" build: stage: build diff --git a/src/main/java/com/songoda/ultimatestacker/utils/EntityUtils.java b/src/main/java/com/songoda/ultimatestacker/utils/EntityUtils.java index c10b4f5..a33e11d 100644 --- a/src/main/java/com/songoda/ultimatestacker/utils/EntityUtils.java +++ b/src/main/java/com/songoda/ultimatestacker/utils/EntityUtils.java @@ -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 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); } } diff --git a/src/main/java/com/songoda/ultimatestacker/utils/settings/Category.java b/src/main/java/com/songoda/ultimatestacker/utils/settings/Category.java index e0ab761..0bdf9d4 100644 --- a/src/main/java/com/songoda/ultimatestacker/utils/settings/Category.java +++ b/src/main/java/com/songoda/ultimatestacker/utils/settings/Category.java @@ -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."); diff --git a/src/main/java/com/songoda/ultimatestacker/utils/settings/Setting.java b/src/main/java/com/songoda/ultimatestacker/utils/settings/Setting.java index ce02a76..85881b9 100644 --- a/src/main/java/com/songoda/ultimatestacker/utils/settings/Setting.java +++ b/src/main/java/com/songoda/ultimatestacker/utils/settings/Setting.java @@ -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?"),