Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gjum/nbt-cpp
Provides a class and useful programs for Minecraft's NBT data access and manipulation.
https://github.com/gjum/nbt-cpp
deserialization marshalling minecraft nbt
Last synced: about 1 month ago
JSON representation
Provides a class and useful programs for Minecraft's NBT data access and manipulation.
- Host: GitHub
- URL: https://github.com/gjum/nbt-cpp
- Owner: Gjum
- Created: 2013-11-23T12:39:02.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-26T19:22:36.000Z (about 9 years ago)
- Last Synced: 2024-10-14T19:26:09.252Z (3 months ago)
- Topics: deserialization, marshalling, minecraft, nbt
- Language: C++
- Homepage:
- Size: 242 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NBT-Cpp
=======The NBT::Tag class is a class to load, create, modify, save, and print NBT files.
From Notch's original spec:
> NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data.Features
--------- read raw filestream
- read gzip filestream
- read byte array
- get tag name
- get tag type
- get tag value
- get compound subtag
- get list item
- get tag content as string
- print tag tree as json
- read region chunkTo do list
----------- read region timestamps
- write raw filestream
- write gzip filestream
- write region chunkIncluded programs
-----------------![worldmap example](http://lunarco.de/minecraft/nbt-worldmap_Songburrow_+450-2050_500x700_2x2.png)
####`worldmap.cpp`
Takes a minecraft world path and renders the map into `worldmap.png`.
Rendered are `width` by `height` blocks around the `center`, each block `zoom` by `zoom` pixels large.
Optionally prints `center x`, `center z`, `width`, and `height` of the map.
The current color data is from the default texture pack, slightly adjusted by me.
The renderer even calculates block transparency and does a bit of height mapping.**Arguments:**
` [center x=0] [center z=0] [width=256] [height=256] [zoom=1] [info text size=10]`
- `worldpath`: The path to the Minecraft world.
- Example: `saves/Legio-Umbra/`
- `center x`: The x coordinate of the block at the center of the image.
- Example: `500`
- `center z`: The z coordinate of the block at the center of the image.
- Example: `-432`
- `width`: The x range of the blocks in the image.
- Example: `600`
- `height`: The z range of the blocks in the image.
- Example: `400`
- `zoom`: The size of each map pixel.
- Example: `5`
- `info text size`: The font size to use for the info text. `0` for no text.
- Example: `12`**Example:**
`worldmap saves/Legio-Umbra/ 500 -432 600 400 5 12`
Renders `saves/Legio-Umbra/` with `5x5` block size and prints various data in font size `12`.
The image contains all blocks from 200,-632 to 799,-231.####`main.cpp`
Prints a json-like tree of the provided file.
Supports uncompressed and gzip compressed files.**Arguments:**
` [tag path=""]`
- `path/to/file`: The file to load the tag from.
- Example: `testdata/bigtest.nbt`
- `tag path`: The path to the tag that will be printed.
- Example: `nested compound test.ham.name`**Example:**
`main bigtest.nbt`
Prints the content of `bigtest.nbt`, which is too long and can be found here:
####`map.cpp`
Takes a minecraft world path and map id and renders the map item into `map_#.png`.
Optionally prints `scale`, `dimension`, `xCenter` and `zCenter` of the map.**Arguments:**
` [zoom=5] [info text size=0]`
- `worldpath`: The path to the Minecraft world.
- Example: `saves/Legio-Umbra/`
- `mapnr`: The id of the map item.
- Example: `4`
- `zoom`: The size of each map pixel.
- Example: `5`
- `info text size`: The font size to use for the info text. `0` for no text.
- Example: `12`**Example:**
`map saves/Legio-Umbra/ 4 5 12`
Renders `saves/Legio-Umbra/data/map_4.dat` with `5x5` pixel size and prints various map data in font size `12`.
---
Copyright (c) 2015, Gjum
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.