Dropping a single iron ore onto an anvil with a mesh die can create stygian iron dust
ffgda opened this issue ยท 7 comments
I'm playing the All the Mods 3 mod pack with Woot version 1.12.2-1.4.4.
When I tried to automate the anvil using 3rd party blocks like the Actually Additions Automatic Precision Dropper and the Extra Utilities 2 Mechanical User, I noticed that sometimes only dropping a single iron ore block onto the anvil with a mesh die would create 3 stygian iron dust, as if the requirement for the recipe of 1 netherrack, 1 soul sand, 1 iron ore -> 3 stygian iron dust was met, although no netherrack or soul sand was anywhere near the anvil.
After further observation, I'm relatively sure this phenomenon occurs if the anvil "registers" the dropped iron ore in the same tick as the Ya Hammer is used on the anvil.
Since you wrote you'd re-write a lot of the code for 1.13 anyways and this is pretty much the edgiest edge case I can think of, I guess this is not very high prio. But I thought I'd report it anyways.
Nothing obvious is jumping out at me in the code, which means this is something subtle.
The recipe shouldn't be matching if it only managed to grab a single item out of the three required.
The other option is that it is not removing the used items correctly, which is completely possible as I've got some really messy "only delete the used items" for when people drops excess ingredients on. So there could well be a problem there that this case exercises.
Could you give me a screenshot of your setup and I'll try and replicate it?
Thanks for that.
I've replicated the issue and now I'm trying to work out what is going on.
I think that what is happening is that I'm getting three distinct item stacks of iron ore rather than one itemstack of iron ore with a stack size > 1. That is then poking a great big hole in my code.
So the timing part is that you have to activate the hammer while there are three independent itemstacks in the world - ie before Minecraft joins the independent itemstacks together into one representing the same item.
That also explains why it stops working soon after the dropper is empty.
I need to ensure that the recipe matching handles this situation.
Fixed - I think.
Just need to do a bit more regression testing to ensure I've not horribly broken something else.
Ah that's a funny bug :D So actually any combination of that recipe's components would have worked as long as you managed to create 3 separate stacks on top of the anvil.
Or rather any recipe would have worked with its cheapest component as long as you manage to get separate stacks of it equal to the total of unique items in the recipe.
Now I'm wondering what will happen in 1.4.4 if you throw a stack of something onto the block that is part of multiple recipes... BRB crashing my game.
Edit: Threw Stygian Iron Plates at a Core Die, game didn't crash, which is good, but it gave me Controller Cores and Heart Cores, depending on if it was matching 2 or 3 stacks :D
It was a pretty bad bit of code which after debugging it made me wonder why on earth I wrote it that way!
For testing I loaded up a precision dropper with enough items for multiple recipes at a time. Dropped the lot and let the mechanical user create the outputs. Glad to say that it used up all the ingredients and only gave the correct number of output items.
So hopefully - exploit be gone
But thank you for an intriguing bug to fix. :)