Compare commits
2 Commits
@@ -11,14 +11,6 @@ jobs:
|
|||||||
|
|
||||||
- uses: xmake-io/github-action-setup-xmake@v1
|
- uses: xmake-io/github-action-setup-xmake@v1
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/AppData/Local/.xmake
|
|
||||||
key: xmake-${{ hashFiles('xmake.lua') }}
|
|
||||||
restore-keys: |
|
|
||||||
xmake-
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
xmake repo -u
|
xmake repo -u
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
{
|
||||||
"name": "GMLIB"
|
"name": "GMLIB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ModAPI"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
#include <gmlib/gm/ui/CustomForm.h>
|
#include <gmlib/gm/ui/CustomForm.h>
|
||||||
#include <gmlib/mc/locale/I18nAPI.h>
|
#include <gmlib/mc/locale/I18nAPI.h>
|
||||||
#include <gmlib/mod/item/CustomItemRegistry.h>
|
|
||||||
#include <gmlib/mod/item/base/ICustomItem.h>
|
|
||||||
#include <ll/api/base/Containers.h>
|
#include <ll/api/base/Containers.h>
|
||||||
#include <ll/api/thread/ServerThreadExecutor.h>
|
#include <ll/api/thread/ServerThreadExecutor.h>
|
||||||
#include <ll/api/utils/StringUtils.h>
|
#include <ll/api/utils/StringUtils.h>
|
||||||
@@ -26,11 +24,13 @@
|
|||||||
#include <mc/world/level/block/WeirdoDirection.h>
|
#include <mc/world/level/block/WeirdoDirection.h>
|
||||||
#include <mc/world/level/block/states/vanilla_states/VanillaStates.h>
|
#include <mc/world/level/block/states/vanilla_states/VanillaStates.h>
|
||||||
#include <mc/world/level/levelgen/structure/SensibleDirections.h>
|
#include <mc/world/level/levelgen/structure/SensibleDirections.h>
|
||||||
|
#include <modapi/item/CustomItemRegistry.h>
|
||||||
|
#include <modapi/item/base/ICustomItem.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace DebugStick {
|
namespace DebugStick {
|
||||||
|
|
||||||
class DebugStickItem : public gmlib::mod::ICustomItem {
|
class DebugStickItem : public modapi::ICustomItem {
|
||||||
public:
|
public:
|
||||||
enum class BlockUpdateFlag : uchar {
|
enum class BlockUpdateFlag : uchar {
|
||||||
None = 0,
|
None = 0,
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
uint8_t getItemMaxStackSize() const override { return 1; }
|
uint8_t getItemMaxStackSize() const override { return 1; }
|
||||||
|
|
||||||
gmlib::mod::ItemIcon getIcon() const override { return "stick"; }
|
modapi::ItemIcon getIcon() const override { return modapi::ItemIcon{"stick"}; }
|
||||||
|
|
||||||
std::string getDisplayName() const override { return "item.debug_stick.name"; }
|
std::string getDisplayName() const override { return "item.debug_stick.name"; }
|
||||||
|
|
||||||
@@ -315,11 +315,11 @@ public:
|
|||||||
}();
|
}();
|
||||||
|
|
||||||
auto* block = (mEditBlocks[&player] = {pos, &player.getDimensionBlockSource().getBlock(pos)}).second;
|
auto* block = (mEditBlocks[&player] = {pos, &player.getDimensionBlockSource().getBlock(pos)}).second;
|
||||||
auto title = fmt::format("%{0}.name", block->mLegacyBlock->mDescriptionId.get());
|
auto title = fmt::format("%{0}.name", block->mBlockType->mDescriptionId.get());
|
||||||
if (gmlib::I18nAPI::get(title) == title.substr(1)) {
|
if (gmlib::I18nAPI::get(title) == title.substr(1)) {
|
||||||
title = fmt::format(
|
title = fmt::format(
|
||||||
"%{0}.name",
|
"%{0}.name",
|
||||||
block->mLegacyBlock->asItemInstance(*block, nullptr).mItem->getDescriptionId()
|
block->mBlockType->asItemInstance(*block, nullptr).mItem->getDescriptionId()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
gmlib::ui::CustomForm form(title);
|
gmlib::ui::CustomForm form(title);
|
||||||
@@ -353,6 +353,6 @@ public:
|
|||||||
} // namespace DebugStick
|
} // namespace DebugStick
|
||||||
|
|
||||||
inline static auto GMLIB_CUSTOM_ITEM_DebugStickItem = []() -> bool {
|
inline static auto GMLIB_CUSTOM_ITEM_DebugStickItem = []() -> bool {
|
||||||
gmlib::mod::CustomItemRegistry::getInstance().registerItem<DebugStick::DebugStickItem>();
|
modapi::CustomItemRegistry::getInstance().registerItem<DebugStick::DebugStickItem>();
|
||||||
return true;
|
return true;
|
||||||
}();
|
}();
|
||||||
+4
-3
@@ -2,7 +2,7 @@
|
|||||||
"format_version": 3,
|
"format_version": 3,
|
||||||
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
|
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
|
||||||
"tooth": "github.com/GroupMountain/GMDebugStick",
|
"tooth": "github.com/GroupMountain/GMDebugStick",
|
||||||
"version": "1.2.0",
|
"version": "1.4.0",
|
||||||
"info": {
|
"info": {
|
||||||
"name": "GMDebugStick",
|
"name": "GMDebugStick",
|
||||||
"description": "Register for a debug stick item",
|
"description": "Register for a debug stick item",
|
||||||
@@ -17,8 +17,9 @@
|
|||||||
"label": "",
|
"label": "",
|
||||||
"platform": "win-x64",
|
"platform": "win-x64",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"github.com/LiteLDev/LeviLamina": ">=1.4.0",
|
"github.com/LiteLDev/LeviLamina": ">=1.6.0",
|
||||||
"github.com/GroupMountain/GMLIB-Release": ">=1.4.0"
|
"github.com/GroupMountain/GMLIB-Release": ">=1.6.0",
|
||||||
|
"github.com/GroupMountain/ModAPI-Release": ">=0.2.1"
|
||||||
},
|
},
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ add_rules("mode.debug", "mode.release")
|
|||||||
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
|
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
|
||||||
add_repositories("groupmountain-repo https://github.com/GroupMountain/xmake-repo.git")
|
add_repositories("groupmountain-repo https://github.com/GroupMountain/xmake-repo.git")
|
||||||
|
|
||||||
add_requires("levilamina 1.4.0", {configs = {target_type = "server"}})
|
add_requires("levilamina 1.6.1", {configs = {target_type = "server"}})
|
||||||
add_requires("levibuildscript 0.4.1")
|
add_requires("levibuildscript 0.5.2")
|
||||||
add_requires("gmlib 1.4.0")
|
add_requires("gmlib 1.6.0")
|
||||||
|
add_requires("modapi 0.2.1")
|
||||||
|
|
||||||
if not has_config("vs_runtime") then
|
if not has_config("vs_runtime") then
|
||||||
set_runtimes("MD")
|
set_runtimes("MD")
|
||||||
@@ -32,7 +33,8 @@ target("DebugStick")
|
|||||||
)
|
)
|
||||||
add_packages(
|
add_packages(
|
||||||
"levilamina",
|
"levilamina",
|
||||||
"gmlib"
|
"gmlib",
|
||||||
|
"modapi"
|
||||||
)
|
)
|
||||||
set_exceptions("none")
|
set_exceptions("none")
|
||||||
set_kind("shared")
|
set_kind("shared")
|
||||||
|
|||||||
Reference in New Issue
Block a user