Compare commits
7 Commits
v0.14.0
...
b1351f368b
+7
-2
@@ -2,7 +2,7 @@
|
|||||||
"name": "${modName}",
|
"name": "${modName}",
|
||||||
"entry": "${modFile}",
|
"entry": "${modFile}",
|
||||||
"type": "native",
|
"type": "native",
|
||||||
"version": "0.14.0",
|
"version": "0.16.1",
|
||||||
"author": "GroupMountain",
|
"author": "GroupMountain",
|
||||||
"description": "Clean Entities",
|
"description": "Clean Entities",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
@@ -12,5 +12,10 @@
|
|||||||
{
|
{
|
||||||
"name": "iListenAttentively"
|
"name": "iListenAttentively"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"optionalDependencies": [
|
||||||
|
{
|
||||||
|
"name": "ModAPI"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+1
-1
@@ -44,7 +44,7 @@ std::string zh_CN = R"(
|
|||||||
cleaner.command.error.noTarget=没有与选择器匹配的目标
|
cleaner.command.error.noTarget=没有与选择器匹配的目标
|
||||||
cleaner.command.error.playerOnly=该命令只能由玩家执行!
|
cleaner.command.error.playerOnly=该命令只能由玩家执行!
|
||||||
cleaner.command.tps.output=当前服务器实时TPS %1$s §r,平均TPS %2$s
|
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.clean.output=已成功启动清理任务!
|
||||||
cleaner.command.voteclean=发起实体清理投票。
|
cleaner.command.voteclean=发起实体清理投票。
|
||||||
cleaner.command.despawntime=已成功将物品消失时间设置为 %1$s 游戏刻
|
cleaner.command.despawntime=已成功将物品消失时间设置为 %1$s 游戏刻
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "ll/api/utils/ErrorUtils.h"
|
#include "ll/api/utils/ErrorUtils.h"
|
||||||
#include "gmlib/mc/locale/I18nAPI.h"
|
#include "gmlib/mc/locale/I18nAPI.h"
|
||||||
|
#include "gmlib/gm/data/TpsStatus.h"
|
||||||
|
|
||||||
namespace Cleaner {
|
namespace Cleaner {
|
||||||
|
|
||||||
Entry& Entry::getInstance() {
|
Entry& Entry::getInstance() {
|
||||||
@@ -14,6 +16,7 @@ Entry& Entry::getInstance() {
|
|||||||
bool Entry::load() { return true; }
|
bool Entry::load() { return true; }
|
||||||
|
|
||||||
bool Entry::enable() {
|
bool Entry::enable() {
|
||||||
|
(void)gmlib::TpsStatus::getInstance();
|
||||||
mConfig.emplace();
|
mConfig.emplace();
|
||||||
try {
|
try {
|
||||||
ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json");
|
ll::config::loadConfig(*mConfig, getSelf().getConfigDir() / "config.json");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "Features/Cleaner.h"
|
#include "Features/Cleaner.h"
|
||||||
#include "gmlib/mc/world/Level.h"
|
#include "gmlib/mc/world/Level.h"
|
||||||
#include "gmlib/gm/data/TpsStatus.h"
|
#include "gmlib/gm/data/TpsStatus.h"
|
||||||
|
#include "mc/server/commands/CommandOutput.h"
|
||||||
struct CleanerParam {
|
struct CleanerParam {
|
||||||
enum class Despawn { despawn } despawn;
|
enum class Despawn { despawn } despawn;
|
||||||
enum class Action { tps, clean, reload, mspt } action;
|
enum class Action { tps, clean, reload, mspt } action;
|
||||||
@@ -11,7 +12,7 @@ struct CleanerParam {
|
|||||||
|
|
||||||
void RegCleanerCommand() {
|
void RegCleanerCommand() {
|
||||||
auto& config = Cleaner::Entry::getInstance().getConfig();
|
auto& config = Cleaner::Entry::getInstance().getConfig();
|
||||||
auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand(
|
auto& cmd = ll::command::CommandRegistrar::getInstance(false).getOrCreateCommand(
|
||||||
config.Basic.Command,
|
config.Basic.Command,
|
||||||
tr("cleaner.command.cleaner"),
|
tr("cleaner.command.cleaner"),
|
||||||
CommandPermissionLevel::GameDirectors
|
CommandPermissionLevel::GameDirectors
|
||||||
@@ -74,7 +75,7 @@ void RegCleanerCommand() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void RegVoteCommand() {
|
void RegVoteCommand() {
|
||||||
auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand(
|
auto& cmd = ll::command::CommandRegistrar::getInstance(false).getOrCreateCommand(
|
||||||
Cleaner::Entry::getInstance().getConfig().VoteClean.VoteCleanCommand,
|
Cleaner::Entry::getInstance().getConfig().VoteClean.VoteCleanCommand,
|
||||||
tr("cleaner.command.voteclean"),
|
tr("cleaner.command.voteclean"),
|
||||||
CommandPermissionLevel::Any
|
CommandPermissionLevel::Any
|
||||||
|
|||||||
+5
-4
@@ -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/Cleaner",
|
"tooth": "github.com/GroupMountain/Cleaner",
|
||||||
"version": "0.14.0",
|
"version": "0.16.1",
|
||||||
"info": {
|
"info": {
|
||||||
"name": "Cleaner",
|
"name": "Cleaner",
|
||||||
"description": "A Powerful Entities Cleaning up Mod for BDS",
|
"description": "A Powerful Entities Cleaning up Mod for BDS",
|
||||||
@@ -18,14 +18,15 @@
|
|||||||
"label": "",
|
"label": "",
|
||||||
"platform": "win-x64",
|
"platform": "win-x64",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"github.com/GroupMountain/GMLIB-Release": ">=1.5.0",
|
"github.com/GroupMountain/GMLIB-Release": ">=1.9.0",
|
||||||
"github.com/MiracleForest/iListenAttentively-Release": ">=0.8.0"
|
"github.com/GroupMountain/ModAPI-Release": ">=0.4.0",
|
||||||
|
"github.com/MiracleForest/iListenAttentively-Release": ">=0.11.0"
|
||||||
},
|
},
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"urls": [
|
"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": [
|
"placements": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ if not has_config("vs_runtime") then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Option 1: Use the latest version of LeviLamina released on GitHub.
|
-- Option 1: Use the latest version of LeviLamina released on GitHub.
|
||||||
add_requires("levilamina 1.5.2")
|
add_requires("levilamina 1.9.5", {configs = {target_type = "server"}})
|
||||||
add_requires("levibuildscript")
|
add_requires("levibuildscript 0.6.0")
|
||||||
add_requires("gmlib 1.5.2")
|
add_requires("gmlib 1.9.1")
|
||||||
add_requires("ilistenattentively 0.8.0")
|
add_requires("ilistenattentively 0.11.0")
|
||||||
|
|
||||||
target("Cleaner") -- Change this to your mod name.
|
target("Cleaner") -- Change this to your mod name.
|
||||||
add_cxflags(
|
add_cxflags(
|
||||||
@@ -35,6 +35,7 @@ target("Cleaner") -- Change this to your mod name.
|
|||||||
"UNICODE",
|
"UNICODE",
|
||||||
"_HAS_CXX23=1"
|
"_HAS_CXX23=1"
|
||||||
)
|
)
|
||||||
|
add_defines("LL_PLAT_S") --TODO: check client compatibility
|
||||||
add_rules("@levibuildscript/linkrule")
|
add_rules("@levibuildscript/linkrule")
|
||||||
set_exceptions("none")
|
set_exceptions("none")
|
||||||
set_kind("shared")
|
set_kind("shared")
|
||||||
|
|||||||
Reference in New Issue
Block a user