Compare commits
2 Commits
@@ -10,8 +10,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: xmake-io/github-action-setup-xmake@v1
|
||||
with:
|
||||
xmake-version: "2.9.9"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
|
||||
@@ -10,8 +10,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: xmake-io/github-action-setup-xmake@v1
|
||||
with:
|
||||
xmake-version: "2.9.9"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "GMLIB"
|
||||
},
|
||||
{
|
||||
"name": "ModAPI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <gmlib/gm/ui/CustomForm.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/thread/ServerThreadExecutor.h>
|
||||
#include <ll/api/utils/StringUtils.h>
|
||||
@@ -26,11 +24,13 @@
|
||||
#include <mc/world/level/block/WeirdoDirection.h>
|
||||
#include <mc/world/level/block/states/vanilla_states/VanillaStates.h>
|
||||
#include <mc/world/level/levelgen/structure/SensibleDirections.h>
|
||||
#include <modapi/item/CustomItemRegistry.h>
|
||||
#include <modapi/item/base/ICustomItem.h>
|
||||
#include <string>
|
||||
|
||||
namespace DebugStick {
|
||||
|
||||
class DebugStickItem : public gmlib::mod::ICustomItem {
|
||||
class DebugStickItem : public modapi::ICustomItem {
|
||||
public:
|
||||
enum class BlockUpdateFlag : uchar {
|
||||
None = 0,
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
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"; }
|
||||
|
||||
@@ -315,11 +315,11 @@ public:
|
||||
}();
|
||||
|
||||
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)) {
|
||||
title = fmt::format(
|
||||
"%{0}.name",
|
||||
block->mLegacyBlock->asItemInstance(*block, nullptr).mItem->getDescriptionId()
|
||||
block->mBlockType->asItemInstance(*block, nullptr).mItem->getDescriptionId()
|
||||
);
|
||||
}
|
||||
gmlib::ui::CustomForm form(title);
|
||||
@@ -353,6 +353,6 @@ public:
|
||||
} // namespace DebugStick
|
||||
|
||||
inline static auto GMLIB_CUSTOM_ITEM_DebugStickItem = []() -> bool {
|
||||
gmlib::mod::CustomItemRegistry::getInstance().registerItem<DebugStick::DebugStickItem>();
|
||||
modapi::CustomItemRegistry::getInstance().registerItem<DebugStick::DebugStickItem>();
|
||||
return true;
|
||||
}();
|
||||
+4
-3
@@ -2,7 +2,7 @@
|
||||
"format_version": 3,
|
||||
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
|
||||
"tooth": "github.com/GroupMountain/GMDebugStick",
|
||||
"version": "1.1.0",
|
||||
"version": "1.3.0",
|
||||
"info": {
|
||||
"name": "GMDebugStick",
|
||||
"description": "Register for a debug stick item",
|
||||
@@ -17,8 +17,9 @@
|
||||
"label": "",
|
||||
"platform": "win-x64",
|
||||
"dependencies": {
|
||||
"github.com/LiteLDev/LeviLamina": ">=1.3.0",
|
||||
"github.com/GroupMountain/GMLIB-Release": ">=1.3.0"
|
||||
"github.com/LiteLDev/LeviLamina": ">=1.5.0",
|
||||
"github.com/GroupMountain/GMLIB-Release": ">=1.5.0",
|
||||
"github.com/GroupMountain/ModAPI-Release": ">=0.1.0"
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
|
||||
@@ -3,9 +3,10 @@ add_rules("mode.debug", "mode.release")
|
||||
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
|
||||
add_repositories("groupmountain-repo https://github.com/GroupMountain/xmake-repo.git")
|
||||
|
||||
add_requires("levilamina 1.3.0", {configs = {target_type = "server"}})
|
||||
add_requires("levibuildscript 0.4.0")
|
||||
add_requires("gmlib 1.3.0")
|
||||
add_requires("levilamina 1.5.2", {configs = {target_type = "server"}})
|
||||
add_requires("levibuildscript 0.5.2")
|
||||
add_requires("gmlib 1.5.2")
|
||||
add_requires("modapi 0.1.1")
|
||||
|
||||
if not has_config("vs_runtime") then
|
||||
set_runtimes("MD")
|
||||
@@ -32,7 +33,8 @@ target("DebugStick")
|
||||
)
|
||||
add_packages(
|
||||
"levilamina",
|
||||
"gmlib"
|
||||
"gmlib",
|
||||
"modapi"
|
||||
)
|
||||
set_exceptions("none")
|
||||
set_kind("shared")
|
||||
|
||||
Reference in New Issue
Block a user