Comments (11)
Thanks for your report. Either Mojang added another type to the NBT files, or your file somehow got corrupted. If it is not too much trouble, could you email the scoreboard.dat file to me? My email address is on my Github page (http://github.com/macfreek)
from nbt.
File certainly isn't corrupted as both minecraft and my own tool https://github.com/schoentoon/nbtcurses are able to read it. Will email you the scoreboard.dat in a bit.
from nbt.
Indeed, a bug in the NBT library is a rather likely cause too. :). File received also gives the same error here. I'll have a look, hopefully tonight.
from nbt.
I found the cause.Your file contains a rather odd TAG_List.
The syntax of a TAG_List is as follows:
- 1 byte indicating that a TAG_List follows (0x09)
- 2 bytes indicating the length n of the name of this TAG_List
- n bytes containing the actual name of the TAG_List
- 1 byte indicated what type of objects the list contains
- 4 bytes indicated the number l of objects the TAG_List contains
- ... l unnamed binary tags containing the objects in the list.
The type of the TAG_List in your file was 0x00 -- a TAG_End, and the length was also 0x00000000 -- zero length. The TAG_End is surprising, and why the NBT library raised the Exception. Normally, a List contains actual objects. So far, I've only seen TAG_Ends used to indicate the end of a TAG_Compound, never elsewhere.
I'll commit a change shortly that should add support for TAG_Lists with TAG_End objects.
>>> from nbt import *
>>> nbtfile = nbt.NBTFile("scoreboard.dat")
>>> print(nbtfile.pretty_tree())
NBTFile: {1 Entries}
{
TAG_Compound('data'): {4 Entries}
{
TAG_List('Teams'): [0 _TAG_End(s)]
TAG_List('Objectives'): [4 TAG_Compound(s)]
{
....
}
}
}
[Edit: fix formatting of list]
from nbt.
Wonderful, will I be able to install this fix through easy_install or will I have to do an install from source?
from nbt.
Fixed in 0f3ccff
from nbt.
@macfreek It's probably time to do a new pypy release, yes?
from nbt.
You will have to install from source -- that said, we should release 1.4 of NBT. For good measure, I won't do it right after a code change, but tomorrow might be a good time.
Ideally, I should write a test for this behaviour. However, if you are willing to download the source, and test if it works fine for you, that would be good enough for me. The automated testing gives no problems either.
from nbt.
@twoolie yes master, it is Time.
(Sorry, couldn't resist saying that :) )
from nbt.
@schoentoon you can install it super easily like this:
easy_install pip
pip install git+https://github.com/twoolie/NBT@0f3ccffecb#egg=NBT
from nbt.
@twoolie Oh thanks that's very useful. I'll install it later though, have to explore all the new biomes first ;)
Edit: Confirmed that it fixed my issue.
from nbt.
Related Issues (20)
- [Question, Potential Bug Report]: _render_buffer recursion when trying to modify region files in entities folder HOT 1
- [Question] How to get block data from blockstates
- (Question) Trying to modify region binary to replace stuff in minecraft world using blockdata
- KeyError: Tag Level does not exist when using Minecraft 1.18.1 worlds. HOT 3
- Can someone add support for 1.18 world height. Chunk section range should support -4 to 19, not 0 to 15. Thanks!
- Error while creating data: "struct.error: int too large to convert" HOT 1
- Unable to set value for Compound HOT 1
- Writing a compound tag to a file HOT 1
- 'TAG_End' is not defined HOT 3
- Using the map example with a 1.8 world renders nothing but black. HOT 2
- Can't save .mca HOT 2
- Get uncompressed NBT data to variable
- SNBT parser in/out
- Use of TAG_Int_Array unclear/undocumented HOT 2
- `Sample_World.tar.gz` missing? HOT 1
- Continuous integration setup HOT 1
- Policy on compatibility with old Minecraft versions HOT 2
- Opening servers.dat.
- [Bug Report]: UnicodeDecodeError on valid data HOT 1
- Create method to convert SNBT to json/python dict
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbt.