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>
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>abledskyblock</artifactId> <artifactId>skyblock</artifactId>
<version>79.1</version> <version>2.1.2</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<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.HopperDirection;
import com.songoda.epichoppers.utils.Methods; import com.songoda.epichoppers.utils.Methods;
import com.songoda.epichoppers.utils.StorageContainerCache; import com.songoda.epichoppers.utils.StorageContainerCache;
import com.songoda.skyblock.utils.version.Materials;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -174,8 +176,14 @@ public class HopTask extends BukkitRunnable {
} else { } else {
com.songoda.skyblock.stackable.StackableManager stackableManager = ((com.songoda.skyblock.SkyBlock) fabledSkyblockPlugin).getStackableManager(); com.songoda.skyblock.stackable.StackableManager stackableManager = ((com.songoda.skyblock.SkyBlock) fabledSkyblockPlugin).getStackableManager();
if (stackableManager != null && stackableManager.isStacked(pointingLocation)) { if (stackableManager != null && stackableManager.isStacked(pointingLocation)) {
Material mat = pointingLocation.getBlock().getType(); Block pointingBlock = pointingLocation.getBlock();
com.songoda.skyblock.stackable.Stackable stackable = stackableManager.getStack(pointingLocation, mat);
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++) { for (int i = 0; i < 5; i++) {
final ItemStack item = hopperCache.cachedInventory[i]; final ItemStack item = hopperCache.cachedInventory[i];
@ -183,7 +191,7 @@ public class HopTask extends BukkitRunnable {
continue; continue;
} }
if (item.getType() == mat) { if (Materials.getMaterials(item.getType(), (byte) item.getDurability()) == materials) {
stackable.addOne(); stackable.addOne();
if (item.getAmount() == 1) { if (item.getAmount() == 1) {
hopperCache.removeItem(i); hopperCache.removeItem(i);