Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isItemCraftable returns true even if there is not enough materials to craft the items #61

Open
michihupf opened this issue Aug 27, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@michihupf
Copy link

Describe

isItemCraftable returns true whenever an item can be crafted. Although this works to detect if a crafting pattern is missing it seems to completely disregard the amount of items to be crafted.

Is this by design or is this a bug? Detecting whether or not a crafting job was started but subsequently failed because of material shortage is extremely important in autocrafting and autofarming applications.

Steps to reproduce

The code below will print true even if 10 stone can't be crafted because there isn't enough cobblestone in the system.

me = peripheral.find("meBridge")
print(me.isItemCraftable({name="minecraft:stone", count=10})

Multiplayer?

Yes

Version

1.20.1-0.7.32b (Latest 1.20.1)

Minecraft, Forge and maybe other related mods versions

Minecraft 1.20.1 (forge 47.1.3), cc-tweaked-1.20.1-forge-1.106.1

Screenshots or Videos

No response

Crashlog/log

No response

@SirEndii
Copy link
Member

SirEndii commented Sep 6, 2023

This is more or less intended. isItemCraftable returns true if a pattern exists for the item you want to craft

is extremely important in autocrafting and autofarming applications.

I agree with that, however, we can't currently change this behavior. The reason is because AE2 calculates recipes async, a calculation can take a while and while it calculates, the script would freeze which is not what we want

It is planned that we add a crafting event which can return different states like missing items, no CPU free, calculation successful or crafting finished

@SirEndii SirEndii self-assigned this Sep 6, 2023
@SirEndii SirEndii added this to the 0.7.x milestone Sep 6, 2023
@SirEndii SirEndii transferred this issue from IntelligenceModding/AdvancedPeripherals Nov 9, 2023
@SirEndii SirEndii modified the milestones: 0.7.x, 0.8r Dec 24, 2023
@zyxkad zyxkad added API/change area-Bridges ME/RS Bridge or other heavy networks and removed API/change labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants