mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-23 18:45:34 +01:00
Stacker plugin hook adjustment.
This commit is contained in:
parent
3902dface4
commit
07eb0d5710
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class StackMob extends Stacker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minimumEntityStack(EntityType type) {
|
||||
public int getMinStackSize(EntityType type) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user