Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
restore-keys: |
xmake-

- name: Setup LLVM
uses: ZhongRuoyu/setup-llvm@v0
with:
llvm-version: 22

- run: |
xmake repo -u

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
restore-keys: |
xmake-

- name: Setup LLVM
uses: ZhongRuoyu/setup-llvm@v0
with:
llvm-version: 22

- run: |
xmake repo -u

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src-addon/DebugShape.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

/**
Expand Down
12 changes: 11 additions & 1 deletion src/debug_shape/api/shape/IDebugShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,26 @@
#include <memory>
#include <optional>

struct PrimitiveShapeDataPayload;

namespace debug_shape {

namespace detail {
class DebugShapeDrawerImpl;
}


/**
* 调试形状
* @see
* 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;

Expand Down Expand Up @@ -53,4 +63,4 @@ class IDebugShape : public virtual IDrawer {
};


} // namespace debug_shape
} // namespace debug_shape
8 changes: 6 additions & 2 deletions src/debug_shape/api/shape/ShapeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

}
}
4 changes: 2 additions & 2 deletions src/debug_shape/detail/DebugShapeDrawerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void DebugShapeDrawerImpl::processShapes(
std::vector<PrimitiveShapeDataPayload> payloads;
payloads.reserve(shapes.size());
for (auto const* shape : shapes) {
if (auto* parent = dynamic_cast<DebugShapeImpl const*>(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;
Expand Down
4 changes: 4 additions & 0 deletions src/debug_shape/detail/shape/Assert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions src/debug_shape/detail/shape/DebugShapeImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec3> getLocation() const override;
Expand Down
6 changes: 3 additions & 3 deletions tooth.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format_version": 3,
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
"tooth": "github.com/engsr6982/DebugShape",
"version": "0.9.0",
"version": "0.10.0",
"info": {
"name": "DebugShape",
"description": "minecraft bedrock debug shape packet wrapper",
Expand All @@ -19,7 +19,7 @@
"label": "",
"platform": "win-x64",
"dependencies": {
"github.com/LiteLDev/LeviLamina": "26.20.*"
"github.com/LiteLDev/LeviLamina": "26.40.*"
},
"assets": [
{
Expand All @@ -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": [
{
Expand Down
4 changes: 2 additions & 2 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down