Min stack sizes of 1 will no longer create issues.

This commit is contained in:
Brianna O'Keefe 2019-01-24 12:14:28 -05:00
parent da2aafb40e
commit 83e2c49f0e
2 changed files with 15 additions and 1 deletions

12
.gitignore vendored
View File

@ -186,3 +186,15 @@ target/classes/SettingDefinitions\.yml
\.idea/libraries/Maven__uk_antiperson_stackmob_LATEST\.xml
\.idea/libraries/Maven__xyz_wildseries_wildstacker_b6\.xml
\.idea/libraries/Maven__com_gmail_filoghost_holographicdisplays_holographicdisplays_LATEST\.xml
target/classes/com/songoda/ultimatestacker/events/BreedListeners\.class
target/classes/com/songoda/ultimatestacker/events/EntityListeners\.class
target/classes/com/songoda/ultimatestacker/hologram/Hologram\.class
target/classes/com/songoda/ultimatestacker/hologram/HologramArconix\.class
target/classes/com/songoda/ultimatestacker/hologram/HologramHolographicDisplays\.class

View File

@ -140,7 +140,9 @@ public class StackingTask extends BukkitRunnable {
entityList.removeIf(stackManager::isStacked);
if (entityList.size() < minEntityStackAmount - 1 || minEntityStackAmount > maxEntityStackSize) continue;
if (entityList.size() < minEntityStackAmount - 1
|| minEntityStackAmount > maxEntityStackSize
|| minEntityStackAmount == 1 && entityList.size() == 0) continue;
//If stack was never found make a new one.
EntityStack stack = stackManager.addStack(new EntityStack(initalEntity, entityList.size() + 1));