From 031d1be8b46e00e995197e386885875439f9e1d9 Mon Sep 17 00:00:00 2001 From: Yangyangzhong82 Date: Mon, 14 Sep 2026 14:30:14 +0800 Subject: [PATCH 1/3] feat: update shape types and version to 0.10.0, synchronize with LeviLamina 26.40 --- CHANGELOG.md | 5 +++++ src-addon/DebugShape.d.ts | 6 +++++- src/debug_shape/api/shape/IDebugShape.h | 12 +++++++++++- src/debug_shape/api/shape/ShapeType.h | 8 ++++++-- src/debug_shape/detail/DebugShapeDrawerImpl.cc | 4 ++-- src/debug_shape/detail/shape/Assert.cc | 4 ++++ src/debug_shape/detail/shape/DebugShapeImpl.h | 5 +++++ tooth.json | 6 +++--- xmake.lua | 4 ++-- 9 files changed, 43 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65b0d72..2dde30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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.10.0] - 2026-09-14 + +- supported bedrock server v1.26.40 (levilamina v26.40.x) +- synchronized primitive shape types with LeviLamina 26.40 + ## [0.9.0] - 2026-07-05 - supported bedrock server v1.26.20 (levilamina v26.20.x) diff --git a/src-addon/DebugShape.d.ts b/src-addon/DebugShape.d.ts index 7366a13..6b117c1 100644 --- a/src-addon/DebugShape.d.ts +++ b/src-addon/DebugShape.d.ts @@ -36,7 +36,11 @@ declare module "DebugShape.dll" { Circle = 3, Text = 4, Arrow = 5, - NumShapeTypes = 6, + Cylinder = 6, + Pyramid = 7, + Ellipsoid = 8, + Cone = 9, + NumShapeTypes = 10, } /** diff --git a/src/debug_shape/api/shape/IDebugShape.h b/src/debug_shape/api/shape/IDebugShape.h index 0de76bf..8fad025 100644 --- a/src/debug_shape/api/shape/IDebugShape.h +++ b/src/debug_shape/api/shape/IDebugShape.h @@ -9,9 +9,14 @@ #include #include +struct PrimitiveShapeDataPayload; namespace debug_shape { +namespace detail { +class DebugShapeDrawerImpl; +} + /** * 调试形状 @@ -19,6 +24,11 @@ namespace debug_shape { * https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/debug-utilities/debugshape?view=minecraft-bedrock-experimental */ class IDebugShape : public virtual IDrawer { +private: + virtual PrimitiveShapeDataPayload const* getPayloadForDrawer() const { return nullptr; } + + friend class detail::DebugShapeDrawerImpl; + public: virtual ShapeID getShapeID() const = 0; @@ -53,4 +63,4 @@ class IDebugShape : public virtual IDrawer { }; -} // namespace debug_shape \ No newline at end of file +} // namespace debug_shape diff --git a/src/debug_shape/api/shape/ShapeType.h b/src/debug_shape/api/shape/ShapeType.h index d8f7a6f..a8346dc 100644 --- a/src/debug_shape/api/shape/ShapeType.h +++ b/src/debug_shape/api/shape/ShapeType.h @@ -10,7 +10,11 @@ enum class ShapeType : uchar { Circle = 3, Text = 4, Arrow = 5, - NumShapeTypes = 6, + Cylinder = 6, + Pyramid = 7, + Ellipsoid = 8, + Cone = 9, + NumShapeTypes = 10, }; -} \ No newline at end of file +} diff --git a/src/debug_shape/detail/DebugShapeDrawerImpl.cc b/src/debug_shape/detail/DebugShapeDrawerImpl.cc index f4bc12e..871de38 100644 --- a/src/debug_shape/detail/DebugShapeDrawerImpl.cc +++ b/src/debug_shape/detail/DebugShapeDrawerImpl.cc @@ -68,8 +68,8 @@ void DebugShapeDrawerImpl::processShapes( std::vector payloads; payloads.reserve(shapes.size()); for (auto const* shape : shapes) { - if (auto* parent = dynamic_cast(shape)) { - payloads.push_back(remove ? emptyCloneWithId(parent->getPayload()) : parent->getPayload()); + if (auto const* payload = shape->getPayloadForDrawer()) { + payloads.push_back(remove ? emptyCloneWithId(*payload) : *payload); } } return payloads; diff --git a/src/debug_shape/detail/shape/Assert.cc b/src/debug_shape/detail/shape/Assert.cc index 97b01a6..0417539 100644 --- a/src/debug_shape/detail/shape/Assert.cc +++ b/src/debug_shape/detail/shape/Assert.cc @@ -20,6 +20,10 @@ static_assert(ShapeType::Sphere == ScriptModuleMinecraft::ScriptPrimitiveShapeTy static_assert(ShapeType::Circle == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Circle); static_assert(ShapeType::Text == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Text); static_assert(ShapeType::Arrow == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Arrow); +static_assert(ShapeType::Cylinder == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Cylinder); +static_assert(ShapeType::Pyramid == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Pyramid); +static_assert(ShapeType::Ellipsoid == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Ellipsoid); +static_assert(ShapeType::Cone == ScriptModuleMinecraft::ScriptPrimitiveShapeType::Cone); static_assert(ShapeType::NumShapeTypes == ScriptModuleMinecraft::ScriptPrimitiveShapeType::NumShapeTypes); } // namespace debug_shape diff --git a/src/debug_shape/detail/shape/DebugShapeImpl.h b/src/debug_shape/detail/shape/DebugShapeImpl.h index bed001d..2f298e7 100644 --- a/src/debug_shape/detail/shape/DebugShapeImpl.h +++ b/src/debug_shape/detail/shape/DebugShapeImpl.h @@ -16,6 +16,11 @@ class DebugShapeImpl : public virtual IDebugShape { [[nodiscard]] PrimitiveShapeDataPayload const& getPayload() const; +private: + PrimitiveShapeDataPayload const* getPayloadForDrawer() const override { return &payload_; } + +public: + ShapeID getShapeID() const override; ShapeType getShapeType() const override; std::optional getLocation() const override; diff --git a/tooth.json b/tooth.json index 51501f5..8dd98f7 100644 --- a/tooth.json +++ b/tooth.json @@ -3,7 +3,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/engsr6982/DebugShape", - "version": "0.8.0", + "version": "0.10.0", "info": { "name": "DebugShape", "description": "minecraft bedrock debug shape packet wrapper", @@ -19,7 +19,7 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/LiteLDev/LeviLamina": "26.20.*" + "github.com/LiteLDev/LeviLamina": "26.40.*" }, "assets": [ { @@ -41,7 +41,7 @@ "label": "client", "platform": "win-x64", "dependencies": { - "github.com/LiteLDev/LeviLamina#client": "26.20.*" + "github.com/LiteLDev/LeviLamina#client": "26.40.*" }, "assets": [ { diff --git a/xmake.lua b/xmake.lua index ce754c1..2cf18da 100644 --- a/xmake.lua +++ b/xmake.lua @@ -6,9 +6,9 @@ add_repositories("levimc-repo https://github.com/LiteLDev/xmake-repo.git") -- add_requires("levilamina develop") to use develop version -- please note that you should add bdslibrary yourself if using dev version if is_config("target_type", "server") then - add_requires("levilamina 26.20.0", {configs = {target_type = "server"}}) + add_requires("levilamina 26.40.2", {configs = {target_type = "server"}}) else - add_requires("levilamina 26.20.0", {configs = {target_type = "client"}}) + add_requires("levilamina 26.40.2", {configs = {target_type = "client"}}) end add_requires("levibuildscript") From 14dbd82fae8037f3113931195e037445609792d2 Mon Sep 17 00:00:00 2001 From: engsr6982 <109733049+engsr6982@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:34:20 +0800 Subject: [PATCH 2/3] Add LLVM setup step to build workflow Added a step to set up LLVM version 22 in the build workflow. --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 053e8fc..98cf82b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,11 @@ jobs: restore-keys: | xmake- + - name: Setup LLVM + uses: ZhongRuoyu/setup-llvm@v0 + with: + llvm-version: 22 + - run: | xmake repo -u From 094281e00fcb085ab2b6780e7b9ce665a9d3ebcf Mon Sep 17 00:00:00 2001 From: engsr6982 <109733049+engsr6982@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:34:47 +0800 Subject: [PATCH 3/3] Setup LLVM version 22 in release workflow Add LLVM setup step to release workflow --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f1b6ff..6eac15c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,11 @@ jobs: restore-keys: | xmake- + - name: Setup LLVM + uses: ZhongRuoyu/setup-llvm@v0 + with: + llvm-version: 22 + - run: | xmake repo -u