mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-22 18:25:59 +01:00
Updated fabledskyblock dependency and fixed an issue with stackable blocks.
This commit is contained in:
parent
fab8fc5a2c
commit
13edb5ad40
4
pom.xml
4
pom.xml
@ -117,8 +117,8 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>abledskyblock</artifactId>
|
||||
<version>79.1</version>
|
||||
<artifactId>skyblock</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -9,6 +9,8 @@ import com.songoda.epichoppers.settings.Settings;
|
||||
import com.songoda.epichoppers.utils.HopperDirection;
|
||||
import com.songoda.epichoppers.utils.Methods;
|
||||
import com.songoda.epichoppers.utils.StorageContainerCache;
|
||||
import com.songoda.skyblock.utils.version.Materials;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -174,8 +176,14 @@ public class HopTask extends BukkitRunnable {
|
||||
} else {
|
||||
com.songoda.skyblock.stackable.StackableManager stackableManager = ((com.songoda.skyblock.SkyBlock) fabledSkyblockPlugin).getStackableManager();
|
||||
if (stackableManager != null && stackableManager.isStacked(pointingLocation)) {
|
||||
Material mat = pointingLocation.getBlock().getType();
|
||||
com.songoda.skyblock.stackable.Stackable stackable = stackableManager.getStack(pointingLocation, mat);
|
||||
Block pointingBlock = pointingLocation.getBlock();
|
||||
|
||||
Material mat = pointingBlock.getType();
|
||||
byte data = pointingBlock.getData();
|
||||
|
||||
Materials materials = Materials.getMaterials(mat, data);
|
||||
|
||||
com.songoda.skyblock.stackable.Stackable stackable = stackableManager.getStack(pointingLocation, materials);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
final ItemStack item = hopperCache.cachedInventory[i];
|
||||
@ -183,7 +191,7 @@ public class HopTask extends BukkitRunnable {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.getType() == mat) {
|
||||
if (Materials.getMaterials(item.getType(), (byte) item.getDurability()) == materials) {
|
||||
stackable.addOne();
|
||||
if (item.getAmount() == 1) {
|
||||
hopperCache.removeItem(i);
|
||||
|
Loading…
Reference in New Issue
Block a user