From 8729d7113331280ba191d48f24059e2c2594bcc5 Mon Sep 17 00:00:00 2001 From: killcerr Date: Sat, 22 Mar 2025 23:32:42 +0800 Subject: [PATCH 01/24] feat: adapt LeviLamin 1.1.1 & GMLIB 1.0.0-rc.3 --- .clangd | 24 +++++++++++++++--- src/Features/Clean.cpp | 21 ++++++++++------ src/Features/CleanTask.cpp | 24 ++++++++++-------- src/Features/Events.cpp | 51 +++++++++++++++++--------------------- src/Features/Helper.cpp | 4 +-- src/Global.h | 6 ++++- src/Mod.cpp | 8 +++--- src/RegisterCommand.cpp | 29 +++++++++++----------- xmake.lua | 5 +++- 9 files changed, 99 insertions(+), 73 deletions(-) diff --git a/.clangd b/.clangd index 40ad7a5..4785d56 100644 --- a/.clangd +++ b/.clangd @@ -1,5 +1,23 @@ Diagnostics: - Suppress: ["-Wmicrosoft-enum-forward-reference", "-Wc++11-narrowing", "-Wc++2b-extensions", "-Wmicrosoft-cast"] + Suppress: + - "-Wmicrosoft-enum-forward-reference" + - "-Wc++11-narrowing" + - "-Wc++2b-extensions" + - "-Wmicrosoft-cast" + - "-Wcxx20_deducing_this" + - "-Wundefined_internal_type" + - "-Wincomplete_member_access" + - "-Wsizeof_alignof_incomplete_or_sizeless_type" + - "-Wexplicit_spec_non_template" + - "-Wovl_no_viable_function_in_init" CompileFlags: - Add: ["-ferror-limit=0", "-D__FUNCTION__=\"dummy\"", "-D_CRT_USE_BUILTIN_OFFSETOF", "-std=c++23"] - Remove: ["/Yu_HeaderOutputPredefine.h", "/FI_HeaderOutputPredefine.h"] + Add: + - "-Xclang" + - "-triple=x86_64-windows-msvc" + - "-ferror-limit=0" + - '-D__FUNCTION__="dummy"' + - "-Dnsel_CONFIG_SELECT_EXPECTED=nsel_EXPECTED_NONSTD" + - "-Xclang" + - "-std=c++23" + Remove: + - "-std" \ No newline at end of file diff --git a/src/Features/Clean.cpp b/src/Features/Clean.cpp index 43485fb..2494241 100644 --- a/src/Features/Clean.cpp +++ b/src/Features/Clean.cpp @@ -1,4 +1,5 @@ #include "Cleaner.h" +#include "mc/world/actor/provider/SynchedActorDataAccess.h" namespace Cleaner { @@ -15,9 +16,11 @@ bool isMatch(std::string& A, std::string& B) { return (A == B); } -bool shouldIgnore(GMLIB_Actor* ac) { - if (ac->isMob() || ac->isItemActor()) { - if (ac->isTame() || ac->isTrusting() || ac->getNameTag() != "" || ac->hasTag("cleaner:ignore")) { +bool isTrust(Actor* ac) { return SynchedActorDataAccess::getActorFlag(ac->getEntityContext(), ::ActorFlags::Trusting); } + +bool shouldIgnore(gmlib::world::actor::GMActor* ac) { + if (ac->hasCategory(::ActorCategory::Mob) || ac->hasCategory(::ActorCategory::Item)) { + if (ac->isTame() || isTrust(ac) || ac->getNameTag() != "" || ac->hasTag("cleaner:ignore")) { return true; } } @@ -27,7 +30,7 @@ bool shouldIgnore(GMLIB_Actor* ac) { bool ShouldClean(Actor* actor) { // Players auto& config = Cleaner::Entry::getInstance().getConfig(); - auto en = (GMLIB_Actor*)actor; + auto en = (gmlib::world::actor::GMActor*)actor; if (en->isPlayer() || shouldIgnore(en)) { return false; } @@ -38,7 +41,7 @@ bool ShouldClean(Actor* actor) { } } // Items - if (en->isItemActor()) { + if (en->hasCategory(::ActorCategory::Item)) { if (config.CleanItem.Enabled) { auto itac = (ItemActor*)en; if (itac->age() <= config.CleanItem.ExistTicks) { @@ -56,7 +59,7 @@ bool ShouldClean(Actor* actor) { return false; } // Mobs - else if (en->isMob()) { + else if (en->hasCategory(::ActorCategory::Mob)) { if (config.CleanMobs.Enabled) { auto blacklist = config.CleanMobs.BlackList; for (auto& key : blacklist) { @@ -94,8 +97,9 @@ bool ShouldClean(Actor* actor) { } int ExecuteClean() { + auto level = ll::service::getLevel(); int clean_count = 0; - auto all_entities = GMLIB_Level::getLevel()->getRuntimeActorList(); + auto all_entities = level->getRuntimeActorList(); for (auto entity : all_entities) { if (ShouldClean(entity)) { entity->despawn(); @@ -106,8 +110,9 @@ int ExecuteClean() { } int CountEntities() { + auto level = ll::service::getLevel(); int clean_count = 0; - auto all_entities = GMLIB_Level::getLevel()->getRuntimeActorList(); + auto all_entities = level->getRuntimeActorList(); for (auto* entity : all_entities) { if (ShouldClean(entity)) { clean_count++; diff --git a/src/Features/CleanTask.cpp b/src/Features/CleanTask.cpp index 9972055..1ae4354 100644 --- a/src/Features/CleanTask.cpp +++ b/src/Features/CleanTask.cpp @@ -10,11 +10,11 @@ static std::shared_ptr mCleanTaskTPS = std::make_shared(false); bool auto_clean_triggerred = false; void CleanTask() { - auto& config = Cleaner::Entry::getInstance().getConfig(); - auto time = config.Basic.Notice1; - auto announce_time = config.Basic.Notice2; - auto time_1 = std::chrono::seconds::duration(time); - auto time_2 = std::chrono::seconds::duration(time - announce_time); + auto& config = Cleaner::Entry::getInstance().getConfig(); + auto time = config.Basic.Notice1; + auto announce_time = config.Basic.Notice2; + std::chrono::seconds time_1(time); + std::chrono::seconds time_2(time - announce_time); if (config.Basic.ConsoleLog) { ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->info( tr("cleaner.output.count1", {S(time_1.count())}) @@ -59,7 +59,7 @@ void CleanTask() { } void AutoCleanTask(int seconds) { - auto time = std::chrono::seconds::duration(seconds); + std::chrono::seconds time(seconds); *mAutoCleanTask = true; ll::coro::keepThis([time]() -> ll::coro::CoroTask<> { while (true) { @@ -72,7 +72,7 @@ void AutoCleanTask(int seconds) { } void CleanTaskCount(int max_entities) { - auto& config = Cleaner::Entry::getInstance().getConfig(); + auto& config = Cleaner::Entry::getInstance().getConfig(); *mCleanTaskCount = true; ll::coro::keepThis([max_entities, &config]() -> ll::coro::CoroTask<> { while (true) { @@ -83,7 +83,9 @@ void CleanTaskCount(int max_entities) { if (count >= max_entities) { auto_clean_triggerred = true; if (config.Basic.ConsoleLog) { - ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->warn(tr("cleaner.output.triggerAutoCleanCount", {S(count)})); + ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->warn( + tr("cleaner.output.triggerAutoCleanCount", {S(count)}) + ); } if (config.Basic.SendBroadcast) { Helper::broadcastMessage(tr("cleaner.output.triggerAutoCleanCount", {S(count)})); @@ -100,16 +102,16 @@ void CleanTaskCount(int max_entities) { } void CleanTaskTPS(float min_tps) { - auto& config = Cleaner::Entry::getInstance().getConfig(); + auto& config = Cleaner::Entry::getInstance().getConfig(); *mCleanTaskTPS = true; ll::coro::keepThis([min_tps, &config]() -> ll::coro::CoroTask<> { while (true) { co_await 10s; if (*mCleanTaskTPS == false) co_return; if (auto_clean_triggerred == false) { - if (GMLIB_Level::getLevel()->getServerAverageTps() <= min_tps) { + if (gmlib::world::GMLevel::getInstance()->getServerAverageTps() <= min_tps) { auto_clean_triggerred = true; - auto mspt = S(GMLIB_Level::getLevel()->getServerAverageTps()); + auto mspt = S(gmlib::world::GMLevel::getInstance()->getServerAverageTps()); if (config.Basic.ConsoleLog) { ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->warn( tr("cleaner.output.triggerAutoCleanTps", {mspt}) diff --git a/src/Features/Events.cpp b/src/Features/Events.cpp index 74db49f..c278441 100644 --- a/src/Features/Events.cpp +++ b/src/Features/Events.cpp @@ -1,44 +1,39 @@ #include "Cleaner.h" namespace Cleaner { - -void setShouldIgnore(GMLIB_Actor* ac) { ac->addTag("cleaner:ignore"); } +void setShouldIgnore(gmlib::world::actor::GMActor* ac) { ac->addTag("cleaner:ignore"); } void ListenEvents() { auto& eventBus = ll::event::EventBus::getInstance(); auto& config = Cleaner::Entry::getInstance().getConfig(); // ItemSpawnEvent - eventBus.emplaceListener( - [&config](GMLIB::Event::EntityEvent::ItemActorSpawnAfterEvent& event) { - auto& item = event.getItemActor(); - if (event.getSpawner().has_value()) { - auto pl = (GMLIB_Player*)event.getSpawner().as_ptr(); - if (pl->isPlayer() && !pl->isAlive()) { // Death Drop - auto ac = (GMLIB_Actor*)&item; - setShouldIgnore(ac); + eventBus.emplaceListener([&config](ila::mc::SpawnItemActorAfterEvent& event) { + auto& item = event.itemActor(); + if (event.spawner()) { + auto pl = (gmlib::world::actor::GMPlayer*)event.spawner(); + if (pl->isPlayer() && !pl->isAlive()) { // Death Drop + auto ac = (gmlib::world::actor::GMActor*)&item; + setShouldIgnore(ac); + return; + } + } + if (config.ItemDespawn.Enabled) { + item->lifeTime() = config.ItemDespawn.DespawnTime; + auto list = config.ItemDespawn.WhiteList; + auto type = item->item().getTypeName(); + for (auto& key : list) { + if (isMatch(type, key)) { return; } } - if (config.ItemDespawn.Enabled) { - item.lifeTime() = config.ItemDespawn.DespawnTime; - auto list = config.ItemDespawn.WhiteList; - auto type = item.item().getTypeName(); - for (auto& key : list) { - if (isMatch(type, key)) { - return; - } - } - item.lifeTime() = config.ItemDespawn.DespawnTime; - } + item->lifeTime() = config.ItemDespawn.DespawnTime; } - ); + }); // MobTakeItemEvent - eventBus.emplaceListener( - [](GMLIB::Event::EntityEvent::MobPickupItemAfterEvent& event) { - auto mob = (GMLIB_Actor*)&event.self(); - setShouldIgnore(mob); - } - ); + eventBus.emplaceListener([](ila::mc::ActorPickupItemAfterEvent& event) { + auto mob = (gmlib::world::actor::GMActor*)&event.self(); + setShouldIgnore(mob); + }); } } // namespace Cleaner \ No newline at end of file diff --git a/src/Features/Helper.cpp b/src/Features/Helper.cpp index 8805e3a..5b2c4ba 100644 --- a/src/Features/Helper.cpp +++ b/src/Features/Helper.cpp @@ -3,11 +3,11 @@ namespace Helper { void broadcastMessage(std::string_view msg) { - GMLIB_Level::getInstance()->broadcast(tr("cleaner.info.prefix") + std::string(msg)); + gmlib::world::GMLevel::getInstance()->broadcast(tr("cleaner.info.prefix") + std::string(msg)); } void broadcastToast(std::string_view msg) { - GMLIB_Level::getInstance()->broadcastToast(tr("cleaner.info.prefix"), msg); + gmlib::world::GMLevel::getInstance()->broadcastToast(tr("cleaner.info.prefix"), msg); } } // namespace Helper \ No newline at end of file diff --git a/src/Global.h b/src/Global.h index 6a89157..7ec39a7 100644 --- a/src/Global.h +++ b/src/Global.h @@ -1,7 +1,11 @@ #pragma once +// IWYU pragma: begin_exports #include "Mod.h" -#include +#include "gmlib/include_lib.h" +#include "gmlib/include_ll.h" +#include "ila/include_all.h" #include +// IWYU pragma: end_exports #define S(x) std::to_string(x) diff --git a/src/Mod.cpp b/src/Mod.cpp index f6e0e15..44e97ba 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -16,9 +16,9 @@ bool Entry::enable() { mConfig.emplace(); ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json"); saveConfig(); - I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "en_US", en_US); - I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "zh_CN", zh_CN); - I18nAPI::loadLanguagesFromDirectory(getSelf().getLangDir()); + gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "en_US", en_US); + gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "zh_CN", zh_CN); + gmlib::locale::I18nAPI::loadLanguagesFromDirectory(getSelf().getLangDir()); Cleaner::ListenEvents(); RegisterCommands(); Cleaner::loadCleaner(); @@ -43,5 +43,5 @@ void Entry::saveConfig() { ll::config::saveConfig(*mConfig, getSelf().getConfigD LL_REGISTER_MOD(Cleaner::Entry, Cleaner::Entry::getInstance()); std::string tr(std::string const& key, std::vector const& params) { - return I18nAPI::get(key, params, Cleaner::Entry::getInstance().getConfig().language); + return gmlib::locale::I18nAPI::get(key, params); } diff --git a/src/RegisterCommand.cpp b/src/RegisterCommand.cpp index ebd7eb1..1bc5aec 100644 --- a/src/RegisterCommand.cpp +++ b/src/RegisterCommand.cpp @@ -15,10 +15,8 @@ void RegCleanerCommand() { tr("cleaner.command.cleaner"), CommandPermissionLevel::GameDirectors ); - cmd.overload() - .required("despawn") - .required("entity") - .execute([&](CommandOrigin const& origin, CommandOutput& output, CleanerParam const& param) { + cmd.overload().required("despawn").required("entity").execute( + [&](CommandOrigin const& origin, CommandOutput& output, CleanerParam const& param) { auto ens = param.entity.results(origin); if (ens.empty()) { return output.error(tr("cleaner.command.error.noTarget")); @@ -27,10 +25,10 @@ void RegCleanerCommand() { en->despawn(); } return output.success(tr("cleaner.command.despawnSuccess", {S(ens.size())})); - }); - cmd.overload() - .required("action") - .execute([&](CommandOrigin const& origin, CommandOutput& output, CleanerParam const& param) { + } + ); + cmd.overload().required("action").execute( + [&](CommandOrigin const& origin, CommandOutput& output, CleanerParam const& param) { switch (param.action) { case CleanerParam::Action::clean: { Cleaner::CleanTask(); @@ -46,15 +44,15 @@ void RegCleanerCommand() { return output.success(tr("cleaner.command.clean.output")); } case CleanerParam::Action::tps: { - return output.success(tr( - "cleaner.command.tps.output", - {S(GMLIB_Level::getLevel()->getServerCurrentTps()), - S(GMLIB_Level::getLevel()->getServerAverageTps())} - )); + return output.success( + tr("cleaner.command.tps.output", + {S(gmlib::world::GMLevel::getInstance()->getServerCurrentTps()), + S(gmlib::world::GMLevel::getInstance()->getServerAverageTps())}) + ); } case CleanerParam::Action::mspt: { return output.success( - tr("cleaner.command.mspt.output", {S(GMLIB_Level::getLevel()->getServerMspt())}) + tr("cleaner.command.mspt.output", {S(gmlib::world::GMLevel::getInstance()->getServerMspt())}) ); } case CleanerParam::Action::reload: { @@ -62,7 +60,8 @@ void RegCleanerCommand() { return output.success(tr("cleaner.output.reload")); } } - }); + } + ); cmd.overload() .required("despawntime") .required("ticks") diff --git a/xmake.lua b/xmake.lua index 3c28635..d415a20 100644 --- a/xmake.lua +++ b/xmake.lua @@ -2,6 +2,7 @@ add_rules("mode.debug", "mode.release", "mode.releasedbg") add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git") add_repositories("groupmountain-repo https://github.com/GroupMountain/xmake-repo.git") +add_repositories("miracleforest https://github.com/MiracleForest/xmake-repo") if not has_config("vs_runtime") then set_runtimes("MD") @@ -11,6 +12,7 @@ end add_requires("levilamina") add_requires("levibuildscript") add_requires("gmlib") +add_requires("ilistenattentively") target("Cleaner") -- Change this to your mod name. add_cxflags( @@ -25,7 +27,8 @@ target("Cleaner") -- Change this to your mod name. ) add_packages( "levilamina", - "gmlib" + "gmlib", + "ilistenattentively" ) add_defines( "NOMINMAX", -- 2.52.0 From 5db0517bc5ad6e07ef257fcafe4fedd639f89776 Mon Sep 17 00:00:00 2001 From: killcerr Date: Sat, 22 Mar 2025 23:38:08 +0800 Subject: [PATCH 02/24] feat: update tooth.json --- tooth.json | 66 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/tooth.json b/tooth.json index cd0e3cb..7e1aa82 100644 --- a/tooth.json +++ b/tooth.json @@ -1,28 +1,48 @@ { - "format_version": 2, - "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.3", - "info": { - "name": "Cleaner", - "description": "A Powerful Entities Cleaning up Mod for BDS", - "author": "GroupMountain", - "source": "github.com/GroupMountain/Cleaner", - "tags": [ - "levilamina", - "cleaner", - "gmlib" - ] - }, - "asset_url": "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.3/Cleaner-windows-x64.zip", - "dependencies": { - "github.com/GroupMountain/GMLIB": ">=0.13.10" - }, - "files": { - "place": [ + "format_version": 3, + "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", + "tooth": "github.com/GroupMountain/Cleaner", + "version": "0.13.4", + "info": { + "name": "Cleaner", + "description": "A Powerful Entities Cleaning up Mod for BDS", + "tags": ["levilamina", "cleaner", "gmlib"], + "avatar_url": "" + }, + "variants": [ + { + "label": "", + "platform": "win-x64", + "dependencies": { + "github.com/GroupMountain/GMLIB": ">= 1.0.0" + }, + "assets": [ + { + "type": "zip", + "urls": [ + "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.4/Cleaner-windows-x64.zip" + ], + "placements": [ { - "src": "Cleaner/*", - "dest": "mods/Cleaner" + "type": "dir", + "src": "Cleaner/", + "dest": "plugins/Cleaner" } - ] + ] + } + ], + "preserve_files": [], + "remove_files": [], + "scripts": { + "pre_install": [], + "install": [], + "post_install": [], + "pre_pack": [], + "post_pack": [], + "pre_uninstall": [], + "uninstall": [], + "post_uninstall": [] + } } + ] } -- 2.52.0 From d30492de188ace8531c70c0b7c19f4593e65c9ba Mon Sep 17 00:00:00 2001 From: killcerr Date: Sat, 22 Mar 2025 23:39:40 +0800 Subject: [PATCH 03/24] chore: change dest dir --- tooth.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooth.json b/tooth.json index 7e1aa82..c289165 100644 --- a/tooth.json +++ b/tooth.json @@ -26,7 +26,7 @@ { "type": "dir", "src": "Cleaner/", - "dest": "plugins/Cleaner" + "dest": "mods/Cleaner" } ] } -- 2.52.0 From d1c57e370940896d403182ed9aa0cd1dcbe13e0e Mon Sep 17 00:00:00 2001 From: killcerr Date: Sat, 22 Mar 2025 23:40:13 +0800 Subject: [PATCH 04/24] feat: update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index ab0097b..1335a9a 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.3", + "version": "0.13.4", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ -- 2.52.0 From 9e5ab459538dd98926c6f9ecf2049cedb36d5487 Mon Sep 17 00:00:00 2001 From: killcerr Date: Sun, 23 Mar 2025 03:19:45 -0700 Subject: [PATCH 05/24] fix: add ila as a dependence --- tooth.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tooth.json b/tooth.json index c289165..2087103 100644 --- a/tooth.json +++ b/tooth.json @@ -14,7 +14,8 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">= 1.0.0" + "github.com/GroupMountain/GMLIB": ">= 1.0.0", + "github.com/MiracleForest/iListenAttentively-Release": ">= 0.4.0" }, "assets": [ { -- 2.52.0 From 5bca67d884bab2bfad41751391591ab2e6aadbf0 Mon Sep 17 00:00:00 2001 From: EpsilonZunsat <2748716171@qq.com> Date: Tue, 25 Mar 2025 19:40:55 +0800 Subject: [PATCH 06/24] feat: add UnloadActorClean --- src/Config.h | 5 +++++ src/Features/Cleaner.cpp | 3 +++ src/Features/Cleaner.h | 6 ++++++ src/Features/UnloadActorClean.cpp | 19 +++++++++++++++++++ src/Mod.cpp | 1 + 5 files changed, 34 insertions(+) create mode 100644 src/Features/UnloadActorClean.cpp diff --git a/src/Config.h b/src/Config.h index 5507bd8..a7abf3d 100644 --- a/src/Config.h +++ b/src/Config.h @@ -91,5 +91,10 @@ struct Config { int CheckDelay = 30; int Percentage = 50; } VoteClean; + + struct Unload_Actor_Clean { + bool Enabled = false; + std::vector CleanList = {"minecraft:iron_golem", "minecraft:zombie_pigman"}; + } UnloadActorClean; }; } // namespace Cleaner \ No newline at end of file diff --git a/src/Features/Cleaner.cpp b/src/Features/Cleaner.cpp index 2b4782d..e23caf6 100644 --- a/src/Features/Cleaner.cpp +++ b/src/Features/Cleaner.cpp @@ -4,6 +4,9 @@ namespace Cleaner { void loadCleaner() { auto& config = Cleaner::Entry::getInstance().getConfig(); + if(config.UnloadActorClean.Enabled){ + UnloadActorClean::cleanUnloadActor(); + } if (config.ScheduleClean.Enabled) { Cleaner::AutoCleanTask(config.ScheduleClean.CleanInterval); } diff --git a/src/Features/Cleaner.h b/src/Features/Cleaner.h index ea13f4d..a8f52ee 100644 --- a/src/Features/Cleaner.h +++ b/src/Features/Cleaner.h @@ -26,4 +26,10 @@ namespace VoteClean { extern void voteCommandExecute(Player* pl); +} + +namespace UnloadActorClean { + +extern void cleanUnloadActor(); + } \ No newline at end of file diff --git a/src/Features/UnloadActorClean.cpp b/src/Features/UnloadActorClean.cpp new file mode 100644 index 0000000..267a78b --- /dev/null +++ b/src/Features/UnloadActorClean.cpp @@ -0,0 +1,19 @@ +#include "Cleaner.h" +#include "Global.h" +#include "gmlib/mc/world/actor/UnloadedActor.h" + +namespace UnloadActorClean { +void cleanUnloadActor() { + auto& config = Cleaner::Entry::getInstance().getConfig(); + gmlib::world::actor::UnloadedActor::foreachUnloadedActor( + [config](gmlib::world::actor::UnloadedActor& actor) -> bool { + for (auto& actorname : config.UnloadActorClean.CleanList) { + if (actor.getTypeName() == actorname) { + actor.remove(); + } + } + return true; + } + ); +} +} // namespace UnloadActorClean \ No newline at end of file diff --git a/src/Mod.cpp b/src/Mod.cpp index 44e97ba..f4fb2a2 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -15,6 +15,7 @@ bool Entry::load() { return true; } bool Entry::enable() { mConfig.emplace(); ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json"); + saveConfig(); gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "en_US", en_US); gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "zh_CN", zh_CN); -- 2.52.0 From a3a3c103fbdd919583fbd9ce4d675c123808820e Mon Sep 17 00:00:00 2001 From: zimuya4153 Date: Mon, 14 Apr 2025 22:44:24 +0800 Subject: [PATCH 07/24] feat: adapt gmlib 1.0.0 --- README.md | 7 +++++++ manifest.json | 5 ++++- src/Features/Clean.cpp | 4 ++-- src/Features/CleanTask.cpp | 4 ++-- src/Features/Events.cpp | 14 +++++++------- src/Features/Helper.cpp | 4 ++-- src/Features/UnloadActorClean.cpp | 4 ++-- src/Mod.cpp | 16 ++++++++++------ src/RegisterCommand.cpp | 6 +++--- tooth.json | 18 +++++++++++------- xmake.lua | 16 +++++++--------- 11 files changed, 57 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 5866098..f04148c 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,13 @@ "Cooldown": 120, // 投票冷却时间 单位:秒 "CheckDelay": 30, // 投票时长 单位:秒 "Percentage": 50 // 投票百分比(大于此值则清理) + }, + "UnloadActorClean": { // 离线实体清理 + "Enabled": false, // 是否启用 + "CleanList": [ // 清理实体列表 + "minecraft:iron_golem", // 铁傀儡 + "minecraft:zombie_pigman" // 僵尸猪灵 + ] } } ``` diff --git a/manifest.json b/manifest.json index 1335a9a..86ff7c0 100644 --- a/manifest.json +++ b/manifest.json @@ -2,12 +2,15 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.4", + "version": "0.13.5", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ { "name": "GMLIB" + }, + { + "name": "iListenAttentively" } ] } diff --git a/src/Features/Clean.cpp b/src/Features/Clean.cpp index 2494241..f5a31d0 100644 --- a/src/Features/Clean.cpp +++ b/src/Features/Clean.cpp @@ -18,7 +18,7 @@ bool isMatch(std::string& A, std::string& B) { bool isTrust(Actor* ac) { return SynchedActorDataAccess::getActorFlag(ac->getEntityContext(), ::ActorFlags::Trusting); } -bool shouldIgnore(gmlib::world::actor::GMActor* ac) { +bool shouldIgnore(gmlib::GMActor* ac) { if (ac->hasCategory(::ActorCategory::Mob) || ac->hasCategory(::ActorCategory::Item)) { if (ac->isTame() || isTrust(ac) || ac->getNameTag() != "" || ac->hasTag("cleaner:ignore")) { return true; @@ -30,7 +30,7 @@ bool shouldIgnore(gmlib::world::actor::GMActor* ac) { bool ShouldClean(Actor* actor) { // Players auto& config = Cleaner::Entry::getInstance().getConfig(); - auto en = (gmlib::world::actor::GMActor*)actor; + auto en = (gmlib::GMActor*)actor; if (en->isPlayer() || shouldIgnore(en)) { return false; } diff --git a/src/Features/CleanTask.cpp b/src/Features/CleanTask.cpp index 1ae4354..b19e8a8 100644 --- a/src/Features/CleanTask.cpp +++ b/src/Features/CleanTask.cpp @@ -109,9 +109,9 @@ void CleanTaskTPS(float min_tps) { co_await 10s; if (*mCleanTaskTPS == false) co_return; if (auto_clean_triggerred == false) { - if (gmlib::world::GMLevel::getInstance()->getServerAverageTps() <= min_tps) { + if (gmlib::GMLevel::getInstance()->getServerAverageTps() <= min_tps) { auto_clean_triggerred = true; - auto mspt = S(gmlib::world::GMLevel::getInstance()->getServerAverageTps()); + auto mspt = S(gmlib::GMLevel::getInstance()->getServerAverageTps()); if (config.Basic.ConsoleLog) { ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->warn( tr("cleaner.output.triggerAutoCleanTps", {mspt}) diff --git a/src/Features/Events.cpp b/src/Features/Events.cpp index c278441..2c34e68 100644 --- a/src/Features/Events.cpp +++ b/src/Features/Events.cpp @@ -1,7 +1,7 @@ #include "Cleaner.h" namespace Cleaner { -void setShouldIgnore(gmlib::world::actor::GMActor* ac) { ac->addTag("cleaner:ignore"); } +void setShouldIgnore(gmlib::GMActor* ac) { ac->addTag("cleaner:ignore"); } void ListenEvents() { auto& eventBus = ll::event::EventBus::getInstance(); @@ -10,28 +10,28 @@ void ListenEvents() { eventBus.emplaceListener([&config](ila::mc::SpawnItemActorAfterEvent& event) { auto& item = event.itemActor(); if (event.spawner()) { - auto pl = (gmlib::world::actor::GMPlayer*)event.spawner(); + auto pl = (gmlib::GMPlayer*)event.spawner(); if (pl->isPlayer() && !pl->isAlive()) { // Death Drop - auto ac = (gmlib::world::actor::GMActor*)&item; + auto ac = (gmlib::GMActor*)&item; setShouldIgnore(ac); return; } } if (config.ItemDespawn.Enabled) { - item->lifeTime() = config.ItemDespawn.DespawnTime; + item.lifeTime() = config.ItemDespawn.DespawnTime; auto list = config.ItemDespawn.WhiteList; - auto type = item->item().getTypeName(); + auto type = item.item().getTypeName(); for (auto& key : list) { if (isMatch(type, key)) { return; } } - item->lifeTime() = config.ItemDespawn.DespawnTime; + item.lifeTime() = config.ItemDespawn.DespawnTime; } }); // MobTakeItemEvent eventBus.emplaceListener([](ila::mc::ActorPickupItemAfterEvent& event) { - auto mob = (gmlib::world::actor::GMActor*)&event.self(); + auto mob = (gmlib::GMActor*)&event.self(); setShouldIgnore(mob); }); } diff --git a/src/Features/Helper.cpp b/src/Features/Helper.cpp index 5b2c4ba..f9719f0 100644 --- a/src/Features/Helper.cpp +++ b/src/Features/Helper.cpp @@ -3,11 +3,11 @@ namespace Helper { void broadcastMessage(std::string_view msg) { - gmlib::world::GMLevel::getInstance()->broadcast(tr("cleaner.info.prefix") + std::string(msg)); + gmlib::GMLevel::getInstance()->broadcast(tr("cleaner.info.prefix") + std::string(msg)); } void broadcastToast(std::string_view msg) { - gmlib::world::GMLevel::getInstance()->broadcastToast(tr("cleaner.info.prefix"), msg); + gmlib::GMLevel::getInstance()->broadcastToast(tr("cleaner.info.prefix"), msg); } } // namespace Helper \ No newline at end of file diff --git a/src/Features/UnloadActorClean.cpp b/src/Features/UnloadActorClean.cpp index 267a78b..895a486 100644 --- a/src/Features/UnloadActorClean.cpp +++ b/src/Features/UnloadActorClean.cpp @@ -5,8 +5,8 @@ namespace UnloadActorClean { void cleanUnloadActor() { auto& config = Cleaner::Entry::getInstance().getConfig(); - gmlib::world::actor::UnloadedActor::foreachUnloadedActor( - [config](gmlib::world::actor::UnloadedActor& actor) -> bool { + gmlib::UnloadedActor::foreachUnloadedActor( + [config](gmlib::UnloadedActor& actor) -> bool { for (auto& actorname : config.UnloadActorClean.CleanList) { if (actor.getTypeName() == actorname) { actor.remove(); diff --git a/src/Mod.cpp b/src/Mod.cpp index f4fb2a2..25e9e24 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -2,6 +2,7 @@ #include "Features/Cleaner.h" #include "Global.h" #include "Language.h" +#include "ll/api/utils/ErrorUtils.h" namespace Cleaner { @@ -14,12 +15,15 @@ bool Entry::load() { return true; } bool Entry::enable() { mConfig.emplace(); - ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json"); - + try { + ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json"); + } catch (...) { + ll::error_utils::printCurrentException(getSelf().getLogger()); + } saveConfig(); - gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "en_US", en_US); - gmlib::locale::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "zh_CN", zh_CN); - gmlib::locale::I18nAPI::loadLanguagesFromDirectory(getSelf().getLangDir()); + gmlib::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "en_US", en_US); + gmlib::I18nAPI::updateOrCreateLanguageFile(getSelf().getLangDir(), "zh_CN", zh_CN); + gmlib::I18nAPI::loadLanguagesFromDirectory(getSelf().getLangDir()); Cleaner::ListenEvents(); RegisterCommands(); Cleaner::loadCleaner(); @@ -44,5 +48,5 @@ void Entry::saveConfig() { ll::config::saveConfig(*mConfig, getSelf().getConfigD LL_REGISTER_MOD(Cleaner::Entry, Cleaner::Entry::getInstance()); std::string tr(std::string const& key, std::vector const& params) { - return gmlib::locale::I18nAPI::get(key, params); + return gmlib::I18nAPI::get(key, params); } diff --git a/src/RegisterCommand.cpp b/src/RegisterCommand.cpp index 1bc5aec..5586c15 100644 --- a/src/RegisterCommand.cpp +++ b/src/RegisterCommand.cpp @@ -46,13 +46,13 @@ void RegCleanerCommand() { case CleanerParam::Action::tps: { return output.success( tr("cleaner.command.tps.output", - {S(gmlib::world::GMLevel::getInstance()->getServerCurrentTps()), - S(gmlib::world::GMLevel::getInstance()->getServerAverageTps())}) + {S(gmlib::GMLevel::getInstance()->getServerCurrentTps()), + S(gmlib::GMLevel::getInstance()->getServerAverageTps())}) ); } case CleanerParam::Action::mspt: { return output.success( - tr("cleaner.command.mspt.output", {S(gmlib::world::GMLevel::getInstance()->getServerMspt())}) + tr("cleaner.command.mspt.output", {S(gmlib::GMLevel::getInstance()->getServerMspt())}) ); } case CleanerParam::Action::reload: { diff --git a/tooth.json b/tooth.json index 2087103..3302750 100644 --- a/tooth.json +++ b/tooth.json @@ -2,11 +2,15 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.4", + "version": "0.13.5", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", - "tags": ["levilamina", "cleaner", "gmlib"], + "tags": [ + "levilamina", + "cleaner", + "gmlib" + ], "avatar_url": "" }, "variants": [ @@ -14,20 +18,20 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">= 1.0.0", - "github.com/MiracleForest/iListenAttentively-Release": ">= 0.4.0" + "github.com/GroupMountain/GMLIB": ">=1.0.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.4.1" }, "assets": [ { "type": "zip", "urls": [ - "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.4/Cleaner-windows-x64.zip" + "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.5/Cleaner-windows-x64.zip" ], "placements": [ { "type": "dir", "src": "Cleaner/", - "dest": "mods/Cleaner" + "dest": "plugins/Cleaner" } ] } @@ -46,4 +50,4 @@ } } ] -} +} \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index d415a20..302bc6b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina") -add_requires("levibuildscript") -add_requires("gmlib") -add_requires("ilistenattentively") +add_requires("levilamina 1.1.1") +add_requires("levibuildscript 0.3.0") +add_requires("gmlib 1.0.0") +add_requires("ilistenattentively 0.4.1") target("Cleaner") -- Change this to your mod name. add_cxflags( @@ -32,15 +32,13 @@ target("Cleaner") -- Change this to your mod name. ) add_defines( "NOMINMAX", - "UNICODE", - "_HAS_CXX17", - "_HAS_CXX20", - "_HAS_CXX23" + "UNICODE", + "_HAS_CXX23=1" ) add_rules("@levibuildscript/linkrule") set_exceptions("none") set_kind("shared") - set_languages("cxx23") + set_languages("cxx20") after_build(function (target) local mod_packer = import("scripts.after_build") -- 2.52.0 From 975c2cb5836c8546fe88f5a6ec58ee5057202ab7 Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:14:43 +0800 Subject: [PATCH 08/24] chore: update version --- manifest.json | 2 +- tooth.json | 8 ++++---- xmake.lua | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 86ff7c0..e30860b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.5", + "version": "0.13.6", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index 3302750..7728a3e 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.5", + "version": "0.13.6", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,14 +18,14 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">=1.0.0", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.4.1" + "github.com/GroupMountain/GMLIB": ">=1.2.0-rc.1", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.5.0-rc.1" }, "assets": [ { "type": "zip", "urls": [ - "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.5/Cleaner-windows-x64.zip" + "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.6/Cleaner-windows-x64.zip" ], "placements": [ { diff --git a/xmake.lua b/xmake.lua index 302bc6b..f5696d6 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.1.1") -add_requires("levibuildscript 0.3.0") -add_requires("gmlib 1.0.0") -add_requires("ilistenattentively 0.4.1") +add_requires("levilamina 1.2.0") +add_requires("levibuildscript 0.4.0") +add_requires("gmlib 1.2.0-rc.1") +add_requires("ilistenattentively 0.5.0-rc.1") target("Cleaner") -- Change this to your mod name. add_cxflags( -- 2.52.0 From 217c0d1342e90683734c7ea55840e5482aff5839 Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:20:57 +0800 Subject: [PATCH 09/24] ci: fix build chore: add `set_symbols("debug")` in build script --- .github/workflows/build.yml | 3 ++- .github/workflows/release.yml | 3 ++- xmake.lua | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af8e62f..6a4f2b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,8 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: latest + xmake-version: 2.9.9 + - run: | xmake repo -u diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7647da6..7fe23dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,8 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: latest + xmake-version: 2.9.9 + - run: | xmake repo -u diff --git a/xmake.lua b/xmake.lua index f5696d6..902aa89 100644 --- a/xmake.lua +++ b/xmake.lua @@ -39,6 +39,7 @@ target("Cleaner") -- Change this to your mod name. set_exceptions("none") set_kind("shared") set_languages("cxx20") + set_symbols("debug") after_build(function (target) local mod_packer = import("scripts.after_build") -- 2.52.0 From 5480f14546dc3265157c0c2c8ee1bed27247202a Mon Sep 17 00:00:00 2001 From: Yangyangzhong82 Date: Mon, 23 Jun 2025 14:19:05 +0800 Subject: [PATCH 10/24] chore: update version --- manifest.json | 2 +- tooth.json | 8 ++++---- xmake.lua | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index e30860b..a7c13f3 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.6", + "version": "0.13.7", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index 7728a3e..4d36e4a 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.6", + "version": "0.13.7", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,14 +18,14 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">=1.2.0-rc.1", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.5.0-rc.1" + "github.com/GroupMountain/GMLIB": ">=1.3.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.6.0" }, "assets": [ { "type": "zip", "urls": [ - "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.6/Cleaner-windows-x64.zip" + "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.7/Cleaner-windows-x64.zip" ], "placements": [ { diff --git a/xmake.lua b/xmake.lua index 902aa89..9499bbf 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.2.0") -add_requires("levibuildscript 0.4.0") -add_requires("gmlib 1.2.0-rc.1") -add_requires("ilistenattentively 0.5.0-rc.1") +add_requires("levilamina 1.3.1") +add_requires("levibuildscript 0.4.1") +add_requires("gmlib 1.3.0") +add_requires("ilistenattentively 0.6.0") target("Cleaner") -- Change this to your mod name. add_cxflags( -- 2.52.0 From bd72991d2f4dc8847badfaec5631400334d74f9e Mon Sep 17 00:00:00 2001 From: Zhongzi8972 <107860434+Zhongzi8972@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:21:00 +0800 Subject: [PATCH 11/24] fix: try to fix action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a4f2b1..f9e905a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: 2.9.9 + xmake-version: 3.0.0 - run: | xmake repo -u -- 2.52.0 From 9b859c4907298859c2b9abfcd96f203486ccc5d3 Mon Sep 17 00:00:00 2001 From: Zhongzi8972 <107860434+Zhongzi8972@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:53:41 +0800 Subject: [PATCH 12/24] chore: adapt action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fe23dd..77174c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: 2.9.9 + xmake-version: 3.0.0 - run: | xmake repo -u -- 2.52.0 From 0c5516dc1306867e147718a4fc043014577716c7 Mon Sep 17 00:00:00 2001 From: Zhongzi8972 <107860434+Zhongzi8972@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:12:11 +0800 Subject: [PATCH 13/24] fix: fix update to ll 1.3.2 --- xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index 9499bbf..2841aa7 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,7 +9,7 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.3.1") +add_requires("levilamina 1.3.2") add_requires("levibuildscript 0.4.1") add_requires("gmlib 1.3.0") add_requires("ilistenattentively 0.6.0") -- 2.52.0 From e4024db6978130b6c00f6c751f7975be8db82327 Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Wed, 16 Jul 2025 20:52:30 +0800 Subject: [PATCH 14/24] feat: adapt to gmlib 1.4.0 --- manifest.json | 2 +- tooth.json | 8 ++++---- xmake.lua | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index a7c13f3..76a4fb5 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.7", + "version": "0.13.8", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index 4d36e4a..4296e10 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.7", + "version": "0.13.8", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,14 +18,14 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">=1.3.0", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.6.0" + "github.com/GroupMountain/GMLIB": ">=1.4.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.7.0" }, "assets": [ { "type": "zip", "urls": [ - "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.7/Cleaner-windows-x64.zip" + "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.8/Cleaner-windows-x64.zip" ], "placements": [ { diff --git a/xmake.lua b/xmake.lua index 2841aa7..a10c954 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.3.2") -add_requires("levibuildscript 0.4.1") -add_requires("gmlib 1.3.0") -add_requires("ilistenattentively 0.6.0") +add_requires("levilamina 1.4.1") +add_requires("levibuildscript") +add_requires("gmlib 1.4.0") +add_requires("ilistenattentively 0.7.0") target("Cleaner") -- Change this to your mod name. add_cxflags( -- 2.52.0 From a68bdfbed070c4750b3689cd2ab9b255b2e5786a Mon Sep 17 00:00:00 2001 From: LWenK Date: Fri, 29 Aug 2025 10:28:36 +0800 Subject: [PATCH 15/24] fix: tooth dependencies --- tooth.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooth.json b/tooth.json index 4296e10..b96ba10 100644 --- a/tooth.json +++ b/tooth.json @@ -18,7 +18,7 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB": ">=1.4.0", + "github.com/GroupMountain/GMLIB-Release": ">=1.4.0", "github.com/MiracleForest/iListenAttentively-Release": ">=0.7.0" }, "assets": [ -- 2.52.0 From f19b033e4cc3d38d0fd820c3a5c2a30fb2830ec5 Mon Sep 17 00:00:00 2001 From: LWenK Date: Fri, 29 Aug 2025 10:31:05 +0800 Subject: [PATCH 16/24] fix: item_despawn_whitelist no working --- src/Features/Events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Features/Events.cpp b/src/Features/Events.cpp index 2c34e68..fa9feb9 100644 --- a/src/Features/Events.cpp +++ b/src/Features/Events.cpp @@ -18,7 +18,7 @@ void ListenEvents() { } } if (config.ItemDespawn.Enabled) { - item.lifeTime() = config.ItemDespawn.DespawnTime; + // item.lifeTime() = config.ItemDespawn.DespawnTime; auto list = config.ItemDespawn.WhiteList; auto type = item.item().getTypeName(); for (auto& key : list) { -- 2.52.0 From a6fa1b511304550851232cbed678ddb871afeb76 Mon Sep 17 00:00:00 2001 From: Yangyangzhong82 Date: Sun, 19 Oct 2025 21:35:19 +0800 Subject: [PATCH 17/24] feat: adapt to gmlib 1.5.0 --- manifest.json | 2 +- src/Features/Clean.cpp | 2 +- src/Features/CleanTask.cpp | 7 ++++--- src/Features/Events.cpp | 3 ++- src/Features/Helper.cpp | 2 +- src/Features/VoteClean.cpp | 4 ++-- src/Global.h | 2 +- src/Mod.cpp | 2 +- src/RegisterCommand.cpp | 5 +++-- tooth.json | 6 +++--- xmake.lua | 6 +++--- 11 files changed, 22 insertions(+), 19 deletions(-) diff --git a/manifest.json b/manifest.json index 76a4fb5..260f350 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.8", + "version": "0.13.9", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/src/Features/Clean.cpp b/src/Features/Clean.cpp index f5a31d0..f90f014 100644 --- a/src/Features/Clean.cpp +++ b/src/Features/Clean.cpp @@ -1,6 +1,6 @@ #include "Cleaner.h" #include "mc/world/actor/provider/SynchedActorDataAccess.h" - +#include "gmlib/mc/world/actor/Actor.h" namespace Cleaner { bool isMatch(std::string& A, std::string& B) { diff --git a/src/Features/CleanTask.cpp b/src/Features/CleanTask.cpp index b19e8a8..bf7a2ee 100644 --- a/src/Features/CleanTask.cpp +++ b/src/Features/CleanTask.cpp @@ -1,6 +1,7 @@ #include "Cleaner.h" #include - +#include "gmlib/mc/world/Level.h" +#include "gmlib/gm/data/TpsStatus.h" namespace Cleaner { static std::shared_ptr mAutoCleanTask = std::make_shared(false); @@ -109,9 +110,9 @@ void CleanTaskTPS(float min_tps) { co_await 10s; if (*mCleanTaskTPS == false) co_return; if (auto_clean_triggerred == false) { - if (gmlib::GMLevel::getInstance()->getServerAverageTps() <= min_tps) { + if (gmlib::TpsStatus::getInstance().getLevelAverageTps() <= min_tps) { auto_clean_triggerred = true; - auto mspt = S(gmlib::GMLevel::getInstance()->getServerAverageTps()); + auto mspt = S(gmlib::TpsStatus::getInstance().getLevelAverageTps()); if (config.Basic.ConsoleLog) { ll::io::LoggerRegistry::getInstance().getOrCreate("Cleaner")->warn( tr("cleaner.output.triggerAutoCleanTps", {mspt}) diff --git a/src/Features/Events.cpp b/src/Features/Events.cpp index fa9feb9..2849b92 100644 --- a/src/Features/Events.cpp +++ b/src/Features/Events.cpp @@ -1,5 +1,6 @@ #include "Cleaner.h" - +#include "gmlib/mc/world/Level.h" +#include "gmlib/mc/world/actor/Player.h" namespace Cleaner { void setShouldIgnore(gmlib::GMActor* ac) { ac->addTag("cleaner:ignore"); } diff --git a/src/Features/Helper.cpp b/src/Features/Helper.cpp index f9719f0..5703ea8 100644 --- a/src/Features/Helper.cpp +++ b/src/Features/Helper.cpp @@ -1,5 +1,5 @@ #include "Global.h" - +#include "gmlib/mc/world/Level.h" namespace Helper { void broadcastMessage(std::string_view msg) { diff --git a/src/Features/VoteClean.cpp b/src/Features/VoteClean.cpp index 3447a16..4117ed8 100644 --- a/src/Features/VoteClean.cpp +++ b/src/Features/VoteClean.cpp @@ -94,12 +94,12 @@ void voteClean(Player* pl) { } sendVoteForm(pl); ll::coro::keepThis([&config]() -> ll::coro::CoroTask<> { - co_await std::chrono::seconds::duration(config.VoteClean.Cooldown); + co_await std::chrono::seconds(config.VoteClean.Cooldown); canVote = true; co_return; }).launch(ll::thread::ServerThreadExecutor::getDefault()); ll::coro::keepThis([&config]() -> ll::coro::CoroTask<> { - co_await std::chrono::seconds::duration(config.VoteClean.CheckDelay); + co_await std::chrono::seconds(config.VoteClean.CheckDelay); checkVote(); co_return; }).launch(ll::thread::ServerThreadExecutor::getDefault()); diff --git a/src/Global.h b/src/Global.h index 7ec39a7..0f330f0 100644 --- a/src/Global.h +++ b/src/Global.h @@ -1,7 +1,7 @@ #pragma once // IWYU pragma: begin_exports #include "Mod.h" -#include "gmlib/include_lib.h" + #include "gmlib/include_ll.h" #include "ila/include_all.h" #include diff --git a/src/Mod.cpp b/src/Mod.cpp index 25e9e24..f9678b8 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -3,7 +3,7 @@ #include "Global.h" #include "Language.h" #include "ll/api/utils/ErrorUtils.h" - +#include "gmlib/mc/locale/I18nAPI.h" namespace Cleaner { Entry& Entry::getInstance() { diff --git a/src/RegisterCommand.cpp b/src/RegisterCommand.cpp index 5586c15..dd3162a 100644 --- a/src/RegisterCommand.cpp +++ b/src/RegisterCommand.cpp @@ -1,5 +1,6 @@ #include "Features/Cleaner.h" - +#include "gmlib/mc/world/Level.h" +#include "gmlib/gm/data/TpsStatus.h" struct CleanerParam { enum class Despawn { despawn } despawn; enum class Action { tps, clean, reload, mspt } action; @@ -47,7 +48,7 @@ void RegCleanerCommand() { return output.success( tr("cleaner.command.tps.output", {S(gmlib::GMLevel::getInstance()->getServerCurrentTps()), - S(gmlib::GMLevel::getInstance()->getServerAverageTps())}) + S(gmlib::TpsStatus::getInstance().getLevelAverageTps())}) ); } case CleanerParam::Action::mspt: { diff --git a/tooth.json b/tooth.json index b96ba10..9bd7955 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.8", + "version": "0.13.9", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,8 +18,8 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB-Release": ">=1.4.0", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.7.0" + "github.com/GroupMountain/GMLIB-Release": ">=1.5.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.8.0" }, "assets": [ { diff --git a/xmake.lua b/xmake.lua index a10c954..e0b0d22 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.4.1") +add_requires("levilamina 1.5.2") add_requires("levibuildscript") -add_requires("gmlib 1.4.0") -add_requires("ilistenattentively 0.7.0") +add_requires("gmlib 1.5.2") +add_requires("ilistenattentively 0.8.0") target("Cleaner") -- Change this to your mod name. add_cxflags( -- 2.52.0 From 03f7fcffa3b071d97554116ab06ee751774d6dd8 Mon Sep 17 00:00:00 2001 From: Yangyangzhong82 Date: Sun, 19 Oct 2025 21:46:15 +0800 Subject: [PATCH 18/24] chore: Update version number --- manifest.json | 2 +- tooth.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 260f350..ff2ed02 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.13.9", + "version": "0.14.0", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index 9bd7955..0adfce5 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.13.9", + "version": "0.14.0", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", -- 2.52.0 From 530aba5d64fff03a2253fbf48b57600ebddea1b7 Mon Sep 17 00:00:00 2001 From: zimuya4153 Date: Fri, 24 Oct 2025 01:35:39 +0800 Subject: [PATCH 19/24] feat: adapt levlamina 1.6.x --- manifest.json | 9 +++++++-- tooth.json | 9 +++++---- xmake.lua | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/manifest.json b/manifest.json index ff2ed02..3cf66bb 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.14.0", + "version": "0.15.0", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ @@ -12,5 +12,10 @@ { "name": "iListenAttentively" } + ], + "optionalDependencies": [ + { + "name": "ModAPI" + } ] -} +} \ No newline at end of file diff --git a/tooth.json b/tooth.json index 0adfce5..3fb6fc3 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.14.0", + "version": "0.15.0", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,14 +18,15 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB-Release": ">=1.5.0", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.8.0" + "github.com/GroupMountain/GMLIB-Release": ">=1.6.0", + "github.com/GroupMountain/ModAPI-Release": ">=0.2.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.9.0" }, "assets": [ { "type": "zip", "urls": [ - "https://github.com/GroupMountain/Cleaner/releases/download/v0.13.8/Cleaner-windows-x64.zip" + "https://github.com/GroupMountain/Cleaner/releases/download/v{{version}}/Cleaner-windows-x64.zip" ], "placements": [ { diff --git a/xmake.lua b/xmake.lua index e0b0d22..3abac36 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.5.2") -add_requires("levibuildscript") -add_requires("gmlib 1.5.2") -add_requires("ilistenattentively 0.8.0") +add_requires("levilamina 1.6.1") +add_requires("levibuildscript 0.5.2") +add_requires("gmlib 1.6.0") +add_requires("ilistenattentively 0.9.0") target("Cleaner") -- Change this to your mod name. add_cxflags( -- 2.52.0 From 4785866fb3796564ca3c6842bd0d1d15c2570325 Mon Sep 17 00:00:00 2001 From: zimuya4153 Date: Fri, 24 Oct 2025 02:00:30 +0800 Subject: [PATCH 20/24] fix: fix 0tps --- src/Mod.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod.cpp b/src/Mod.cpp index f9678b8..17f2d72 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -4,6 +4,8 @@ #include "Language.h" #include "ll/api/utils/ErrorUtils.h" #include "gmlib/mc/locale/I18nAPI.h" +#include "gmlib/gm/data/TpsStatus.h" + namespace Cleaner { Entry& Entry::getInstance() { @@ -14,6 +16,7 @@ Entry& Entry::getInstance() { bool Entry::load() { return true; } bool Entry::enable() { + (void)gmlib::TpsStatus::getInstance(); mConfig.emplace(); try { ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json"); -- 2.52.0 From 4037965db725fc250beb49e344d82b479e3c7086 Mon Sep 17 00:00:00 2001 From: zimuya4153 Date: Fri, 24 Oct 2025 02:01:23 +0800 Subject: [PATCH 21/24] chore: update versi --- manifest.json | 2 +- tooth.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 3cf66bb..85baaca 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.15.0", + "version": "0.15.1", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index 3fb6fc3..334e88b 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.15.0", + "version": "0.15.1", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", -- 2.52.0 From 04856f7e6f5a0c00996197bd2e3be63741f65dc8 Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Thu, 12 Feb 2026 12:03:46 +0800 Subject: [PATCH 22/24] feat: adapt levilamina 1.9.x --- src/RegisterCommand.cpp | 5 +++-- tooth.json | 8 ++++---- xmake.lua | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/RegisterCommand.cpp b/src/RegisterCommand.cpp index dd3162a..a69f4f3 100644 --- a/src/RegisterCommand.cpp +++ b/src/RegisterCommand.cpp @@ -1,6 +1,7 @@ #include "Features/Cleaner.h" #include "gmlib/mc/world/Level.h" #include "gmlib/gm/data/TpsStatus.h" +#include "mc/server/commands/CommandOutput.h" struct CleanerParam { enum class Despawn { despawn } despawn; enum class Action { tps, clean, reload, mspt } action; @@ -11,7 +12,7 @@ struct CleanerParam { void RegCleanerCommand() { auto& config = Cleaner::Entry::getInstance().getConfig(); - auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand( + auto& cmd = ll::command::CommandRegistrar::getInstance(false).getOrCreateCommand( config.Basic.Command, tr("cleaner.command.cleaner"), CommandPermissionLevel::GameDirectors @@ -74,7 +75,7 @@ void RegCleanerCommand() { }; void RegVoteCommand() { - auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand( + auto& cmd = ll::command::CommandRegistrar::getInstance(false).getOrCreateCommand( Cleaner::Entry::getInstance().getConfig().VoteClean.VoteCleanCommand, tr("cleaner.command.voteclean"), CommandPermissionLevel::Any diff --git a/tooth.json b/tooth.json index 334e88b..f7d5dd1 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.15.1", + "version": "0.16.0", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", @@ -18,9 +18,9 @@ "label": "", "platform": "win-x64", "dependencies": { - "github.com/GroupMountain/GMLIB-Release": ">=1.6.0", - "github.com/GroupMountain/ModAPI-Release": ">=0.2.0", - "github.com/MiracleForest/iListenAttentively-Release": ">=0.9.0" + "github.com/GroupMountain/GMLIB-Release": ">=1.9.0", + "github.com/GroupMountain/ModAPI-Release": ">=0.4.0", + "github.com/MiracleForest/iListenAttentively-Release": ">=0.11.0" }, "assets": [ { diff --git a/xmake.lua b/xmake.lua index 3abac36..f305e06 100644 --- a/xmake.lua +++ b/xmake.lua @@ -9,10 +9,10 @@ if not has_config("vs_runtime") then end -- Option 1: Use the latest version of LeviLamina released on GitHub. -add_requires("levilamina 1.6.1") -add_requires("levibuildscript 0.5.2") -add_requires("gmlib 1.6.0") -add_requires("ilistenattentively 0.9.0") +add_requires("levilamina 1.9.5", {configs = {target_type = "server"}}) +add_requires("levibuildscript 0.6.0") +add_requires("gmlib 1.9.0") +add_requires("ilistenattentively 0.11.0") target("Cleaner") -- Change this to your mod name. add_cxflags( @@ -35,6 +35,7 @@ target("Cleaner") -- Change this to your mod name. "UNICODE", "_HAS_CXX23=1" ) + add_defines("LL_PLAT_S") --TODO: check client compatibility add_rules("@levibuildscript/linkrule") set_exceptions("none") set_kind("shared") -- 2.52.0 From 94e74d6daa777c3029ba497be7a164e6edc60de4 Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Sat, 28 Feb 2026 12:52:34 +0800 Subject: [PATCH 23/24] fix: fix typo --- src/Language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Language.h b/src/Language.h index d419f27..0dbd265 100644 --- a/src/Language.h +++ b/src/Language.h @@ -44,7 +44,7 @@ std::string zh_CN = R"( cleaner.command.error.noTarget=没有与选择器匹配的目标 cleaner.command.error.playerOnly=该命令只能由玩家执行! cleaner.command.tps.output=当前服务器实时TPS %1$s §r,平均TPS %2$s - cleaner.command.mspt.output=当前服务器实MSPT %1$s + cleaner.command.mspt.output=当前服务器实时MSPT %1$s cleaner.command.clean.output=已成功启动清理任务! cleaner.command.voteclean=发起实体清理投票。 cleaner.command.despawntime=已成功将物品消失时间设置为 %1$s 游戏刻 -- 2.52.0 From 9d68a50a12f69af69299141f9693fb698f5e9eac Mon Sep 17 00:00:00 2001 From: n15421 <119112174+n15421@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:59:52 +0800 Subject: [PATCH 24/24] fix: fix broadcast --- manifest.json | 2 +- tooth.json | 2 +- xmake.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 85baaca..d5f3f73 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "${modName}", "entry": "${modFile}", "type": "native", - "version": "0.15.1", + "version": "0.16.1", "author": "GroupMountain", "description": "Clean Entities", "dependencies": [ diff --git a/tooth.json b/tooth.json index f7d5dd1..165a0d4 100644 --- a/tooth.json +++ b/tooth.json @@ -2,7 +2,7 @@ "format_version": 3, "format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d", "tooth": "github.com/GroupMountain/Cleaner", - "version": "0.16.0", + "version": "0.16.1", "info": { "name": "Cleaner", "description": "A Powerful Entities Cleaning up Mod for BDS", diff --git a/xmake.lua b/xmake.lua index f305e06..ff6483c 100644 --- a/xmake.lua +++ b/xmake.lua @@ -11,7 +11,7 @@ end -- Option 1: Use the latest version of LeviLamina released on GitHub. add_requires("levilamina 1.9.5", {configs = {target_type = "server"}}) add_requires("levibuildscript 0.6.0") -add_requires("gmlib 1.9.0") +add_requires("gmlib 1.9.1") add_requires("ilistenattentively 0.11.0") target("Cleaner") -- Change this to your mod name. -- 2.52.0