mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-26 12:16:18 +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>
|
||||||
<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>
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user