Giter Club home page Giter Club logo

Comments (9)

jaquadro avatar jaquadro commented on August 28, 2024

StringArrayTag is nonstandard. I'm not even sure why someone would create one when a TagList of TagStrings would be equally efficient. Please send a sample file.

from nbtexplorer.

Lukario45 avatar Lukario45 commented on August 28, 2024

I will send you a file early tomorrow when I am not in bed. The array is more efficient in a sense because it is less value getting from tags. I use NBT with my own project (MCthunder) which is on GitHub. I'll have to remake the file but it won't take long. I need to change the logic in my software back to String[] because using the list tag is annoying and it passes extra unneeded data. The only reason I switched was because I thought it was me doing it wrong and corrupting my NBT . I personally feel like NBT format is amazing
For storing data and it should be used a lot more lol

from nbtexplorer.

codewarrior0 avatar codewarrior0 commented on August 28, 2024

I think you should stick to standard NBT tags to ensure compatibility with any programs that use NBT. I don't see the benefit of using a custom tag for string arrays over TagList, and it would take some benchmarking to convince me.

For what it's worth, NBT is just as capable as JSON for storing data. The advantage to NBT is storing binary data without encoding it as text as you would for JSON. A disadvantage of both NBT and JSON is that, at least for common implementations, the entire file has to be parsed and loaded before you can access any of its data, which makes both of them less suitable for storing a large amount of binary data.

I've heard of stream-based JSON parsers that, instead of reading the entire object, will call user-supplied callbacks during the parsing process. (This was common for XML parsers, too.) I haven't seen any streaming NBT parsers that do this, though.

from nbtexplorer.

jaquadro avatar jaquadro commented on August 28, 2024

While ShortArray is a debatable exception (that I've accepted into Substrate but haven't written into NBTExplorer yet), I don't think string arrays are an appropriate addition to either of those projects.

My other NBT project https://github.com/jaquadro/NNBT is a better match for this kind of thing, as it's intended more for use outside Minecraft and the needs of specific projects. But that's a library, not an editor. And it's not the library currently backing NBTExplorer.

Since your project is Minecraft-related, I agree that you should stick to the standard tags to maximize compatibility with the rest of the world.

from nbtexplorer.

Lukario45 avatar Lukario45 commented on August 28, 2024

While the full project is for minecraft the NBT I am working with now is not. A list tag full of string tags is a good supplement for a string array tag, but it has its disadvantages. I have get the values from the tag, Since I cannot tostring a string if someone decides to throw another tag into the list its an error and their player file will be unusable and they will be asking why its an error. With a StringArray tag I get all of the values without any loops and such. I am making a large software every bit of memory counts, Even the small things, I cannot waste small amounts of memory handling loops for it just to make an arraylist in the software. What I am probably going to do is look deeply into your code and see what I can understand from a java viewpoint an fork NBTExplorer, add what I need and just use a custom build

from nbtexplorer.

LB-- avatar LB-- commented on August 28, 2024

if someone decides to throw another tag into the list

The NBT format does not support this, so this is a non-issue.

from nbtexplorer.

Lukario45 avatar Lukario45 commented on August 28, 2024

It's not like I just thought that this would be a good tag to create, It is in a Library I already use in Java, II'm not making it up for the fun and most NBT Librarys' read it fine

from nbtexplorer.

jaquadro avatar jaquadro commented on August 28, 2024

Just because OpenNBT registers a half dozen extra tags does not make them valid NBT. They are OpenNBT extensions and only have defined meaning for OpenNBT. Other libraries might just strip them out.

If you're still bent on using those extensions, you can patch up a custom build of NBTExplorer as you suggested. You will need to add the new tags to Substrate, and then create the corresponding data nodes in NBTExplorer. It's a bit of a pain overall.

from nbtexplorer.

Lukario45 avatar Lukario45 commented on August 28, 2024

The pain I am having is the fact that Visual Studio will not install to my computer for a stupid error, then I need to find the classes you are talking about in a programming structure that I am not familiar with, so yes It will be difficult. Although now would be a great excuse to make the built in NBT Editor I planned to add to the software lol

from nbtexplorer.

Related Issues (20)

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.