1. Select any recipe for an assembling machine
2. Insert item directly into it's inventory: /c game.players[1].selected.getinventory(2).insert({name = "iron-plate",count = 1})
3. The item inserted into the first slot, regardless of the recipe filters
[0.11.22] inventory.insert command ignores filters
Re: [0.11.22] inventory.insert command ignores filters
The inventory slots of a crafting machine aren't restricted to what can be put in them. - nevermind that - You can manually put items in the wrong slots as well.
Not really sure if that's a bug or not. If you call entity.insert() it will put it in the correct slots for the recipe.
Not really sure if that's a bug or not. If you call entity.insert() it will put it in the correct slots for the recipe.
Last edited by Rseding91 on Fri May 22, 2015 11:34 pm, edited 1 time in total.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.11.22] inventory.insert command ignores filters
I just have tried to manually put item into this exact slot, and it said: Only electronic circuit can be inserted here, not Iron Plate.
As about entity.insert(), I'm aware of it.
As about entity.insert(), I'm aware of it.
Re: [0.11.22] inventory.insert command ignores filters
You're correct. I was thinking of filtered inventory slots (the hotbar and train inventory).SigmatroN wrote:I just have tried to manually put item into this exact slot, and it said: Only electronic circuit can be inserted here, not Iron Plate.
As about entity.insert(), I'm aware of it.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.11.22] inventory.insert command ignores filters
Assembling machine contains regular inventory. The inventory itself doesn't know about filters. The filtering logic is done by assembling machine code.
This way you are manipulating the inventory directly. Hence the filters are not applied.
Safer and generally recommended solution is to work with the entity directly:
This works as expected putting the item to the correct place. This uses the same mechanism the inserter would use when inserting into assembling machine.
Code: Select all
2. Insert item directly into it's inventory: /c game.players[1].selected.getinventory(2).insert({name = "iron-plate",count = 1})
Safer and generally recommended solution is to work with the entity directly:
Code: Select all
/c game.players[1].insert({name = "iron-plate",count = 1})