ModShield
一款轻量级、简单易用的模组,允许服务器管理员检查客户端安装的模组,并禁止玩家使用某些特定模组。
或者只允许玩家使用指定的模组。
使用方法
只需在服务器和客户端上下载最新版本的模组即可。
需要注意的是,运行 ModShield 的服务器会要求所有连接的客户端也必须安装该模组。
服务器配置
所有配置均通过配置文件 config/modshield.properties 进行设置。
首次启动模组后,会自动生成一个模板版本,其中包含所有选项的描述及使用说明。
要重新加载配置,请使用 /mod-shield-reload 命令。请注意,执行此命令需要管理员权限。
显示示例
#这是一个 ModShield 配置文件的模板。
#如果希望仅允许特定的模组,请在 disallowed 选项中添加它们,用逗号分隔。
#这样客户端只能使用该选项中列出的模组。
#
#如果希望仅允许指定的模组,请将其放入 allowed 选项中,用逗号分隔。
#
#savePlayerMods - 设为 true 时,ModShield 将保存玩家使用的模组信息,可通过 API 访问这些数据。
#onlyAllowServerMods - 设为 true 时,客户端仅允许使用服务器上存在的模组。
#alwaysAllowedPlayers - 可运行任意模组的玩家列表,支持用逗号分隔的玩家 UUID 或名称。
#autoUpdate - 设为 true 时,模组将尝试自动更新。
#Fri Mar 28 23:03:05 CET 2025
allowed=
autoUpdate=false
disallowed=
onlyAllowServerMods=false
savePlayerMods=false
API 使用(针对模组开发者)
要将该模组作为库使用,请在你的 build.gradle 文件中添加 Maven 仓库并将其声明为依赖项,如下所示:
// 添加仓库
repositories {
maven {
url = 'https://maven.avarisgates.com' // ModShield
}
}
// 声明依赖项
dependencies {
// 若要将模组打包进你自己的模组中
modImplementation "com.avaris:ModShield:${project.modshield_version}"
// 若在单独的 .jar 文件中使用该模组
// 这并不严格要求模组存在
compileOnly "com.avaris:ModShield:${project.modshield_version}"
}
同时也建议在 gradle.properties 文件中添加以下内容:
mod_shield=CURRENT_VERSION
请务必将 CURRENT_VERSION 替换为你希望使用的版本号。
建议始终使用最新版本。
ModShield
A lightweight simple to use mod, allowing server admins to check client mods as well as forbid players from using certain mods.
Or allow players to use only specific mods.
Usage
Simply download the latest mod version on the server and the client.
It's important to note that a server running ModShield will require all clients to use it as well.
Server Config
All configuration is done through the config file: config/modshield.properties.
After you launch the mod for the first time a template version will be automatically generated, with descriptions of all options and how to use them.
To realod the config use the /mod-shield-reload command. Keep in mind administrator permissions are required.
Show Example
#This is a template ModShield config file.
#If you want to allow only certain mods add them in the disallowed option, separated by commas.
#This way only mods in that option can be used by the client.
#
#If you want to allow only specified mods put them in the allowed option, separated by commas.
#
#savePlayerMods - when set to true ModShield will save mods used by players, that can be accessed through the API.
#onlyAllowServerMods - when set to true only mods found on the server will be allowed on the client.
#alwaysAllowedPlayers - list of players that can run every mod, separated by commas, UUIDs or names.
#autoUpdate - when set to true the mod will attempt to automatically update.
#Fri Mar 28 23:03:05 CET 2025
allowed=
autoUpdate=false
disallowed=
onlyAllowServerMods=false
savePlayerMods=false
API Usage (For Mod Developers)
To use the mod as a library add the maven repository and declare it as a dependency, in your build.gradle file like so:
// Add the repository
repositories {
maven {
url = 'https://maven.avarisgates.com' // ModShield
}
}
// Declare it as a dependency
dependencies {
// To package the mod with yours
modImplementation "com.avaris:ModShield:${project.modshield_version}"
// To use the mod in a seperate .jar file
// This won't strictly require the mod
compileOnly "com.avaris:ModShield:${project.modshield_version}"
}
It's also recommended to add the following to your gradle.properties file:
mod_shield=CURRENT_VERSION
Be sure to add replace CURRENT_VERSION with the version you wish to use.
It's always recommended to use the latest one.
评论 0
登录后参与评分
还没有评论,来抢沙发吧