-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
opencomputers api extractItem() fails when item has NBT data #2253
Comments
I've been doing some more troubleshooting with this, and I have come to realize that it seems to be a problem with the gendustry samples only. I tested again with putting some cobblestone into the system and trying to extract that and it worked fine. I also walked the code approximately line by line in the interactive lua prompt. When I do it this way, |
I have further refined (pun intended) my understanding of what is happening. It appears that the extractItem() method will fail (as in, not extract) whenever an item has NBT tags. I tested with a variety of items, including a vanilla enchanted pickaxe. any time the item had an NBT tag, the extract would fail. |
Has anyone found a fix for this bug yet? |
1.12 is no longer maintained and since OpenComputers still hasn't ported to 1.16.x, closing. |
@balloman This is not a bug. You just have to enable allowItemStackNBTTags in the OpenComputers config. Otherwise the NBT tag is not sent to your script which means it's not sent back when you're trying to extract something. |
@tth05 At no point in the script do I attempt to view, modify, or use NBT data. All I do is read the label (name) of the item, and then try to extract it. This works fine for items not containing NBT tags, such as cobblestone. As soon as an item has NBT data, such as an enchanted pickaxe, it fails. Seems like a bug to me. Are you telling me that if I tested using an opencomputers robot to extract from a vanilla chest, that it would also not be able to operate on items with NBT data? If it isn't a bug, then how is one expected to interact with items containing NBT data? Is there a way to work around this I am unaware of? I gave up on making it work when I posted the bug report and no one replied. |
The fix is to enable the config option I mentioned. |
Still sounds like a bug to me. Maybe a bug in open computers instead of refined storage, but a bug nonetheless. Leaving out the NBT data shouldn't break interaction with non-NBT data, but it does. At the very least there should be some method of workaround that isn't "enable the config option". In a multiplayer, server environment this may not be feasible. I don't know how it would work on the backend, but it seems like anything open computers can do with a vanilla chest should be doable with refined storage, but it isn't in the case of an item with NBT data. Again, I don't even want to interact with the NBT data. just the item as it exists. All that said, your description makes sense and I'd like to thank you for the explanation, even if we disagree on whether it is intended behavior. |
The problem is that Refined Storage has to treat items with different NBT tags as unique items, because various mods use these for all sorts of weird and wonderful purposes. When you ask for an item without NBT data, that is a different item from an item with NBT data (or an item with different NBT data). So RS is correctly saying that the item that you requested isn't in the storage, because you're not giving it enough information to determine which item you actually wanted. For a simple example, imagine that you have three different diamond picks in storage -- one is enchanted with fortune, one with silk touch, and one is unenchanted. They all have the same item name, but they have different NBT data and they are different items, and when you ask for one you don't want to get the wrong one just because it happened to be first or the others happened to be missing from storage at the time. |
Issue description:
Using opencomputers api, extractItem() returns nil and fails to function.
What happens:
I can read item stacks in the network and correctly identify the items I wish to extract. However, calling the extractItem() method always returns nil and nothing happens.
What you expected to happen:
When calling extractItem(), the stack should be extracted from the network.
Steps to reproduce:
In my case, I get output stating that the program found stacks, but always extracted 0. There is also nothing in the chest. No errors appear either in the lua output or in the server log.
Version:
ATM3: Remix 1.3.0
Does this issue occur on a server? [yes/no] yes
If a (crash)log is relevant for this issue, link it here:
[pastebin/gist/etc link here]
The text was updated successfully, but these errors were encountered: