summaryrefslogtreecommitdiff
path: root/libnbtplusplus/README.md
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 19:56:58 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 19:56:58 +0300
commita4b5ffbaadb591066e2a97f8d450fb1d93e56a6e (patch)
treeae7c5841f264eea66484f9a413111ce012fa7a86 /libnbtplusplus/README.md
parent7fb132859fda54aa96bc9dd46d302b343eeb5a02 (diff)
parent1a0ffe372f4da8408c5d08a36013536a3396b9e6 (diff)
downloadProject-Tick-a4b5ffbaadb591066e2a97f8d450fb1d93e56a6e.tar.gz
Project-Tick-a4b5ffbaadb591066e2a97f8d450fb1d93e56a6e.zip
Add 'libnbtplusplus/' from commit '1a0ffe372f4da8408c5d08a36013536a3396b9e6'
git-subtree-dir: libnbtplusplus git-subtree-mainline: 7fb132859fda54aa96bc9dd46d302b343eeb5a02 git-subtree-split: 1a0ffe372f4da8408c5d08a36013536a3396b9e6
Diffstat (limited to 'libnbtplusplus/README.md')
-rw-r--r--libnbtplusplus/README.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/libnbtplusplus/README.md b/libnbtplusplus/README.md
new file mode 100644
index 0000000000..fdc96df533
--- /dev/null
+++ b/libnbtplusplus/README.md
@@ -0,0 +1,85 @@
+<!--
+SPDX-FileCopyrightText: 2013, 2015 ljfa-ag <ljfa-ag@web.de>
+
+SPDX-License-Identifier: LGPL-3.0-or-later
+-->
+
+# libnbt++ 2
+
+libnbt++ is a free C++ library for Minecraft's file format Named Binary Tag
+(NBT). It can read and write compressed and uncompressed NBT files and
+provides a code interface for working with NBT data.
+
+----------
+
+libnbt++2 is a remake of the old libnbt++ library with the goal of making it
+more easily usable and fixing some problems. The old libnbt++ especially
+suffered from a very convoluted syntax and boilerplate code needed to work
+with NBT data.
+
+## Building
+
+This project uses CMake for building. Ensure you have CMake installed.
+
+### Prerequisites
+- C++11 compatible compiler
+- CMake 3.15 or later
+- ZLIB (optional, for compressed NBT support)
+
+### Build Steps
+1. Clone the repository:
+ ```
+ git clone https://github.com/PrismLauncher/libnbtplusplus.git
+ cd libnbtplusplus
+ ```
+
+2. Create a build directory:
+ ```
+ mkdir build
+ cd build
+ ```
+
+3. Configure with CMake:
+ ```
+ cmake ..
+ ```
+ Options:
+ - `NBT_BUILD_SHARED=OFF` (default): Build static library
+ - `NBT_USE_ZLIB=ON` (default): Enable zlib support
+ - `NBT_BUILD_TESTS=ON` (default): Build tests
+
+4. Build:
+ ```
+ cmake --build .
+ ```
+
+5. Install (optional):
+ ```
+ cmake --install .
+ ```
+
+## Usage
+
+Include the headers and link against the library.
+
+### Example
+```cpp
+#include <nbt_tags.h>
+#include <fstream>
+#include <iostream>
+
+int main() {
+ // Read an NBT file
+ std::ifstream file("example.nbt", std::ios::binary);
+ nbt::tag_compound root = nbt::io::read_compound(file).first;
+
+ // Access data
+ std::cout << root["some_key"].as<nbt::tag_string>() << std::endl;
+
+ return 0;
+}
+```
+
+## License
+
+This project is licensed under the GNU General Public License v3.0. See the [COPYING](COPYING) file for details.