Coder Social home page Coder Social logo

Support JSON based NBT files about nbt HOT 4 OPEN

izzelaliz avatar izzelaliz commented on July 22, 2024
Support JSON based NBT files

from nbt.

Comments (4)

ustc-zzzz avatar ustc-zzzz commented on July 22, 2024 1

Considering that it's not an official standard and it will depend on at least one JSON library, a new repo (depending on this) will be created for this feature. Please wait for our follow-up actions.

from nbt.

ustc-zzzz avatar ustc-zzzz commented on July 22, 2024

Several details to be confirmed:

  • I haven't found things about number arrays, what're their names? byte_array or bytearray?
  • What will happen if type field does not exist? Guess the type from value field or just throw an error?
  • What will happen if an unmatched value is read (for example, got a number but required a string, or got a floating number but required an integer)? Convert to required type automatically or just throw an error?

from nbt.

dzikoysk avatar dzikoysk commented on July 22, 2024

Thanks for quick response :)

  • I've never seen usage of number arrays in such a format, so I suppose it's up to you. For instance minecraft-data uses byte_array to describe the protocol, so it might be a fair candidate.
  • I think it should throw an error in both scenarios, because it is just cleaner and it requires less effort to implement it. In the future it could be extended by some kind of flexible matcher that may perform conversion, but I don't really see the case for this now 🤔

from nbt.

dzikoysk avatar dzikoysk commented on July 22, 2024

I've created a simple mapper from JSON to NBT, so it's not a problem for me. I reported it to just let you know that some people may also find it useful in the future.

Instead of a new repo, you could also consider modularization of this one like this:

nbt-parent/ - parent settings for both modules
  nbt/      - core NBT module
  nbt-json/ - JSON support for NBT module

In most cases it's the best solution for such a projects.

from nbt.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.