diff --git a/Core/src/main/java/com/songoda/core/hooks/EntityStackerManager.java b/Core/src/main/java/com/songoda/core/hooks/EntityStackerManager.java index ea52df65..feac60bf 100644 --- a/Core/src/main/java/com/songoda/core/hooks/EntityStackerManager.java +++ b/Core/src/main/java/com/songoda/core/hooks/EntityStackerManager.java @@ -1,6 +1,7 @@ package com.songoda.core.hooks; import com.songoda.core.hooks.stackers.Stacker; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; /** @@ -67,4 +68,8 @@ public class EntityStackerManager { if (manager.isEnabled()) manager.getCurrentHook().add(entity, amount); } + + public static int getMinStackSize(EntityType type) { + return manager.isEnabled() ? manager.getCurrentHook().getMinStackSize(type) : 1; + } } diff --git a/Core/src/main/java/com/songoda/core/hooks/stackers/StackMob.java b/Core/src/main/java/com/songoda/core/hooks/stackers/StackMob.java index 19897f41..9e09ad1f 100644 --- a/Core/src/main/java/com/songoda/core/hooks/stackers/StackMob.java +++ b/Core/src/main/java/com/songoda/core/hooks/stackers/StackMob.java @@ -75,7 +75,7 @@ public class StackMob extends Stacker { } @Override - public int minimumEntityStack(EntityType type) { + public int getMinStackSize(EntityType type) { return 0; } diff --git a/Core/src/main/java/com/songoda/core/hooks/stackers/Stacker.java b/Core/src/main/java/com/songoda/core/hooks/stackers/Stacker.java index b00bed03..e772eb34 100644 --- a/Core/src/main/java/com/songoda/core/hooks/stackers/Stacker.java +++ b/Core/src/main/java/com/songoda/core/hooks/stackers/Stacker.java @@ -31,6 +31,6 @@ public abstract class Stacker implements Hook { public abstract void add(LivingEntity entity, int amount); - public abstract int minimumEntityStack(EntityType type); + public abstract int getMinStackSize(EntityType type); } diff --git a/Core/src/main/java/com/songoda/core/hooks/stackers/UltimateStacker.java b/Core/src/main/java/com/songoda/core/hooks/stackers/UltimateStacker.java index 86859f7c..29d8e7f8 100644 --- a/Core/src/main/java/com/songoda/core/hooks/stackers/UltimateStacker.java +++ b/Core/src/main/java/com/songoda/core/hooks/stackers/UltimateStacker.java @@ -1,6 +1,7 @@ package com.songoda.core.hooks.stackers; import com.songoda.ultimatestacker.stackable.entity.EntityStack; +import com.songoda.ultimatestacker.stackable.entity.EntityStackManager; import com.songoda.ultimatestacker.utils.Methods; import org.bukkit.entity.EntityType; import org.bukkit.entity.Item; @@ -64,11 +65,11 @@ public class UltimateStacker extends Stacker { @Override public void add(LivingEntity entity, int amount) { - plugin.getEntityStackManager().getStack(entity).createDuplicates(amount); + plugin.getEntityStackManager().addStack(entity, amount); } @Override - public int minimumEntityStack(EntityType type) { + public int getMinStackSize(EntityType type) { return ((Plugin) plugin).getConfig().getInt("Entities.Min Stack Amount"); } } diff --git a/Core/src/main/java/com/songoda/core/hooks/stackers/WildStacker.java b/Core/src/main/java/com/songoda/core/hooks/stackers/WildStacker.java index 8be301cd..6fc388f1 100644 --- a/Core/src/main/java/com/songoda/core/hooks/stackers/WildStacker.java +++ b/Core/src/main/java/com/songoda/core/hooks/stackers/WildStacker.java @@ -68,7 +68,7 @@ public class WildStacker extends Stacker { } @Override - public int minimumEntityStack(EntityType type) { + public int getMinStackSize(EntityType type) { int min = plugin.getConfig().getInt("entities.minimum-limits." + type.name(), -1); if (min == -1) { min = plugin.getConfig().getInt("entities.minimum-limits.all", -1);