From 7ad8ee8547c6dacde1a21a6bb678c2ec83c3e9a5 Mon Sep 17 00:00:00 2001 From: ShrBox Date: Sun, 14 Apr 2024 17:48:55 +0800 Subject: [PATCH] fix: fix #101 #102 --- CHANGELOG.md | 9 +++++++++ manifest.json | 2 +- src/legacy/api/NbtAPI.cpp | 7 ++++--- tooth.json | 6 +++--- tooth.lua.json | 2 +- tooth.nodejs.json | 2 +- tooth.python.json | 2 +- tooth.quickjs.json | 2 +- 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40fb4b85..bfbee4b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.2] - 2024-04-14 + +### Fixed + +- Fix [#101] [#102] + ## [0.6.1] - 2024-04-13 ### Fixed @@ -266,7 +272,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#97]: https://github.com/LiteLDev/LegacyScriptEngine/issues/97 [#99]: https://github.com/LiteLDev/LegacyScriptEngine/issues/99 [#100]: https://github.com/LiteLDev/LegacyScriptEngine/issues/100 +[#101]: https://github.com/LiteLDev/LegacyScriptEngine/issues/101 +[#102]: https://github.com/LiteLDev/LegacyScriptEngine/issues/102 +[0.6.2]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.6.1...v0.6.2 [0.6.1]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.5.4...v0.6.0 [0.5.4]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.5.3...v0.5.4 diff --git a/manifest.json b/manifest.json index 4571a7ed..9e12c4ad 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "type": "native", "description": "A plugin engine for running LLSE plugins on LeviLamina", "author": "LiteLDev", - "version": "0.6.1", + "version": "0.6.2", "dependencies": [ { "name": "LegacyMoney" diff --git a/src/legacy/api/NbtAPI.cpp b/src/legacy/api/NbtAPI.cpp index fdbf8dd9..27defad8 100644 --- a/src/legacy/api/NbtAPI.cpp +++ b/src/legacy/api/NbtAPI.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include using magic_enum::enum_cast; @@ -1973,7 +1974,7 @@ Local NbtStatic::parseSNBT(const Arguments& args) { try { auto tag = CompoundTag::fromSnbt(args[0].toStr()); - if (tag.has_value()) return NbtCompoundClass::pack(std::move(&tag.value())); + if (tag.has_value()) return NbtCompoundClass::pack(std::move(tag->clone())); else return Local(); } CATCH("Fail in parseSNBT!"); @@ -1985,8 +1986,8 @@ Local NbtStatic::parseBinaryNBT(const Arguments& args) { try { auto data = args[0].asByteBuffer(); - auto tag = CompoundTag::fromBinaryNbt(data.describeUtf8()); - if (tag.has_value()) return NbtCompoundClass::pack(std::move(&tag.value())); + auto tag = CompoundTag::fromBinaryNbt(std::string_view((char*)data.getRawBytes(), data.byteLength())); + if (tag.has_value()) return NbtCompoundClass::pack(std::move(tag->clone())); else return Local(); } CATCH("Fail in parseBinaryNBT!"); diff --git a/tooth.json b/tooth.json index 16e4fb93..75db4851 100644 --- a/tooth.json +++ b/tooth.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "github.com/LiteLDev/LegacyScriptEngine", - "version": "0.6.1", + "version": "0.6.2", "info": { "name": "LegacyScriptEngine", "description": "A plugin engine for running LLSE plugins on LeviLamina", @@ -12,7 +12,7 @@ ] }, "dependencies": { - "gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.6.1", - "gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.6.1" + "gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.6.2", + "gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.6.2" } } diff --git a/tooth.lua.json b/tooth.lua.json index df80c9cb..1b40b31e 100644 --- a/tooth.lua.json +++ b/tooth.lua.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-lua", - "version": "0.6.1", + "version": "0.6.2", "info": { "name": "LegacyScriptEngine with Lua backend", "description": "A plugin engine for running LLSE plugins on LeviLamina", diff --git a/tooth.nodejs.json b/tooth.nodejs.json index c8038a35..a6df519f 100644 --- a/tooth.nodejs.json +++ b/tooth.nodejs.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-nodejs", - "version": "0.6.1", + "version": "0.6.2", "info": { "name": "LegacyScriptEngine with NodeJs backend", "description": "A plugin engine for running LLSE plugins on LeviLamina", diff --git a/tooth.python.json b/tooth.python.json index 5195177c..9b4b7d51 100644 --- a/tooth.python.json +++ b/tooth.python.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-python", - "version": "0.6.1", + "version": "0.6.2", "info": { "name": "LegacyScriptEngine with Python backend", "description": "A plugin engine for running LLSE plugins on LeviLamina", diff --git a/tooth.quickjs.json b/tooth.quickjs.json index 4ec3d8d2..15546558 100644 --- a/tooth.quickjs.json +++ b/tooth.quickjs.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs", - "version": "0.6.1", + "version": "0.6.2", "info": { "name": "LegacyScriptEngine with QuickJs backend", "description": "A plugin engine for running LLSE plugins on LeviLamina",