AdvancedPeripherals icon indicating copy to clipboard operation
AdvancedPeripherals copied to clipboard

Applied Energistics 2 crafting amount

Open Hasenzahn1 opened this issue 4 years ago • 4 comments

Describe your idea

Option 1: The meBridge method craftItem() shall return a table with the maximum craftable quantity if the recipe cannot be crafted due to too few items.

Option 2: Add a new method that calculates the maximum craftable quantity of a given item.

Describe alternatives you've considered if you've any

Since the craftItem method of the meBridge returns nil if the recipe is not tradable, one could loop from a high number to a low number while the return of this method is not nil

Additional context

No response

Linked Issues

No response

Hasenzahn1 avatar Dec 30 '21 14:12 Hasenzahn1

Hello, is there currently some way i can find out that crafting request failed? Basically i want to craft some items but because i dont have enough materials i cant. But craftItem function still returns true and i was not able to discover how to find out it failed to handle it so this enhancement would be super useful.

Here is script iam trying to use it for https://pastebin.com/nEfLTTqd You will also need this downloaded as sadoAPI https://pastebin.com/AZcX0fUp And following config file:

stock = {
    -- Item, how many to keep in stock
    [1] = {"minecraft:quartz", 64}
}

sadovsf avatar Jul 10 '22 13:07 sadovsf

I'll add something like this in one of the next 1.18 versions In 1.19 I'll return a boolean with a proper reason like true, "Crafting Successful", 128 or false, "No crafting cpu's available", 0

SirEndii avatar Jul 10 '22 14:07 SirEndii

Hello once more. I was thinking about it and i have one more idea, it would be more useful to return some "result string" like OK, no_cpu etc... Those are simpler to use procedurally and if one wishes its really easy to provide human readable text based on these as well but in client app not forced from inside lib :)

sadovsf avatar Jul 11 '22 19:07 sadovsf

I agree That was just an example ^^

SirEndii avatar Jul 11 '22 20:07 SirEndii