Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
epix

Problems about writing an addon that read NBT

Question

Hello, I'm trying to use Open Computer to monitor other mods working status. The ideal target is, showing change rate of water amount in a tank in Open Computer screen, and dump it into .csv file to do further research using external software. Since there are many type of data to collect, so directly read NBT data may be a good approach.

So I started to write an add-on. But facing problems:

1. How to return complex data (which lua would regard as a nesting table) in a callback function? The example (https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/java/li/cil/oc/api/README.md) only return a string.

2. I tried the example in development environment. However, the analyzer do show the name of component but not address. And the computer can not invoke the component. After compile the code into jar file and use in a normal minecraft environment, it works. I've also tried another add-on OpenSecurity. And it can not work as source code nor jar (in eclipse/mods folder) in develop environment. Open Computer build-in component works well.

Any help will be appreciated!

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

1. Java Maps get converted to Lua tables (recursively, IIRC loops/cycles are also fine). Iterables get converted to sequences (i.e. numerically indexed tables).

2. Make sure you're using the deobf (dev) version of OC in your devenv. That's usually what's causing people trouble.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.