mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-02-10 00:41:35 +01:00
Add RoseStacker compatibility
This commit is contained in:
parent
458d9ed2a8
commit
b96996d644
@ -75,6 +75,11 @@
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>rosewood-repo</id>
|
||||
<url>https://repo.rosewooddev.io/repository/public/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
@ -150,6 +155,13 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.rosewood</groupId>
|
||||
<artifactId>rosestacker</artifactId>
|
||||
<version>1.5.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.DeadSilenceIV</groupId>
|
||||
<artifactId>AdvancedChestsAPI</artifactId>
|
||||
|
@ -13,6 +13,8 @@ import com.craftaro.epichoppers.settings.Settings;
|
||||
import com.craftaro.epichoppers.utils.Methods;
|
||||
import com.craftaro.epichoppers.utils.StorageContainerCache;
|
||||
import com.craftaro.ultimatestacker.api.UltimateStackerApi;
|
||||
import dev.rosewood.rosestacker.api.RoseStackerAPI;
|
||||
import dev.rosewood.rosestacker.stack.StackedItem;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -37,6 +39,7 @@ public class ModuleSuction extends Module {
|
||||
|
||||
private static final boolean WILD_STACKER = Bukkit.getPluginManager().isPluginEnabled("WildStacker");
|
||||
private static final boolean ULTIMATE_STACKER = Bukkit.getPluginManager().isPluginEnabled("UltimateStacker");
|
||||
private static final boolean ROSE_STACKER = Bukkit.getPluginManager().isPluginEnabled("RoseStacker");
|
||||
|
||||
private final int maxSearchRadius;
|
||||
|
||||
@ -161,10 +164,13 @@ public class ModuleSuction extends Module {
|
||||
return UltimateStackerApi.getStackedItemManager().getActualItemAmount(item);
|
||||
} else if (WILD_STACKER) {
|
||||
return WildStackerAPI.getItemAmount(item);
|
||||
} else {
|
||||
return item.getItemStack().getAmount();
|
||||
} else if(ROSE_STACKER) {
|
||||
StackedItem stackedItem = RoseStackerAPI.getInstance().getStackedItem(item);
|
||||
if (stackedItem != null) {
|
||||
return stackedItem.getStackSize();
|
||||
}
|
||||
}
|
||||
|
||||
return item.getItemStack().getAmount();
|
||||
}
|
||||
|
||||
private void updateAmount(Item item, int amount) {
|
||||
|
Loading…
Reference in New Issue
Block a user