diff --git a/src/main/java/com/buuz135/industrial/tile/agriculture/PlantInteractorTile.java b/src/main/java/com/buuz135/industrial/tile/agriculture/PlantInteractorTile.java index 301927868..455c89ecb 100644 --- a/src/main/java/com/buuz135/industrial/tile/agriculture/PlantInteractorTile.java +++ b/src/main/java/com/buuz135/industrial/tile/agriculture/PlantInteractorTile.java @@ -48,6 +48,9 @@ import net.ndrei.teslacorelib.inventory.BoundingRectangle; import net.ndrei.teslacorelib.inventory.FluidTankType; +import com.infinityraider.agricraft.api.v1.misc.IAgriHarvestable; +import net.minecraft.tileentity.TileEntity; + import java.util.ArrayList; import java.util.List; @@ -86,6 +89,13 @@ public float work() { BlockPos tempPos = new BlockPos(pointerPos.getX(), pointerPos.getY() + i, pointerPos.getZ()); if (!BlockUtils.canBlockBeBroken(this.world, tempPos)) continue; IBlockState tempState = this.world.getBlockState(tempPos); + TileEntity te = world.getTileEntity(tempPos); + if (te instanceof IAgriHarvestable) { + WORKING_TILES.add(this); + ((IAgriHarvestable)te).onHarvest(stack -> ItemHandlerHelper.insertItem(outItems, stack, false), null); + WORKING_TILES.remove(this); + continue; + } if (tempState.getBlock() instanceof IPlantable || tempState.getBlock() instanceof IGrowable) { FakePlayer player = IndustrialForegoing.getFakePlayer(this.world, tempPos.up()); player.inventory.clear();