Giter VIP home page Giter VIP logo

Comments (12)

vberlier avatar vberlier commented on August 22, 2024 1

Fixed in 841030a. I'll make a release later with several other fixes.

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024 1

Not really. nbtlib focuses on implementing generic nbt utilities and even though .mca files contain nbt data, they're a file format of their own. This is out of the scope of this project but you can still use nbtlib to parse the nbt sections of .mca files.

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

Interesting. I just tested it and it seems like minecraft falls back to string whenever the value of the number exceeds the range allowed by its type. I'll fix this asap.

from nbtlib.

ch-yx avatar ch-yx commented on August 22, 2024

thank you so much!

from nbtlib.

ch-yx avatar ch-yx commented on August 22, 2024

will it support .mca files?

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

Closing the issue as the fix is now in release 1.3.0.

from nbtlib.

ch-yx avatar ch-yx commented on August 22, 2024

I just found that minecraft falls back to string if it is not an integer but end up with a integer type suffix as well.
here are some examples:
3.3s
4e-3l
4e3l
03b

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

Okay so it seems like there's several things that I'll need to take into account:

  • Parsing an integer tag should fall back to string if the constructor raises a ValueError
  • Include scientific notation in the grammar for floating point tags
  • Adjust the grammar such that integer tags can't start with a 0

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

All of these should now be fixed as of bca40bc.

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

Just released v1.4.5 with the three fixes, closing the issue.

from nbtlib.

ch-yx avatar ch-yx commented on August 22, 2024

#7 (comment)

I just found out that there is a built in OverflowError. Don't need to creat a new one.

from nbtlib.

vberlier avatar vberlier commented on August 22, 2024

Not sure, the built-in OverflowError is meant to be raised "when the result of an arithmetic operation is too large to be represented". The documentation says it's "sometimes raised for integers that are outside a required range" but only for historical reasons (i.e.: not a recommended practice). I think using a custom error is more appropriate in this case.

from nbtlib.

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.