Items on belt have health. When picked up or inserted into a chest, it shows up. But the TransportLine API only shows contents with names and counts. What is the easiest way to get the health?
As a side note, is it possible to connect an underground belt input with another output manually by using code? Currently, the Entity.neighbours show the other member of the pair, but it is read only.
Health of item on belt
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Health of item on belt
1. You can only access that info once you have removed item from belt (as then you have an ItemEntity object which has the properties you're looking for)
2. Underground belts and pipes automatically connect to orphans within range that are facing in the right direction. So just placing the other end in right place & direction will create the link.
If you were thinking of underground junctions... as far as I know there's no way to do that sort of thing currently - as you found, the .neighbours array is read only.
2. Underground belts and pipes automatically connect to orphans within range that are facing in the right direction. So just placing the other end in right place & direction will create the link.
If you were thinking of underground junctions... as far as I know there's no way to do that sort of thing currently - as you found, the .neighbours array is read only.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Health of item on belt
Thanks aubergine18.
1. Yeah, I'm looking for that info immediately from a reference to the belt entity, which has .transport_line.get_contents() with no health info. Can't really get them off the belt. Calling remove() just voids the item giving me only a count to work with.
2. Wanted to wire up one down belt with an up belt that's not in range or in straight line. Probably not possible as well.
1. Yeah, I'm looking for that info immediately from a reference to the belt entity, which has .transport_line.get_contents() with no health info. Can't really get them off the belt. Calling remove() just voids the item giving me only a count to work with.
2. Wanted to wire up one down belt with an up belt that's not in range or in straight line. Probably not possible as well.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Health of item on belt
Take a look at Factorissimo mod and see how that handles the belts/pipes between those outside and inside the factory, that might give a possible solution to your requirement. https://github.com/MagmaMcFry/FactorissimoNeel wrote:2. Wanted to wire up one down belt with an up belt that's not in range or in straight line. Probably not possible as well.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.