Updated fabledskyblock dependency and fixed an issue with stackable blocks.

This commit is contained in:
Brianna 2020-03-19 19:52:35 -04:00
parent fab8fc5a2c
commit 13edb5ad40
2 changed files with 13 additions and 5 deletions

View File

@ -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>

View File

@ -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);