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

addIcon (terminalGlasses) #87

Open
clienthax opened this issue May 15, 2016 · 5 comments
Open

addIcon (terminalGlasses) #87

clienthax opened this issue May 15, 2016 · 5 comments

Comments

@clienthax
Copy link

Can we get a method for drawing a icon with a itemstack table reference, or at the very least a way to include nbt?
im trying to make a forestry bee display, but as theres no way to add the nbt to the displayed stack,
they all show as the base bee

@boq
Copy link
Member

boq commented May 15, 2016

We are not planning to expose raw NBT. Getting information just about icon on server side is also mostly impossible.

Only thing I can do is to create element that displays icon from texture sheet (items or blocks). But it's not enough for bees, since they are more complicated (built-in bees have 3 layers, and modded ones can be even more complex).

@clienthax
Copy link
Author

clienthax commented May 15, 2016

What about a method that would just pass the mc stack to the itemicon data, say from a inv connected to the network, without allowing the player to mess with the actual data?
or are you saying the render method just isnt good enough in addons for it ?

@boq
Copy link
Member

boq commented May 15, 2016

The problem is in Lua-Java barrier - since user has to set this via Lua code, itemstack must cross it at least twice (Java->Lua and Lua->Java).

While it could be doable in OpenComputers, ComputerCraft lacks method to create opaque container ("userdata") which could be used to hide information from user, but still keep it available to OpenPeripheral.

@clienthax
Copy link
Author

Could you not keep a reference to the original data it in the backend of openp, or does that get lost over the barrier?

@boq
Copy link
Member

boq commented May 18, 2016

Well, I can keep it, but then how will OpenPeripheral find out, where to find this data? Only idea I have is to keep index to table of items somewhere in structure returned to Lua. But that creates few problems, since users can freely modify this data and, for example, access items from other players (even if I create one table per computer). Also, there is problem with garbage collecting (when should item be removed from cache?).

PS. Couldn't answer earlier due to Internet problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants