mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-09-13 00:18:12 +02:00
fix efa integration with farm blocks that have an inventory, also do not pull bonemeal out of them
This commit is contained in:
parent
0960475479
commit
5347d28cf0
@ -261,11 +261,11 @@ public class HopTask extends BukkitRunnable {
|
||||
boolean isFarmItem = false;
|
||||
Collection<Entity> nearbyEntities = null;
|
||||
StorageContainerCache.Cache aboveCache = null;
|
||||
if ((above.getType() != Material.AIR
|
||||
&& (above.getType() != Material.HOPPER || HopperDirection.getDirection(above.getState().getRawData()) != HopperDirection.DOWN)
|
||||
&& (aboveCache = StorageContainerCache.getCachedInventory(above)) != null)
|
||||
|| !(nearbyEntities = above.getWorld().getNearbyEntities(above.getLocation().clone(), 0.5, 0.5, 0.5)).isEmpty()
|
||||
|| (isFarmItem = this.isFarmItem(above))) {
|
||||
if ((isFarmItem = this.isFarmItem(above))
|
||||
|| (above.getType() != Material.AIR)
|
||||
&& (above.getType() != Material.HOPPER || HopperDirection.getDirection(above.getState().getRawData()) != HopperDirection.DOWN)
|
||||
&& (aboveCache = StorageContainerCache.getCachedInventory(above)) != null
|
||||
|| !(nearbyEntities = above.getWorld().getNearbyEntities(above.getLocation().clone(), 0.5, 0.5, 0.5)).isEmpty()) {
|
||||
// Get the inventory holder. Special check for EpicFarming.
|
||||
// Get the slots that we can pull items from.
|
||||
InventoryHolder aboveInvHolder;
|
||||
@ -567,7 +567,6 @@ public class HopTask extends BukkitRunnable {
|
||||
|
||||
private ItemStack[] getFarmContents(Block block) {
|
||||
return com.songoda.epicfarming.EpicFarming.getInstance().getFarmManager()
|
||||
.getFarm(block).getItems().toArray(new ItemStack[0]);
|
||||
.getFarm(block).getItems().stream().filter(i -> i.getType() != Material.BONE_MEAL).collect(Collectors.toList()).toArray(new ItemStack[0]);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user