Refined Storage

Refined Storage

77M Downloads

Autocrafting paused for item that has a pattern (durability may be involved)

DoomSquirter opened this issue ยท 7 comments

commented

Issue description:

Autocrafting is stopping, possibly due to item nbt/durability issue? Not sure.

What happens:

Setup patterns to autocraft mekanism Induction cells. Made all patterns in pattern grid.
Tried to craft a ultimate Induction cell (or a basic one) and you hover over the crafting monitor's item and it says it's missing "Energy Tablet" even tho there's a pattern for that in one of the crafters.

I have an enormous amount of materials, enough to make 1000's of energy cells.

What you expected to happen:

I expected it to make a induction cell or at least tell me what materials it was missing

Version (Make sure you are on the latest version before reporting):

  • Minecraft: 1.10.2
  • Forge: 2093
  • Refined Storage: 1.05

Does this issue occur on a server? [yes/no]
yes

Also, you closed a similar ticket (#344) regarding the glass cutter from exu2. That is a valid problem considering it's used in hand and is something I was going to do as well.

I have no idea what magic ae used to determine or ignore durability under certain circumstances but it probably had something to do with the crafting recipe as it is internally? i.e. maybe forge externalizes some way to determine if durability plays any part within that crafting recipe? You would know more than I would since I'm just guessing here.

anyways, this issue and #344 are not identical in nature but they share a similar issue that it revolves around. One issue (Mine) requires a specific durability item, the other issue ( #344 ) requires any durability. Afaik, mekanism requires it's energy tablets and other items to be empty to craft into something else.

commented

No, the energy containing items can have energy in them. And if the product is also an energy containing item, it generally also has the energy that was in the source items (added together). Particularly nice with energy cells and induction cells when upgrading them. I agree this is an issue in this case, and it affects the crafting grid as well. I always have to drag the energy tablets and other such items to the grid manually. JEI's shift and + operation fails to populate the crafting grid properly.

I'm just in the process of automating Mekanism stuff, and yeah, this throws a severe wrench into the works, unfortunately. Would be nice to at least have some sort of way to flag an item to ignore damage values in a pattern (or not), if there's no reliable way to figure it out automagically. And possibly metadata, but not sure if that's even an issue. Seems to me that would solve all such issues.

Also, hi Raoul! You've come a long way with the mod since we spent most of a day testing/debugging that issue with solderers and such becoming non functional. It's come along amazingly. :)

commented

Thanks for the kind words @RealGrep!

So this is the problem: technically I could implement a ignore damage option, but this leads to problems.

Due to the multithreaded autocrafting the first crafting task in line will take the "energy tablet" or whatever item is used for that craft, and keep it in use. That means other tasks will be blocked until the first task is done and gives the energy tablet back. This means tasks will run 1 at a time (the ones that use the "energy tablet" at least).

This leads even to more problems if you have a crafting pattern for the "energy tablet", as it will schedule 9 tablet autocrafting tasks (if you request 10 items that use the tablet) because the item isn't available.

There is no way for me to detect if RS has to keep said item available, and not extract it.

commented

In this case, at least, the energy tablet is consumed in the crafting, so if there are 2 crafting targets requiring 2 energy tablets each, it will require 4 energy tablets to get it done (for example, the basic energy cube). However, I can see where that's an issue for other things like the EU2 glass cutter and such where the item is returned.

commented

all I can do is compare against ae/ae2 which is what this mod owes it's inspiration from. Seeing that they handled these tasks accordingly, seems the problem is definately workable. TBH tho, w/o being able to do these things, there are a lot of crafting jobs that will never work correctly.

I am hazarding a guess, but I assume this is why ae2 gives you a complete parts list at the start of the craft, and then works bottom up to complete all of them.

commented

I experienced this exact situation the past 2 days trying to craft Mekanism items. The NBT data issue is 1 but even with a completely empty energy tablet in RS it won't use the crafted energy table for a JEI recipe made into a pattern. So that is one problem but easily fixed by using my RS crafted Energy Table in the recipe instead.

However, second problem is if I don't have any energy tablets but I DO have a recipe for them then any crafting recipe that relies on those energy tablets won't autocraft more of them to satisfy the end recipe. An example is Energy cube crafts just fine with empty energy tablets in RS but if there are none but a recipe for them the crafting process hangs saying it needs energy tablets when it knows how to craft them.

commented

That's pretty much what my original issue was all about tho. I couldn't get anything to craft regardless of charge level of tablet (full, empty). I made a couple hundred tablets (auto craft) and it had way more than it needed in the system to make the lowest level energy cube but it wouldn't craft it.

AE2 has an option for oredict that they added many months ago, that you set in the pattern. But durability was always handled internally. I don't recall ever seeing anything special that involves the user manipulating a pattern in any way to deal with the durability/nbt of items. I've never looked at their code, so I don't know if they don't just ignore durability altogether or make special exceptions for specific items they have to constantly add to or not, to the code.

Either way, this example, and for the ticket I referenced in the issue made by another user, that was closed erroneously, crafting using the exu2 glass cutter to make ender shards or whatever they are called, those will not work either.

I think ignoring durability across the board during autocrafting, but favoring items in the system that have same durability as the recipe calls is probably the best route to take. my 2 cents.

commented

Can confirm: this will be a thing!

Gonna close this though as I'll be using this issue as reference for autocrafting TODO's: #433