mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2024-10-18 23:16:42 +08:00
Compare commits
No commits in common. "master" and "v2.7.1-beta" have entirely different histories.
master
...
v2.7.1-bet
@ -13,12 +13,6 @@ jobs:
|
||||
uses: https://ssl.lunadeer.cn:14446/actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: "Set up JDK 17"
|
||||
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
cache: gradle
|
||||
- name: "Set up JDK 21"
|
||||
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
|
||||
with:
|
||||
@ -27,13 +21,9 @@ jobs:
|
||||
cache: gradle
|
||||
- name: "Build with Gradle"
|
||||
run: |
|
||||
./gradlew clean
|
||||
./gradlew shadowJar -PBuildFull=false
|
||||
./gradlew shadowJar -PBuildFull=true
|
||||
- name: "Stage"
|
||||
run: |
|
||||
mkdir -p staging
|
||||
mv build/libs/*.jar staging/
|
||||
./gradlew buildPlugin
|
||||
- name: "Copy jar to staging"
|
||||
run: mkdir staging && cp build/libs/*.jar staging/
|
||||
- name: "Build & test"
|
||||
run: |
|
||||
echo "done!"
|
||||
@ -46,7 +36,7 @@ jobs:
|
||||
- name: "Release"
|
||||
uses: https://ssl.lunadeer.cn:14446/zhangyuheng/release-action@main
|
||||
with:
|
||||
note: " - `full` 后缀包含所有依赖直接安装即可使用,`lite` 后缀不包含任何依赖,会在第一次安装后启动时自动下载"
|
||||
note: " - 带 `original-` 前缀的文件无法用于运行,请下载不带此前缀的版本。"
|
||||
files: |-
|
||||
staging/*.jar
|
||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
8
.github/ISSUE_TEMPLATE/报告bug.md
vendored
8
.github/ISSUE_TEMPLATE/报告bug.md
vendored
@ -15,9 +15,10 @@ assignees: ''
|
||||
|
||||
Bug复现步骤:
|
||||
|
||||
1. 打开冰箱;
|
||||
2. 将大象放入冰箱;
|
||||
3. 关上冰箱。
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**正常情况的表现**
|
||||
|
||||
@ -32,7 +33,6 @@ Bug复现步骤:
|
||||
- 服务器系统:win, linux
|
||||
- 服务端核心:(如:Paper、Spigot)
|
||||
- 服务端版本:
|
||||
- 客户端版本:
|
||||
- 插件版本:
|
||||
|
||||
**补充信息**
|
||||
|
21
.github/workflows/check.yml
vendored
21
.github/workflows/check.yml
vendored
@ -1,21 +0,0 @@
|
||||
name: Merge/PR Build Check
|
||||
|
||||
on: [ pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'zulu'
|
||||
cache: gradle
|
||||
- name: "Build with Gradle"
|
||||
run: ./gradlew buildPlugin
|
||||
- name: "Done!"
|
||||
run: |
|
||||
echo "done!"
|
15
.github/workflows/main.yml
vendored
15
.github/workflows/main.yml
vendored
@ -19,14 +19,10 @@ jobs:
|
||||
distribution: 'zulu'
|
||||
cache: gradle
|
||||
- name: "Build with Gradle"
|
||||
run: ./gradlew buildPlugin
|
||||
- name: "Copy jar to staging"
|
||||
run: |
|
||||
./gradlew clean
|
||||
./gradlew shadowJar -PBuildFull=false
|
||||
./gradlew shadowJar -PBuildFull=true
|
||||
- name: "Stage"
|
||||
run: |
|
||||
mkdir -p staging
|
||||
mv build/libs/*.jar staging/
|
||||
mkdir staging && cp build/libs/*.jar staging/
|
||||
- name: "Build & test"
|
||||
run: |
|
||||
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
|
||||
@ -50,7 +46,7 @@ jobs:
|
||||
game_versions: 1.20.1:1.20.6,1.21,1.21.1
|
||||
version_number: ${{ env.AUTOMATIC_RELEASES_TAG }}
|
||||
files: |
|
||||
staging/*-lite.jar
|
||||
staging/*.jar
|
||||
changelog: "See https://github.com/ColdeZhang/Dominion/releases/tag/${{ env.AUTOMATIC_RELEASES_TAG }}"
|
||||
version_type: beta
|
||||
featured: false
|
||||
@ -59,4 +55,5 @@ jobs:
|
||||
- name: "Hangar Release"
|
||||
env:
|
||||
HANGAR_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
|
||||
run: ./gradlew build publishPluginPublicationToHangar -PBuildFull=false
|
||||
run: ./gradlew build publishPluginPublicationToHangar --stacktrace
|
||||
continue-on-error: true
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "api"]
|
||||
path = api
|
||||
url = https://github.com/ColdeZhang/DominionAPI.git
|
@ -17,35 +17,13 @@ enhancement you would like to see, why you think it would be useful, and any oth
|
||||
|
||||
### 🌐Translating
|
||||
|
||||
#### **Translate Plugin Messages**
|
||||
|
||||
Since the plugin messages are translated by AI, there must be some mistakes in the translation. If you find any mistakes
|
||||
(or inappropriate translations), there are two ways to help us improve the translation:
|
||||
|
||||
1. Fork the repository & clone the repository to your local.
|
||||
2. Create a new branch for your translation.
|
||||
3. Translate the plugin messages.
|
||||
4. Commit & Push your changes to your fork.
|
||||
5. Open a pull request, wait for your pull request to be reviewed and merged.
|
||||
|
||||
Plugin messages are located in the `languages` directory. Translate the files in the language you want to
|
||||
|
||||
- If the language you want to translate to does not exist, create a new file with the language code (e.g., `zh-cn.yml`
|
||||
for Simplified Chinese).
|
||||
- If the translation is not up-to-date, please update it from the `zh-cn.yml` file.
|
||||
- Don't forget to leave your name in the header-comment of the file.
|
||||
|
||||
> Plugin messages was uploaded to Crowdin too, you can directly modify the translation on
|
||||
> the [Crowdin project](https://crowdin.com/project/dominion).
|
||||
>
|
||||
> But we **NOT RECOMMEND** this way, because the translation on Crowdin may not be the latest.
|
||||
>
|
||||
> ![Crowdin](https://badges.crowdin.net/dominion/localized.svg)
|
||||
#### **Translate Plugin Messages** ![Crowdin](https://badges.crowdin.net/dominion/localized.svg)
|
||||
|
||||
If you would like to help translation, please refer to the [Crowdin project](https://crowdin.com/project/dominion).
|
||||
|
||||
#### **Translate Documentation**
|
||||
|
||||
1. Fork the repository & clone the repository to your local.
|
||||
1. Fork the repository & clone the repository to your local machine.
|
||||
2. Create a new branch for your translation.
|
||||
3. Translate the documentation or plugin messages.
|
||||
4. Commit & Push your changes to your fork.
|
||||
|
12
README.md
12
README.md
@ -30,14 +30,12 @@ For detail functions and features of Dominion, you can view [Introduction](intro
|
||||
|
||||
- 1.20.1+ (Bukkit、Spigot、Paper、Folia)
|
||||
|
||||
> You need to use Java21 to run your server. If you are still using Java17, you can safely replace it with Java21. In
|
||||
> theory, version 1.20.1+ can be directly upgraded to Java21.
|
||||
|
||||
> Although this plugin supports Spigot, we strongly recommend that you upgrade your core to Paper or its forked (such as
|
||||
> Purpur) for a better performance experience.
|
||||
|
||||
## For developer
|
||||
|
||||
Dominion provides some simple (for now) APIs for developers to build something amazing depends on Dominion. You can
|
||||
take a look at [Developer](docs/en-us/developer.md) for more details.
|
||||
|
||||
## Help us improve
|
||||
|
||||
If you encounter any problems during use or have any suggestions, please feel free to open
|
||||
@ -45,10 +43,6 @@ a [GitHub ISSUE](https://github.com/ColdeZhang/Dominion/issues) about your quest
|
||||
|
||||
For detailed contribution guidelines (such as **translation** etc.), please see [CONTRIBUTING](CONTRIBUTING.md)。
|
||||
|
||||
> **This project was developed under chinese-simplified originally. It's Multi-Language was translated by AI currently.**
|
||||
> **So, there must be some mistakes in the translation. If you find any mistakes (or inappropriate translations), please**
|
||||
> **feel free to modify it and submit a pull request. See [Translating](CONTRIBUTING.md#translating) for more details.**
|
||||
|
||||
## bStats Statics
|
||||
|
||||
<div align="center">
|
||||
|
18
README_zh.md
18
README_zh.md
@ -29,6 +29,9 @@ Dominion 是一个完全开源、免费,专为高版本开发,面向未来
|
||||
|
||||
- 1.20.1+ (Bukkit、Spigot、Paper、Folia)
|
||||
|
||||
> 需要使用 Java21 运行你的服务端,如果你还在使用 Java17 可以放心替换为 Java21,理论上 1.20.1+ 版本的服务端核心可以直接升级到
|
||||
> Java21 启动。
|
||||
|
||||
> 虽然本插件支持 Spigot,但是我们强烈建议您将您的核心升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。
|
||||
|
||||
## 帮助我们不断改进
|
||||
@ -39,21 +42,6 @@ Dominion 是一个完全开源、免费,专为高版本开发,面向未来
|
||||
|
||||
交流QQ群:309428300
|
||||
|
||||
## 开发者指南
|
||||
|
||||
Dominion 提供了一些简单(只是暂时,后续会逐步增强api)的 API 供开发者基于 Dominion
|
||||
构建一些更有趣的东西。您可以查看 [开发者指南](docs/zh-cn/developer.md) 了解更多细节。
|
||||
|
||||
## 整个烂活儿
|
||||
|
||||
| | Dominion | R插件 | G插件 |
|
||||
|---------|----------|-----|-----|
|
||||
| 纳秒级索引 | 😊 | 😑 | 😭 |
|
||||
| 权限组快捷配置 | 😊 | 😭 | 😑 |
|
||||
| 开源可信 | 😊 | 😑 | 😑 |
|
||||
| 高版本快速跟进 | 😊 | 😭 | 😑 |
|
||||
| 完全免费 | 😊 | 😑 | 😑 |
|
||||
|
||||
## 统计
|
||||
|
||||
<div align="center">
|
||||
|
1
api
1
api
@ -1 +0,0 @@
|
||||
Subproject commit 9a22a3e453ef0391741b6282a5b7f7219bfbbb0c
|
@ -6,15 +6,11 @@ plugins {
|
||||
id("io.papermc.hangar-publish-plugin") version "0.1.2"
|
||||
}
|
||||
|
||||
var BuildFull = properties["BuildFull"].toString() == "true"
|
||||
var libraries = listOf<String>()
|
||||
libraries = libraries + "cn.lunadeer:MinecraftPluginUtils:2.0.7"
|
||||
|
||||
group = "cn.lunadeer"
|
||||
version = "2.14.1-beta"
|
||||
version = "2.7.1-beta"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
|
||||
// utf-8
|
||||
@ -33,6 +29,7 @@ allprojects {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://repo.mikeprimm.com/")
|
||||
maven("https://ssl.lunadeer.cn:14454/repository/maven-snapshots/")
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
}
|
||||
|
||||
@ -41,15 +38,8 @@ allprojects {
|
||||
compileOnly("us.dynmap:DynmapCoreAPI:3.4")
|
||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||
|
||||
if (!BuildFull) {
|
||||
libraries.forEach {
|
||||
compileOnly(it)
|
||||
}
|
||||
} else {
|
||||
libraries.forEach {
|
||||
implementation(it)
|
||||
}
|
||||
}
|
||||
implementation("cn.lunadeer:MinecraftPluginUtils:1.3.8-SNAPSHOT")
|
||||
implementation("org.yaml:snakeyaml:2.0")
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
@ -63,15 +53,6 @@ allprojects {
|
||||
filter {
|
||||
it.replace("@version@", rootProject.version.toString())
|
||||
}
|
||||
if (!BuildFull) {
|
||||
var libs = "libraries: ["
|
||||
libraries.forEach {
|
||||
libs += "$it,"
|
||||
}
|
||||
filter {
|
||||
it.replace("libraries: [ ]", libs.substring(0, libs.length - 1) + "]")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,8 +60,6 @@ allprojects {
|
||||
archiveClassifier.set("")
|
||||
archiveVersion.set(project.version.toString())
|
||||
dependsOn(tasks.withType<ProcessResources>())
|
||||
// add -lite to the end of the file name if BuildLite is true or -full if BuildLite is false
|
||||
archiveFileName.set("${project.name}-${project.version}${if (BuildFull) "-full" else "-lite"}.jar")
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +74,7 @@ tasks.shadowJar {
|
||||
archiveVersion.set(project.version.toString())
|
||||
}
|
||||
|
||||
tasks.register("Clean&Build") { // <<<< RUN THIS TASK TO BUILD PLUGIN
|
||||
tasks.register("buildPlugin") { // <<<< RUN THIS TASK TO BUILD PLUGIN
|
||||
dependsOn(tasks.clean)
|
||||
dependsOn(tasks.shadowJar)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
|
||||
// utf-8
|
||||
@ -12,6 +12,5 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":api"))
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package cn.lunadeer.dominion;
|
||||
|
||||
import cn.lunadeer.dominion.api.DominionAPI;
|
||||
import cn.lunadeer.dominion.dtos.*;
|
||||
import cn.lunadeer.dominion.utils.MessageDisplay;
|
||||
import cn.lunadeer.dominion.utils.map.MapRender;
|
||||
import cn.lunadeer.dominion.utils.Particle;
|
||||
import cn.lunadeer.dominion.utils.ResMigration;
|
||||
import cn.lunadeer.dominion.utils.map.MapRender;
|
||||
import cn.lunadeer.minecraftpluginutils.AutoTimer;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import org.bukkit.GameMode;
|
||||
@ -206,7 +205,16 @@ public class Cache {
|
||||
});
|
||||
}
|
||||
|
||||
public DominionDTO getPlayerCurrentDominion(@NotNull Player player) {
|
||||
/**
|
||||
* 获取玩家当前所在领地
|
||||
* 此方法会先判断缓存中是否有玩家当前所在领地,如果没有则遍历所有领地判断玩家所在位置
|
||||
* 如果玩家不在任何领地内,则返回null
|
||||
* 如果玩家在领地内,则返回领地信息
|
||||
*
|
||||
* @param player 玩家
|
||||
* @return 玩家当前所在领地
|
||||
*/
|
||||
public DominionDTO getPlayerCurrentDominion(Player player) {
|
||||
try (AutoTimer ignored = new AutoTimer(Dominion.config.TimerEnabled())) {
|
||||
Integer last_in_dom_id = player_current_dominion_id.get(player.getUniqueId());
|
||||
DominionDTO last_dominion = null;
|
||||
@ -231,18 +239,14 @@ public class Cache {
|
||||
return last_dominion;
|
||||
}
|
||||
if (last_dom_id != -1) {
|
||||
MessageDisplay.show(player, Dominion.config.getMessageDisplayJoinLeave(),
|
||||
last_dominion.getLeaveMessage()
|
||||
.replace("{DOM}", last_dominion.getName())
|
||||
.replace("{OWNER}", getPlayerName(last_dominion.getOwner()))
|
||||
);
|
||||
String msg = last_dominion.getLeaveMessage();
|
||||
msg = msg.replace("${DOM_NAME}", last_dominion.getName());
|
||||
Notification.actionBar(player, msg);
|
||||
}
|
||||
if (current_dom_id != -1) {
|
||||
MessageDisplay.show(player, Dominion.config.getMessageDisplayJoinLeave(),
|
||||
current_dominion.getJoinMessage()
|
||||
.replace("{DOM}", current_dominion.getName())
|
||||
.replace("{OWNER}", getPlayerName(current_dominion.getOwner()))
|
||||
);
|
||||
String msg = current_dominion.getJoinMessage();
|
||||
msg = msg.replace("${DOM_NAME}", current_dominion.getName());
|
||||
Notification.actionBar(player, msg);
|
||||
}
|
||||
|
||||
lightOrNot(player, current_dominion); // 发光检查
|
||||
@ -260,10 +264,6 @@ public class Cache {
|
||||
}
|
||||
}
|
||||
|
||||
public DominionDTO getDominionByLoc(@NotNull Location loc) {
|
||||
return dominion_trees.getLocInDominionDTO(loc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家退出时调用 用于清除玩家当前所在领地
|
||||
* 会将玩家当前所在领地设置为null
|
||||
@ -343,16 +343,28 @@ public class Cache {
|
||||
}
|
||||
}
|
||||
|
||||
public GroupDTO getGroup(@NotNull Integer id) {
|
||||
public DominionDTO getDominionByLoc(Location loc) {
|
||||
return dominion_trees.getLocInDominionDTO(loc);
|
||||
}
|
||||
|
||||
public GroupDTO getGroup(Integer id) {
|
||||
return id_groups.get(id);
|
||||
}
|
||||
|
||||
public MemberDTO getMember(@NotNull Player player, cn.lunadeer.dominion.api.dtos.@NotNull DominionDTO dominion) {
|
||||
/**
|
||||
* 获取玩家在指定领地的特权
|
||||
* 如果玩家不存在特权,则返回null
|
||||
*
|
||||
* @param player 玩家
|
||||
* @param dominion 领地
|
||||
* @return 特权表
|
||||
*/
|
||||
public MemberDTO getMember(Player player, DominionDTO dominion) {
|
||||
if (!player_uuid_to_member.containsKey(player.getUniqueId())) return null;
|
||||
return player_uuid_to_member.get(player.getUniqueId()).get(dominion.getId());
|
||||
}
|
||||
|
||||
public MemberDTO getMember(@NotNull UUID player_uuid, cn.lunadeer.dominion.api.dtos.@NotNull DominionDTO dominion) {
|
||||
public MemberDTO getMember(UUID player_uuid, DominionDTO dominion) {
|
||||
if (!player_uuid_to_member.containsKey(player_uuid)) return null;
|
||||
return player_uuid_to_member.get(player_uuid).get(dominion.getId());
|
||||
}
|
||||
@ -371,20 +383,10 @@ public class Cache {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public DominionDTO getDominion(@NotNull Integer id) {
|
||||
public DominionDTO getDominion(Integer id) {
|
||||
return id_dominions.get(id);
|
||||
}
|
||||
|
||||
public String getPlayerName(UUID uuid) {
|
||||
if (!player_name_cache.containsKey(uuid)) {
|
||||
PlayerDTO playerDTO = PlayerDTO.select(uuid);
|
||||
if (playerDTO != null) {
|
||||
player_name_cache.put(uuid, playerDTO.getLastKnownName());
|
||||
}
|
||||
}
|
||||
return player_name_cache.getOrDefault(uuid, "Unknown");
|
||||
}
|
||||
|
||||
public int getPlayerDominionCount(UUID player_uuid) {
|
||||
int count = 0;
|
||||
for (DominionDTO dominion : id_dominions.values()) {
|
||||
@ -414,7 +416,7 @@ public class Cache {
|
||||
return residence_data.get(player_uuid);
|
||||
}
|
||||
|
||||
public @NotNull List<cn.lunadeer.dominion.api.dtos.DominionDTO> getAllDominions() {
|
||||
public List<DominionDTO> getDominions() {
|
||||
return new ArrayList<>(id_dominions.values());
|
||||
}
|
||||
|
||||
@ -450,7 +452,6 @@ public class Cache {
|
||||
private static final long UPDATE_INTERVAL = 1000 * 4;
|
||||
private boolean recheckPlayerState = false; // 是否需要重新检查玩家状态(发光、飞行)
|
||||
public final Map<UUID, LocalDateTime> NextTimeAllowTeleport = new java.util.HashMap<>();
|
||||
private final Map<UUID, String> player_name_cache = new HashMap<>();
|
||||
|
||||
private Map<UUID, List<ResMigration.ResidenceNode>> residence_data = null;
|
||||
|
||||
@ -594,7 +595,7 @@ public class Cache {
|
||||
}
|
||||
}
|
||||
|
||||
public @Nullable GroupDTO getPlayerUsingGroupTitle(@NotNull UUID uuid) {
|
||||
public @Nullable GroupDTO getPlayerUsingGroupTitle(UUID uuid) {
|
||||
if (!Dominion.config.getGroupTitleEnable()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -118,12 +118,6 @@ public class Commands implements TabExecutor {
|
||||
case "export_mca":
|
||||
Operator.exportMca(sender, args);
|
||||
break;
|
||||
case "export_db":
|
||||
Operator.exportDatabase(sender, args);
|
||||
break;
|
||||
case "import_db":
|
||||
Operator.importDatabase(sender, args);
|
||||
break;
|
||||
// case "set_config":
|
||||
// SetConfig.handler(sender, args);
|
||||
// break;
|
||||
@ -222,9 +216,6 @@ public class Commands implements TabExecutor {
|
||||
"reload_cache",
|
||||
"reload_config",
|
||||
"export_mca",
|
||||
"export_db",
|
||||
"import_db",
|
||||
"version",
|
||||
"sys_config",
|
||||
"all_dominion",
|
||||
"set_map_color",
|
||||
|
@ -39,15 +39,15 @@ public final class Dominion extends JavaPlugin {
|
||||
new Scheduler(this);
|
||||
AutoClean.run();
|
||||
Cache.instance = new Cache();
|
||||
DominionInterface.instance = new DominionInterface();
|
||||
|
||||
if (config.getGroupTitleEnable()) {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
new PlaceHolderApi(this);
|
||||
}
|
||||
if (config.getGroupTitleEnable() && !Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
} else {
|
||||
XLogger.warn(Translation.Messages_PlaceholderAPINotFound);
|
||||
config.setGroupTitleEnable(false);
|
||||
}
|
||||
}
|
||||
|
||||
new EventsRegister(this);
|
||||
Objects.requireNonNull(Bukkit.getPluginCommand("dominion")).setExecutor(new Commands());
|
||||
|
@ -1,76 +0,0 @@
|
||||
package cn.lunadeer.dominion;
|
||||
|
||||
import cn.lunadeer.dominion.api.DominionAPI;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.dominion.dtos.GroupDTO;
|
||||
import cn.lunadeer.dominion.dtos.MemberDTO;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DominionInterface implements DominionAPI {
|
||||
|
||||
public static DominionInterface instance;
|
||||
|
||||
@Override
|
||||
public DominionDTO getPlayerCurrentDominion(@NotNull Player player) {
|
||||
return Cache.instance.getPlayerCurrentDominion(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO getDominionByLoc(@NotNull Location loc) {
|
||||
return Cache.instance.getDominionByLoc(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupDTO getGroup(@NotNull Integer id) {
|
||||
return Cache.instance.getGroup(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberDTO getMember(@NotNull Player player, cn.lunadeer.dominion.api.dtos.@NotNull DominionDTO dominion) {
|
||||
return Cache.instance.getMember(player.getUniqueId(), dominion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberDTO getMember(@NotNull UUID player_uuid, cn.lunadeer.dominion.api.dtos.@NotNull DominionDTO dominion) {
|
||||
return Cache.instance.getMember(player_uuid, dominion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO getDominion(@NotNull Integer id) {
|
||||
return Cache.instance.getDominion(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<cn.lunadeer.dominion.api.dtos.DominionDTO> getAllDominions() {
|
||||
return Cache.instance.getAllDominions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable GroupDTO getPlayerUsingGroupTitle(@NotNull UUID uuid) {
|
||||
return Cache.instance.getPlayerUsingGroupTitle(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<cn.lunadeer.dominion.api.dtos.Flag> getEnvironmentFlagsEnabled() {
|
||||
return new ArrayList<>(Flag.getEnvironmentFlagsEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<cn.lunadeer.dominion.api.dtos.Flag> getPrivilegeFlagsEnabled() {
|
||||
return new ArrayList<>(Flag.getPrivilegeFlagsEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public cn.lunadeer.dominion.api.dtos.@Nullable Flag getFlagByName(@NotNull String flagName) {
|
||||
return Flag.getFlag(flagName);
|
||||
}
|
||||
|
||||
}
|
@ -44,7 +44,7 @@ public class Helper {
|
||||
if (dominion == null) return groups_name;
|
||||
List<GroupDTO> groups = GroupDTO.selectByDominionId(dominion.getId());
|
||||
for (GroupDTO group : groups) {
|
||||
groups_name.add(group.getNamePlain());
|
||||
groups_name.add(group.getName());
|
||||
}
|
||||
return groups_name;
|
||||
}
|
||||
|
@ -2,8 +2,7 @@ package cn.lunadeer.dominion.commands;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.api.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.managers.DatabaseTables;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.dominion.utils.map.MapRender;
|
||||
import cn.lunadeer.minecraftpluginutils.GiteaReleaseCheck;
|
||||
@ -53,7 +52,7 @@ public class Operator {
|
||||
Scheduler.runTaskAsync(() -> {
|
||||
Notification.info(sender, Translation.Commands_Operator_ExportingMCAList);
|
||||
Map<String, List<String>> mca_cords = new HashMap<>();
|
||||
List<DominionDTO> doms = Cache.instance.getAllDominions();
|
||||
List<DominionDTO> doms = Cache.instance.getDominions();
|
||||
for (DominionDTO dom : doms) {
|
||||
if (dom.getWorld() == null) {
|
||||
continue;
|
||||
@ -141,42 +140,6 @@ public class Operator {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据库
|
||||
* /dominion export_db [confirm]
|
||||
*
|
||||
* @param sender 发送者
|
||||
* @param args 参数
|
||||
*/
|
||||
public static void exportDatabase(CommandSender sender, String[] args) {
|
||||
if (!hasPermission(sender, "dominion.admin")) {
|
||||
return;
|
||||
}
|
||||
if (args.length != 2 || !args[1].equals("confirm")) {
|
||||
Notification.warn(sender, Translation.Commands_Operator_ExportDBConfirm);
|
||||
return;
|
||||
}
|
||||
DatabaseTables.Export(sender);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据库
|
||||
* /dominion import_db [confirm]
|
||||
*
|
||||
* @param sender 发送者
|
||||
* @param args 参数
|
||||
*/
|
||||
public static void importDatabase(CommandSender sender, String[] args) {
|
||||
if (!hasPermission(sender, "dominion.admin")) {
|
||||
return;
|
||||
}
|
||||
if (args.length != 2 || !args[1].equals("confirm")) {
|
||||
Notification.warn(sender, Translation.Commands_Operator_ImportDBConfirm);
|
||||
return;
|
||||
}
|
||||
DatabaseTables.Import(sender);
|
||||
}
|
||||
|
||||
public static void version(CommandSender sender, String[] args) {
|
||||
if (!hasPermission(sender, "dominion.admin")) {
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ public class Title {
|
||||
}
|
||||
DominionDTO dominion = Cache.instance.getDominion(group.getDomID());
|
||||
if (dominion == null) {
|
||||
Notification.error(sender, Translation.Commands_Title_GroupDominionNotExist, group.getNamePlain());
|
||||
Notification.error(sender, Translation.Commands_Title_GroupDominionNotExist, group.getName());
|
||||
return;
|
||||
}
|
||||
if (!dominion.getOwner().equals(bukkit_player.getUniqueId())) {
|
||||
@ -53,12 +53,12 @@ public class Title {
|
||||
return;
|
||||
}
|
||||
if (!Objects.equals(member.getGroupId(), group.getId())) {
|
||||
Notification.error(sender, Translation.Commands_Title_NotGroupMember, group.getNamePlain());
|
||||
Notification.error(sender, Translation.Commands_Title_NotGroupMember, group.getName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
player.setUsingGroupTitleID(group.getId());
|
||||
Notification.info(sender, Translation.Commands_Title_UseTitleSuccess, group.getNamePlain());
|
||||
Notification.info(sender, Translation.Commands_Title_UseTitleSuccess, group.getName());
|
||||
}
|
||||
int page = getPage(args, 2);
|
||||
TitleList.show(sender, page);
|
||||
|
@ -727,28 +727,20 @@ public class DominionController {
|
||||
int x_length = x2 - x1;
|
||||
int y_length = y2 - y1;
|
||||
int z_length = z2 - z1;
|
||||
if (x_length < Dominion.config.getLimitSizeMinX(operator.getPlayer())) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeXShouldBeGreaterThan, Dominion.config.getLimitSizeMinX(operator.getPlayer())));
|
||||
if (x_length < 4 || y_length < 4 || z_length < 4) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeShouldBeGreaterThan4));
|
||||
return true;
|
||||
}
|
||||
if (y_length < Dominion.config.getLimitSizeMinY(operator.getPlayer())) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeYShouldBeGreaterThan, Dominion.config.getLimitSizeMinY(operator.getPlayer())));
|
||||
if (x_length > Dominion.config.getLimitSizeX(operator.getPlayer()) && Dominion.config.getLimitSizeX(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeXShouldBeLessThan, Dominion.config.getLimitSizeX(operator.getPlayer())));
|
||||
return true;
|
||||
}
|
||||
if (z_length < Dominion.config.getLimitSizeMinZ(operator.getPlayer())) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeZShouldBeGreaterThan, Dominion.config.getLimitSizeMinZ(operator.getPlayer())));
|
||||
if (y_length > Dominion.config.getLimitSizeY(operator.getPlayer()) && Dominion.config.getLimitSizeY(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeYShouldBeLessThan, Dominion.config.getLimitSizeY(operator.getPlayer())));
|
||||
return true;
|
||||
}
|
||||
if (x_length > Dominion.config.getLimitSizeMaxX(operator.getPlayer()) && Dominion.config.getLimitSizeMaxX(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeXShouldBeLessThan, Dominion.config.getLimitSizeMaxX(operator.getPlayer())));
|
||||
return true;
|
||||
}
|
||||
if (y_length > Dominion.config.getLimitSizeMaxY(operator.getPlayer()) && Dominion.config.getLimitSizeMaxY(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeYShouldBeLessThan, Dominion.config.getLimitSizeMaxY(operator.getPlayer())));
|
||||
return true;
|
||||
}
|
||||
if (z_length > Dominion.config.getLimitSizeMaxZ(operator.getPlayer()) && Dominion.config.getLimitSizeMaxZ(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeZShouldBeLessThan, Dominion.config.getLimitSizeMaxZ(operator.getPlayer())));
|
||||
if (z_length > Dominion.config.getLimitSizeZ(operator.getPlayer()) && Dominion.config.getLimitSizeZ(operator.getPlayer()) > 0) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_SizeZShouldBeLessThan, Dominion.config.getLimitSizeZ(operator.getPlayer())));
|
||||
return true;
|
||||
}
|
||||
if (y2 > Dominion.config.getLimitMaxY(operator.getPlayer())) {
|
||||
|
@ -71,7 +71,7 @@ public class MemberController {
|
||||
}
|
||||
GroupDTO group = GroupDTO.select(privilege.getGroupId());
|
||||
if (group != null) {
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_PlayerBelongToGroup, player_name, group.getNamePlain()));
|
||||
operator.setResponse(FAIL.addMessage(Translation.Messages_PlayerBelongToGroup, player_name, group.getName()));
|
||||
return;
|
||||
}
|
||||
if ((flag.equals("admin") || isAdmin(privilege)) && notOwner(operator, dominion)) {
|
||||
|
@ -2,7 +2,6 @@ package cn.lunadeer.dominion.dtos;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.api.dtos.Flag;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.DatabaseManager;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.Field;
|
||||
@ -11,7 +10,6 @@ import cn.lunadeer.minecraftpluginutils.databse.syntax.InsertRow;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.UpdateRow;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -19,7 +17,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
public class DominionDTO {
|
||||
private static List<DominionDTO> query(String sql, Object... args) {
|
||||
List<DominionDTO> dominions = new ArrayList<>();
|
||||
try (ResultSet rs = DatabaseManager.instance.query(sql, args)) {
|
||||
@ -47,7 +45,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
Integer parentDomId = rs.getInt("parent_dom_id");
|
||||
String tp_location = rs.getString("tp_location");
|
||||
Map<Flag, Boolean> flags = new HashMap<>();
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getDominionFlagsEnabled()) {
|
||||
for (Flag f : Flag.getDominionFlagsEnabled()) {
|
||||
flags.put(f, rs.getBoolean(f.getFlagName()));
|
||||
}
|
||||
String color = rs.getString("color");
|
||||
@ -90,7 +88,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
String sql = "SELECT * FROM dominion WHERE id = ? AND id > 0;";
|
||||
List<DominionDTO> dominions = query(sql, id);
|
||||
if (dominions.isEmpty()) return null;
|
||||
return dominions.get(0);
|
||||
return dominions.getFirst();
|
||||
}
|
||||
|
||||
public static List<DominionDTO> selectByParentId(World world, Integer parentId) {
|
||||
@ -114,7 +112,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
String sql = "SELECT * FROM dominion WHERE name = ? AND id > 0;";
|
||||
List<DominionDTO> dominions = query(sql, name);
|
||||
if (dominions.isEmpty()) return null;
|
||||
return dominions.get(0);
|
||||
return dominions.getFirst();
|
||||
}
|
||||
|
||||
public static DominionDTO insert(DominionDTO dominion) {
|
||||
@ -127,14 +125,14 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
.field(dominion.parentDomId)
|
||||
.field(dominion.joinMessage).field(dominion.leaveMessage)
|
||||
.field(dominion.tp_location);
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getDominionFlagsEnabled()) {
|
||||
for (Flag f : Flag.getDominionFlagsEnabled()) {
|
||||
insert.field(new Field(f.getFlagName(), f.getDefaultValue()));
|
||||
}
|
||||
try (ResultSet rs = insert.execute()) {
|
||||
Cache.instance.loadDominions();
|
||||
List<DominionDTO> dominions = getDTOFromRS(rs);
|
||||
if (dominions.isEmpty()) return null;
|
||||
return dominions.get(0);
|
||||
return dominions.getFirst();
|
||||
} catch (SQLException e) {
|
||||
DatabaseManager.handleDatabaseError("DominionDTO.insert ", e, insert.toString());
|
||||
return null;
|
||||
@ -187,8 +185,6 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
this.y2.value = y2;
|
||||
this.z2.value = z2;
|
||||
this.parentDomId.value = parentDomId;
|
||||
this.joinMessage.value = Dominion.config.getDefaultJoinMessage();
|
||||
this.leaveMessage.value = Dominion.config.getDefaultLeaveMessage();
|
||||
}
|
||||
|
||||
public DominionDTO(UUID owner, String name, @NotNull World world,
|
||||
@ -211,8 +207,8 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
private final Field y2 = new Field("y2", FieldType.INT);
|
||||
private final Field z2 = new Field("z2", FieldType.INT);
|
||||
private final Field parentDomId = new Field("parent_dom_id", -1);
|
||||
private final Field joinMessage = new Field("join_message", "");
|
||||
private final Field leaveMessage = new Field("leave_message", "");
|
||||
private final Field joinMessage = new Field("join_message", "欢迎来到 ${DOM_NAME}!");
|
||||
private final Field leaveMessage = new Field("leave_message", "你正在离开 ${DOM_NAME},欢迎下次光临~");
|
||||
private final Map<Flag, Boolean> flags = new HashMap<>();
|
||||
private final Field tp_location = new Field("tp_location", "default");
|
||||
private final Field color = new Field("color", "#00BFFF");
|
||||
@ -220,13 +216,11 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
|
||||
|
||||
// getters and setters
|
||||
@Override
|
||||
public @NotNull Integer getId() {
|
||||
public Integer getId() {
|
||||
return (Integer) id.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull UUID getOwner() {
|
||||
public UUID getOwner() {
|
||||
return UUID.fromString((String) owner.value);
|
||||
}
|
||||
|
||||
@ -238,48 +232,36 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
List<DominionDTO> dominions = getDTOFromRS(rs);
|
||||
if (dominions.isEmpty()) return null;
|
||||
Cache.instance.loadDominions((Integer) id.value);
|
||||
return dominions.get(0);
|
||||
return dominions.getFirst();
|
||||
} catch (SQLException e) {
|
||||
DatabaseManager.handleDatabaseError("DominionDTO.doUpdate ", e, updateRow.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setOwner(UUID owner) {
|
||||
this.owner.value = owner.toString();
|
||||
return doUpdate(new UpdateRow().field(this.owner));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setOwner(Player owner) {
|
||||
this.owner.value = owner.getUniqueId().toString();
|
||||
return doUpdate(new UpdateRow().field(this.owner));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getName() {
|
||||
public String getName() {
|
||||
return (String) name.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setName(String name) {
|
||||
this.name.value = name;
|
||||
return doUpdate(new UpdateRow().field(this.name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable World getWorld() {
|
||||
return Dominion.instance.getServer().getWorld(getWorldUid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull UUID getWorldUid() {
|
||||
public UUID getWorldUid() {
|
||||
return UUID.fromString((String) world_uid.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getX1() {
|
||||
public Integer getX1() {
|
||||
return (Integer) x1.value;
|
||||
}
|
||||
|
||||
@ -288,8 +270,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.x1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getY1() {
|
||||
public Integer getY1() {
|
||||
return (Integer) y1.value;
|
||||
}
|
||||
|
||||
@ -298,8 +279,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.y1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getZ1() {
|
||||
public Integer getZ1() {
|
||||
return (Integer) z1.value;
|
||||
}
|
||||
|
||||
@ -308,8 +288,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.z1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getX2() {
|
||||
public Integer getX2() {
|
||||
return (Integer) x2.value;
|
||||
}
|
||||
|
||||
@ -318,8 +297,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.x2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getY2() {
|
||||
public Integer getY2() {
|
||||
return (Integer) y2.value;
|
||||
}
|
||||
|
||||
@ -328,8 +306,7 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.y2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getZ2() {
|
||||
public Integer getZ2() {
|
||||
return (Integer) z2.value;
|
||||
}
|
||||
|
||||
@ -338,53 +315,43 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.z2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getSquare() {
|
||||
public Integer getSquare() {
|
||||
return getWidthX() * getWidthZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getVolume() {
|
||||
public Integer getVolume() {
|
||||
return getSquare() * getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getWidthX() {
|
||||
public Integer getWidthX() {
|
||||
return getX2() - getX1();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getHeight() {
|
||||
public Integer getHeight() {
|
||||
return getY2() - getY1();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getWidthZ() {
|
||||
public Integer getWidthZ() {
|
||||
return getZ2() - getZ1();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getParentDomId() {
|
||||
public Integer getParentDomId() {
|
||||
return (Integer) parentDomId.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getJoinMessage() {
|
||||
public String getJoinMessage() {
|
||||
return (String) joinMessage.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setJoinMessage(String joinMessage) {
|
||||
this.joinMessage.value = joinMessage;
|
||||
return doUpdate(new UpdateRow().field(this.joinMessage));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getLeaveMessage() {
|
||||
public String getLeaveMessage() {
|
||||
return (String) leaveMessage.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setLeaveMessage(String leaveMessage) {
|
||||
this.leaveMessage.value = leaveMessage;
|
||||
return doUpdate(new UpdateRow().field(this.leaveMessage));
|
||||
@ -395,28 +362,12 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return flags.get(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<Flag, Boolean> getEnvironmentFlagValue() {
|
||||
return flags.entrySet().stream()
|
||||
.filter(e -> e.getKey().isEnvironmentFlag())
|
||||
.collect(HashMap::new, (m, e) -> m.put(e.getKey(), e.getValue()), HashMap::putAll);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<Flag, Boolean> getGuestPrivilegeFlagValue() {
|
||||
return flags.entrySet().stream()
|
||||
.filter(e -> !e.getKey().isEnvironmentFlag())
|
||||
.collect(HashMap::new, (m, e) -> m.put(e.getKey(), e.getValue()), HashMap::putAll);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setFlagValue(@NotNull Flag flag, @NotNull Boolean value) {
|
||||
public DominionDTO setFlagValue(Flag flag, Boolean value) {
|
||||
flags.put(flag, value);
|
||||
Field flagField = new Field(flag.getFlagName(), value);
|
||||
return doUpdate(new UpdateRow().field(flagField));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setXYZ(Integer x1, Integer y1, Integer z1, Integer x2, Integer y2, Integer z2) {
|
||||
this.x1.value = x1;
|
||||
this.y1.value = y1;
|
||||
@ -424,25 +375,9 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
this.x2.value = x2;
|
||||
this.y2.value = y2;
|
||||
this.z2.value = z2;
|
||||
if (x1 > x2) {
|
||||
int tmp = x1;
|
||||
this.x1.value = x2;
|
||||
this.x2.value = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
int tmp = y1;
|
||||
this.y1.value = y2;
|
||||
this.y2.value = tmp;
|
||||
}
|
||||
if (z1 > z2) {
|
||||
int tmp = z1;
|
||||
this.z1.value = z2;
|
||||
this.z2.value = tmp;
|
||||
}
|
||||
return doUpdate(new UpdateRow().field(this.x1).field(this.y1).field(this.z1).field(this.x2).field(this.y2).field(this.z2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DominionDTO setXYZ(int[] cords) {
|
||||
if (cords.length == 6) {
|
||||
return setXYZ(cords[0], cords[1], cords[2], cords[3], cords[4], cords[5]);
|
||||
@ -453,7 +388,6 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Location getTpLocation() {
|
||||
if (Objects.equals(tp_location.value, "default")) {
|
||||
return null;
|
||||
@ -476,13 +410,11 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(tp_location));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Location getLocation1() {
|
||||
public Location getLocation1() {
|
||||
return new Location(getWorld(), getX1(), getY1(), getZ1());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Location getLocation2() {
|
||||
public Location getLocation2() {
|
||||
return new Location(getWorld(), getX2(), getY2(), getZ2());
|
||||
}
|
||||
|
||||
@ -491,27 +423,22 @@ public class DominionDTO implements cn.lunadeer.dominion.api.dtos.DominionDTO {
|
||||
return doUpdate(new UpdateRow().field(this.color));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorR() {
|
||||
return Integer.valueOf(getColor().substring(1, 3), 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorG() {
|
||||
return Integer.valueOf(getColor().substring(3, 5), 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorB() {
|
||||
return Integer.valueOf(getColor().substring(5, 7), 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getColor() {
|
||||
public String getColor() {
|
||||
return (String) color.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorHex() {
|
||||
return (getColorR() << 16) + (getColorG() << 8) + getColorB();
|
||||
}
|
||||
|
@ -7,14 +7,13 @@ import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import cn.lunadeer.minecraftpluginutils.i18n.Localization;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.Collator;
|
||||
import java.util.*;
|
||||
|
||||
public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
public enum Flag {
|
||||
ANCHOR("anchor", "重生锚", "是否允许设置/使用重生锚", false, false, true),
|
||||
ANIMAL_KILLING("animal_killing", "对动物造成伤害", "是否允许对动物造成伤害", false, false, true),
|
||||
ANIMAL_SPAWN("animal_spawn", "动物生成(繁殖)", "是否允许动物生成(包括繁殖)", true, true, false),
|
||||
@ -45,7 +44,6 @@ public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
FLOW_IN_PROTECTION("flow_in_protection", "外部流体是否可以进入", "包含:岩浆、水(不会阻止领地内部的流体蔓延)", false, true, true),
|
||||
FLY("fly", "飞行", "不是翅鞘飞行,是类似于创造模式的飞行", false, false, false),
|
||||
GLOW("glow", "玩家发光", "类似光灵箭的高亮效果", false, false, true),
|
||||
GRAVITY_BLOCK("gravity_block", "允许外部重力方块落入", "如果禁止则领地外重力方块进入领地会变为掉落物", false, true, true),
|
||||
HARVEST("harvest", "收获", "收获庄稼、作物", false, false, true),
|
||||
HONEY("honey", "蜂巢交互", "是否可以采蜂蜜", false, false, true),
|
||||
HOOK("hook", "使用钓钩", "是否可以使用钓钩", false, false, true),
|
||||
@ -102,36 +100,26 @@ public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getFlagName() {
|
||||
public String getFlagName() {
|
||||
return flag_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getDisplayName() {
|
||||
public String getDisplayName() {
|
||||
return display_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getDescription() {
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean getDefaultValue() {
|
||||
public Boolean getDefaultValue() {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean getEnable() {
|
||||
public Boolean getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean isEnvironmentFlag() {
|
||||
return dominion_only;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.display_name = displayName;
|
||||
}
|
||||
@ -160,24 +148,7 @@ public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
return Arrays.asList(Flag.values());
|
||||
}
|
||||
|
||||
public static List<Flag> getDominionFlagsEnabled() {
|
||||
List<Flag> flags = new ArrayList<>();
|
||||
for (Flag flag : Flag.values()) {
|
||||
if (!flag.enable) {
|
||||
continue;
|
||||
}
|
||||
flags.add(flag);
|
||||
}
|
||||
Comparator<Object> comparator = Collator.getInstance(java.util.Locale.CHINA);
|
||||
flags.sort((o1, o2) -> comparator.compare(o1.getDisplayName(), o2.getDisplayName()));
|
||||
return flags;
|
||||
}
|
||||
|
||||
public static boolean isDominionOnlyFlag(String flagName) {
|
||||
return getFlag(flagName).dominion_only;
|
||||
}
|
||||
|
||||
public static List<Flag> getEnvironmentFlagsEnabled() {
|
||||
public static List<Flag> getDominionOnlyFlagsEnabled() {
|
||||
List<Flag> flags = new ArrayList<>();
|
||||
for (Flag flag : Flag.values()) {
|
||||
if (!flag.dominion_only) {
|
||||
@ -193,6 +164,28 @@ public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
return flags;
|
||||
}
|
||||
|
||||
public static boolean isDominionOnlyFlag(String flagName) {
|
||||
return getFlag(flagName).dominion_only;
|
||||
}
|
||||
|
||||
public static List<Flag> getDominionFlagsEnabled() {
|
||||
List<Flag> flags = new ArrayList<>();
|
||||
for (Flag flag : Flag.values()) {
|
||||
if (!flag.enable) {
|
||||
continue;
|
||||
}
|
||||
flags.add(flag);
|
||||
}
|
||||
Comparator<Object> comparator = Collator.getInstance(java.util.Locale.CHINA);
|
||||
flags.sort((o1, o2) -> comparator.compare(o1.getDisplayName(), o2.getDisplayName()));
|
||||
return flags;
|
||||
}
|
||||
|
||||
public static List<Flag> getAllDominionFlags() {
|
||||
return new ArrayList<>(Arrays.asList(Flag.values()));
|
||||
}
|
||||
|
||||
|
||||
public static List<Flag> getPrivilegeFlagsEnabled() {
|
||||
List<Flag> flags = new ArrayList<>();
|
||||
for (Flag flag : Flag.values()) {
|
||||
@ -209,10 +202,6 @@ public enum Flag implements cn.lunadeer.dominion.api.dtos.Flag {
|
||||
return flags;
|
||||
}
|
||||
|
||||
public static List<Flag> getAllDominionFlags() {
|
||||
return new ArrayList<>(Arrays.asList(Flag.values()));
|
||||
}
|
||||
|
||||
public static List<Flag> getAllPrivilegeFlags() {
|
||||
List<Flag> flags = new ArrayList<>();
|
||||
for (Flag flag : Flag.values()) {
|
||||
|
@ -2,7 +2,6 @@ package cn.lunadeer.dominion.dtos;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.api.dtos.Flag;
|
||||
import cn.lunadeer.minecraftpluginutils.ColorParser;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.DatabaseManager;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.Field;
|
||||
@ -10,8 +9,6 @@ import cn.lunadeer.minecraftpluginutils.databse.FieldType;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.InsertRow;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.UpdateRow;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
@ -19,92 +16,69 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
public class GroupDTO {
|
||||
|
||||
Field id = new Field("id", FieldType.INT);
|
||||
Field domID = new Field("dom_id", FieldType.INT);
|
||||
Field name_raw = new Field("name", FieldType.STRING);
|
||||
Field name = new Field("name", FieldType.STRING);
|
||||
Field admin = new Field("admin", FieldType.BOOLEAN);
|
||||
Field name_color = new Field("name_colored", FieldType.STRING);
|
||||
Field name_colored = new Field("name_colored", FieldType.STRING);
|
||||
|
||||
private final Map<Flag, Boolean> flags = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getId() {
|
||||
public Integer getId() {
|
||||
return (Integer) id.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Integer getDomID() {
|
||||
public Integer getDomID() {
|
||||
return (Integer) domID.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getNameRaw() {
|
||||
return (String) name_color.value;
|
||||
public String getName() {
|
||||
return (String) name.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getNamePlain() {
|
||||
return (String) name_raw.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Component getNameColoredComponent() {
|
||||
public Component getNameColoredComponent() {
|
||||
String with_pre_suf = "&#ffffff" +
|
||||
Dominion.config.getGroupTitlePrefix() +
|
||||
(String) name_color.value +
|
||||
(String) name_colored.value +
|
||||
"&#ffffff" +
|
||||
Dominion.config.getGroupTitleSuffix();
|
||||
return ColorParser.getComponentType(with_pre_suf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getNameColoredBukkit() {
|
||||
public String getNameColoredBukkit() {
|
||||
String with_pre_suf = "&#ffffff" +
|
||||
Dominion.config.getGroupTitlePrefix() +
|
||||
(String) name_color.value +
|
||||
(String) name_colored.value +
|
||||
"&#ffffff" +
|
||||
Dominion.config.getGroupTitleSuffix();
|
||||
return ColorParser.getBukkitType(with_pre_suf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean getAdmin() {
|
||||
public Boolean getAdmin() {
|
||||
return (Boolean) admin.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean getFlagValue(@NotNull Flag flag) {
|
||||
public Boolean getFlagValue(Flag flag) {
|
||||
if (!flags.containsKey(flag)) return flag.getDefaultValue();
|
||||
return flags.get(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<Flag, Boolean> getFlagsValue() {
|
||||
return flags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable GroupDTO setName(@NotNull String name) {
|
||||
this.name_color.value = name;
|
||||
this.name_raw.value = ColorParser.getPlainText(name);
|
||||
UpdateRow updateRow = new UpdateRow().field(this.name_raw).field(this.name_color);
|
||||
public GroupDTO setName(String name) {
|
||||
this.name_colored.value = name;
|
||||
this.name.value = ColorParser.getPlainText(name);
|
||||
UpdateRow updateRow = new UpdateRow().field(this.name).field(this.name_colored);
|
||||
return doUpdate(updateRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable GroupDTO setAdmin(@NotNull Boolean admin) {
|
||||
public GroupDTO setAdmin(Boolean admin) {
|
||||
this.admin.value = admin;
|
||||
UpdateRow updateRow = new UpdateRow().field(this.admin);
|
||||
return doUpdate(updateRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupDTO setFlagValue(@NotNull Flag flag, @NotNull Boolean value) {
|
||||
if (flag.isEnvironmentFlag()) {
|
||||
return null;
|
||||
}
|
||||
public GroupDTO setFlagValue(Flag flag, Boolean value) {
|
||||
flags.put(flag, value);
|
||||
Field f = new Field(flag.getFlagName(), value);
|
||||
UpdateRow updateRow = new UpdateRow().field(f);
|
||||
@ -116,17 +90,17 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
InsertRow insertRow = new InsertRow().returningAll().onConflictDoNothing(new Field("id", null));
|
||||
insertRow.table("dominion_group")
|
||||
.field(group.domID)
|
||||
.field(group.name_raw)
|
||||
.field(group.name)
|
||||
.field(group.admin)
|
||||
.field(group.name_color);
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
.field(group.name_colored);
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
insertRow.field(new Field(f.getFlagName(), dominionDTO.getFlagValue(f)));
|
||||
}
|
||||
try (ResultSet rs = insertRow.execute()) {
|
||||
List<GroupDTO> groups = getDTOFromRS(rs);
|
||||
if (groups.isEmpty()) return null;
|
||||
Cache.instance.loadGroups(groups.get(0).getId());
|
||||
return groups.get(0);
|
||||
Cache.instance.loadGroups(groups.getFirst().getId());
|
||||
return groups.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("GroupDTO.create ", e, "");
|
||||
return null;
|
||||
@ -151,14 +125,14 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
String sql = "SELECT * FROM dominion_group WHERE id = ?;";
|
||||
List<GroupDTO> groups = getDTOFromRS(DatabaseManager.instance.query(sql, id));
|
||||
if (groups.isEmpty()) return null;
|
||||
return groups.get(0);
|
||||
return groups.getFirst();
|
||||
}
|
||||
|
||||
public static GroupDTO select(Integer domID, String name) {
|
||||
String sql = "SELECT * FROM dominion_group WHERE dom_id = ? AND name = ?;";
|
||||
List<GroupDTO> groups = getDTOFromRS(DatabaseManager.instance.query(sql, domID, name));
|
||||
if (groups.isEmpty()) return null;
|
||||
return groups.get(0);
|
||||
return groups.getFirst();
|
||||
}
|
||||
|
||||
public static List<GroupDTO> selectAll() {
|
||||
@ -173,10 +147,10 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
|
||||
private GroupDTO(String name, Integer domID) {
|
||||
this.domID.value = domID;
|
||||
this.name_raw.value = ColorParser.getPlainText(name);
|
||||
this.name_color.value = name;
|
||||
this.name.value = ColorParser.getPlainText(name);
|
||||
this.name_colored.value = name;
|
||||
this.admin.value = false;
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
flags.put(f, f.getDefaultValue());
|
||||
}
|
||||
}
|
||||
@ -184,10 +158,10 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
private GroupDTO(Integer id, Integer domID, String name, Boolean admin, Map<Flag, Boolean> flags, String nameColored) {
|
||||
this.id.value = id;
|
||||
this.domID.value = domID;
|
||||
this.name_raw.value = name;
|
||||
this.name.value = name;
|
||||
this.admin.value = admin;
|
||||
this.flags.putAll(flags);
|
||||
this.name_color.value = nameColored;
|
||||
this.name_colored.value = nameColored;
|
||||
}
|
||||
|
||||
private static List<GroupDTO> getDTOFromRS(ResultSet rs) {
|
||||
@ -196,7 +170,7 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
try {
|
||||
while (rs.next()) {
|
||||
Map<Flag, Boolean> flags = new HashMap<>();
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
flags.put(f, rs.getBoolean(f.getFlagName()));
|
||||
}
|
||||
GroupDTO group = new GroupDTO(
|
||||
@ -223,7 +197,7 @@ public class GroupDTO implements cn.lunadeer.dominion.api.dtos.GroupDTO {
|
||||
List<GroupDTO> groups = getDTOFromRS(rs);
|
||||
if (groups.isEmpty()) return null;
|
||||
Cache.instance.loadGroups((Integer) id.value);
|
||||
return groups.get(0);
|
||||
return groups.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("更新权限组失败: ", e, "");
|
||||
return null;
|
||||
|
@ -1,19 +1,16 @@
|
||||
package cn.lunadeer.dominion.dtos;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.api.dtos.Flag;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.DatabaseManager;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.Field;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.FieldType;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.InsertRow;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.UpdateRow;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.*;
|
||||
|
||||
public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
public class MemberDTO {
|
||||
|
||||
private static List<MemberDTO> query(String sql, Object... params) {
|
||||
List<MemberDTO> players = new ArrayList<>();
|
||||
@ -31,7 +28,7 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
try {
|
||||
while (rs.next()) {
|
||||
Map<Flag, Boolean> flags = new HashMap<>();
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
flags.put(f, rs.getBoolean(f.getFlagName()));
|
||||
}
|
||||
MemberDTO player = new MemberDTO(
|
||||
@ -58,7 +55,7 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
List<MemberDTO> players = getDTOFromRS(rs);
|
||||
if (players.isEmpty()) return null;
|
||||
Cache.instance.loadMembers(getPlayerUUID());
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("MemberDTO.doUpdate ", e, "");
|
||||
return null;
|
||||
@ -71,14 +68,14 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
.field(player.playerUUID)
|
||||
.field(player.admin)
|
||||
.field(player.domID);
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
insertRow.field(new Field(f.getFlagName(), player.getFlagValue(f)));
|
||||
}
|
||||
try (ResultSet rs = insertRow.execute()) {
|
||||
Cache.instance.loadMembers(player.getPlayerUUID());
|
||||
List<MemberDTO> players = getDTOFromRS(rs);
|
||||
if (players.isEmpty()) return null;
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("MemberDTO.insert ", e, "");
|
||||
return null;
|
||||
@ -89,7 +86,7 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
String sql = "SELECT * FROM dominion_member WHERE player_uuid = ? AND dom_id = ?;";
|
||||
List<MemberDTO> p = query(sql, playerUUID.toString(), dom_id);
|
||||
if (p.isEmpty()) return null;
|
||||
return p.get(0);
|
||||
return p.getFirst();
|
||||
}
|
||||
|
||||
public static List<MemberDTO> select(Integer dom_id) {
|
||||
@ -129,57 +126,41 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
Field domID = new Field("dom_id", FieldType.INT);
|
||||
Field groupId = new Field("group_id", FieldType.INT);
|
||||
|
||||
@Override
|
||||
public Integer getId() {
|
||||
return (Integer) id.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getPlayerUUID() {
|
||||
return UUID.fromString((String) playerUUID.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getAdmin() {
|
||||
return (Boolean) admin.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDomID() {
|
||||
return (Integer) domID.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getGroupId() {
|
||||
return (Integer) groupId.value;
|
||||
}
|
||||
|
||||
private final Map<Flag, Boolean> flags = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean getFlagValue(Flag flag) {
|
||||
public Boolean getFlagValue(Flag flag) {
|
||||
if (!flags.containsKey(flag)) return flag.getDefaultValue();
|
||||
return flags.get(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<Flag, Boolean> getFlagsValue() {
|
||||
return flags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberDTO setFlagValue(@NotNull Flag flag, @NotNull Boolean value) {
|
||||
if (flag.isEnvironmentFlag()) {
|
||||
return null;
|
||||
}
|
||||
public MemberDTO setFlagValue(Flag flag, Boolean value) {
|
||||
flags.put(flag, value);
|
||||
Field f = new Field(flag.getFlagName(), value);
|
||||
UpdateRow updateRow = new UpdateRow().field(f);
|
||||
return doUpdate(updateRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable MemberDTO setAdmin(@NotNull Boolean admin) {
|
||||
public MemberDTO setAdmin(Boolean admin) {
|
||||
this.admin.value = admin;
|
||||
UpdateRow updateRow = new UpdateRow().field(this.admin);
|
||||
return doUpdate(updateRow);
|
||||
@ -194,7 +175,7 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
public MemberDTO applyTemplate(PrivilegeTemplateDTO template) {
|
||||
this.admin.value = template.getAdmin();
|
||||
UpdateRow updateRow = new UpdateRow().field(admin);
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
this.flags.put(f, template.getFlagValue(f));
|
||||
updateRow.field(new Field(f.getFlagName(), template.getFlagValue(f)));
|
||||
}
|
||||
@ -215,7 +196,9 @@ public class MemberDTO implements cn.lunadeer.dominion.api.dtos.MemberDTO {
|
||||
this.playerUUID.value = playerUUID.toString();
|
||||
this.admin.value = false;
|
||||
this.domID.value = dom.getId();
|
||||
this.flags.putAll(dom.getGuestPrivilegeFlagValue());
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
this.flags.put(f, dom.getFlagValue(f));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -77,14 +77,14 @@ public class PlayerDTO {
|
||||
String sql = "SELECT * FROM player_name WHERE uuid = ?;";
|
||||
List<PlayerDTO> players = query(sql, uuid.toString());
|
||||
if (players.isEmpty()) return null;
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
}
|
||||
|
||||
public static PlayerDTO select(String name) {
|
||||
String sql = "SELECT * FROM player_name WHERE last_known_name = ?;";
|
||||
List<PlayerDTO> players = query(sql, name);
|
||||
if (players.isEmpty()) return null;
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
}
|
||||
|
||||
public static List<PlayerDTO> search(String name) {
|
||||
@ -114,7 +114,7 @@ public class PlayerDTO {
|
||||
try (ResultSet rs = insertRow.execute()) {
|
||||
List<PlayerDTO> players = getDTOFromRS(rs);
|
||||
if (players.isEmpty()) return null;
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
} catch (SQLException e) {
|
||||
DatabaseManager.handleDatabaseError("PlayerDTO.insert ", e, insertRow.toString());
|
||||
return null;
|
||||
@ -136,7 +136,7 @@ public class PlayerDTO {
|
||||
try (ResultSet rs = updateRow.execute()) {
|
||||
List<PlayerDTO> players = getDTOFromRS(rs);
|
||||
if (players.isEmpty()) return null;
|
||||
return players.get(0);
|
||||
return players.getFirst();
|
||||
} catch (SQLException e) {
|
||||
DatabaseManager.handleDatabaseError("PlayerDTO.update ", e, updateRow.toString());
|
||||
return null;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.lunadeer.dominion.dtos;
|
||||
|
||||
import cn.lunadeer.dominion.api.dtos.Flag;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.DatabaseManager;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.Field;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.InsertRow;
|
||||
@ -27,7 +26,7 @@ public class PrivilegeTemplateDTO {
|
||||
try {
|
||||
while (rs.next()) {
|
||||
Map<Flag, Boolean> flags = new HashMap<>();
|
||||
for (Flag f : cn.lunadeer.dominion.dtos.Flag.getPrivilegeFlagsEnabled()) {
|
||||
for (Flag f : Flag.getPrivilegeFlagsEnabled()) {
|
||||
flags.put(f, rs.getBoolean(f.getFlagName()));
|
||||
}
|
||||
PrivilegeTemplateDTO template = new PrivilegeTemplateDTO(
|
||||
@ -55,7 +54,7 @@ public class PrivilegeTemplateDTO {
|
||||
try (ResultSet rs = insertRow.execute()) {
|
||||
List<PrivilegeTemplateDTO> templates = getDTOFromRS(rs);
|
||||
if (templates.isEmpty()) return null;
|
||||
return templates.get(0);
|
||||
return templates.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("PrivilegeTemplateDTO.create ", e, null);
|
||||
return null;
|
||||
@ -70,7 +69,7 @@ public class PrivilegeTemplateDTO {
|
||||
try (ResultSet rs = updateRow.execute()) {
|
||||
List<PrivilegeTemplateDTO> templates = getDTOFromRS(rs);
|
||||
if (templates.isEmpty()) return null;
|
||||
return templates.get(0);
|
||||
return templates.getFirst();
|
||||
} catch (Exception e) {
|
||||
DatabaseManager.handleDatabaseError("PrivilegeTemplateDTO.doUpdate ", e, null);
|
||||
return null;
|
||||
@ -81,7 +80,7 @@ public class PrivilegeTemplateDTO {
|
||||
String sql = "SELECT * FROM privilege_template WHERE creator = ? AND name = ?;";
|
||||
List<PrivilegeTemplateDTO> templates = query(sql, creator.toString(), name);
|
||||
if (templates.isEmpty()) return null;
|
||||
return templates.get(0);
|
||||
return templates.getFirst();
|
||||
}
|
||||
|
||||
public static List<PrivilegeTemplateDTO> selectAll(UUID creator) {
|
||||
|
@ -2,7 +2,6 @@ package cn.lunadeer.dominion.managers;
|
||||
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.dominion.utils.MessageDisplay;
|
||||
import cn.lunadeer.minecraftpluginutils.VaultConnect.VaultConnect;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import org.bukkit.Material;
|
||||
@ -12,7 +11,10 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigManager {
|
||||
public static ConfigManager instance;
|
||||
@ -39,14 +41,7 @@ public class ConfigManager {
|
||||
_db_name = _file.getString("Database.Name", "dominion");
|
||||
_db_user = _file.getString("Database.User", "postgres");
|
||||
_db_pass = _file.getString("Database.Pass", "postgres");
|
||||
|
||||
_auto_create_radius = _file.getInt("AutoCreateRadius", 10);
|
||||
_default_join_message = _file.getString("DefaultJoinMessage", "&3{OWNER}: Welcome to {DOM}!");
|
||||
_default_leave_message = _file.getString("DefaultLeaveMessage", "&3{OWNER}: Leaving {DOM}...");
|
||||
|
||||
_message_display_no_permission = _file.getString("MessageDisplay.NoPermission", "ACTION_BAR");
|
||||
_message_display_join_leave = _file.getString("MessageDisplay.JoinLeave", "ACTION_BAR");
|
||||
|
||||
_spawn_protection = _file.getInt("Limit.SpawnProtection", 10);
|
||||
_blue_map = _file.getBoolean("BlueMap", false);
|
||||
_dynmap = _file.getBoolean("Dynmap", false);
|
||||
@ -57,7 +52,6 @@ public class ConfigManager {
|
||||
_tp_delay = _file.getInt("Teleport.Delay", 0);
|
||||
_tp_cool_down = _file.getInt("Teleport.CoolDown", 0);
|
||||
_tool = _file.getString("Tool", "ARROW");
|
||||
_info_tool = _file.getString("InfoTool", "STRING");
|
||||
|
||||
_economy_enable = _file.getBoolean("Economy.Enable", false);
|
||||
if (getEconomyEnable()) {
|
||||
@ -70,21 +64,9 @@ public class ConfigManager {
|
||||
_group_title_suffix = _file.getString("GroupTitle.Suffix", "&#ffffff]");
|
||||
|
||||
GroupLimit defaultGroup = new GroupLimit();
|
||||
if (_file.contains("Limit.SizeX")) { // todo: should be removed in the future
|
||||
defaultGroup.setLimitSizeMaxX(_file.getInt("Limit.SizeX", 128), null);
|
||||
defaultGroup.setLimitSizeMaxY(_file.getInt("Limit.SizeY", 64), null);
|
||||
defaultGroup.setLimitSizeMaxZ(_file.getInt("Limit.SizeZ", 128), null);
|
||||
defaultGroup.setLimitSizeMinX(4, null);
|
||||
defaultGroup.setLimitSizeMinY(4, null);
|
||||
defaultGroup.setLimitSizeMinZ(4, null);
|
||||
} else {
|
||||
defaultGroup.setLimitSizeMaxX(_file.getInt("Limit.Size.MaxX", 128), null);
|
||||
defaultGroup.setLimitSizeMaxY(_file.getInt("Limit.Size.MaxY", 64), null);
|
||||
defaultGroup.setLimitSizeMaxZ(_file.getInt("Limit.Size.MaxZ", 128), null);
|
||||
defaultGroup.setLimitSizeMinX(_file.getInt("Limit.Size.MinX", 4), null);
|
||||
defaultGroup.setLimitSizeMinY(_file.getInt("Limit.Size.MinY", 4), null);
|
||||
defaultGroup.setLimitSizeMinZ(_file.getInt("Limit.Size.MinZ", 4), null);
|
||||
}
|
||||
defaultGroup.setLimitSizeX(_file.getInt("Limit.SizeX", 128), null);
|
||||
defaultGroup.setLimitSizeY(_file.getInt("Limit.SizeY", 64), null);
|
||||
defaultGroup.setLimitSizeZ(_file.getInt("Limit.SizeZ", 128), null);
|
||||
defaultGroup.setLimitMinY(_file.getInt("Limit.MinY", -64), null);
|
||||
defaultGroup.setLimitMaxY(_file.getInt("Limit.MaxY", 320), null);
|
||||
defaultGroup.setLimitAmount(_file.getInt("Limit.Amount", 10), null);
|
||||
@ -128,16 +110,6 @@ public class ConfigManager {
|
||||
|
||||
_file.set("AutoCreateRadius", _auto_create_radius);
|
||||
_file.setComments("AutoCreateRadius", Arrays.asList(Translation.Config_Comment_AutoCreateRadius.trans(), Translation.Config_Comment_NegativeOneDisabled.trans()));
|
||||
_file.set("DefaultJoinMessage", _default_join_message);
|
||||
_file.setComments("DefaultJoinMessage", Collections.singletonList(Translation.Config_Comment_DefaultJoinMessage.trans()));
|
||||
_file.set("DefaultLeaveMessage", _default_leave_message);
|
||||
_file.setComments("DefaultLeaveMessage", Collections.singletonList(Translation.Config_Comment_DefaultLeaveMessage.trans()));
|
||||
|
||||
_file.setComments("MessageDisplay", Collections.singletonList(Translation.Config_Comment_MessageDisplay.trans()));
|
||||
_file.set("MessageDisplay.NoPermission", _message_display_no_permission);
|
||||
_file.setComments("MessageDisplay.NoPermission", Collections.singletonList(Translation.Config_Comment_MessageDisplayNoPermission.trans()));
|
||||
_file.set("MessageDisplay.JoinLeave", _message_display_join_leave);
|
||||
_file.setComments("MessageDisplay.JoinLeave", Collections.singletonList(Translation.Config_Comment_MessageDisplayJoinLeave.trans()));
|
||||
|
||||
_file.setComments("Limit", List.of(Translation.Config_Comment_DefaultLimit.trans()));
|
||||
_file.set("Limit.SpawnProtection", _spawn_protection);
|
||||
@ -146,18 +118,12 @@ public class ConfigManager {
|
||||
_file.setInlineComments("Limit.MinY", List.of(Translation.Config_Comment_MinY.trans()));
|
||||
_file.set("Limit.MaxY", groupLimits.get("default").getLimitMaxY(null));
|
||||
_file.setInlineComments("Limit.MaxY", List.of(Translation.Config_Comment_MaxY.trans()));
|
||||
_file.set("Limit.Size.MaxX", groupLimits.get("default").getLimitSizeMaxX(null));
|
||||
_file.setInlineComments("Limit.Size.MaxX", List.of(Translation.Config_Comment_SizeMaxX.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.Size.MaxY", groupLimits.get("default").getLimitSizeMaxY(null));
|
||||
_file.setInlineComments("Limit.Size.MaxY", List.of(Translation.Config_Comment_SizeMaxY.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.Size.MaxZ", groupLimits.get("default").getLimitSizeMaxZ(null));
|
||||
_file.setInlineComments("Limit.Size.MaxZ", List.of(Translation.Config_Comment_SizeMaxZ.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.Size.MinX", groupLimits.get("default").getLimitSizeMinX(null));
|
||||
_file.setInlineComments("Limit.Size.MinX", List.of(Translation.Config_Comment_SizeMinX.trans()));
|
||||
_file.set("Limit.Size.MinY", groupLimits.get("default").getLimitSizeMinY(null));
|
||||
_file.setInlineComments("Limit.Size.MinY", List.of(Translation.Config_Comment_SizeMinY.trans()));
|
||||
_file.set("Limit.Size.MinZ", groupLimits.get("default").getLimitSizeMinZ(null));
|
||||
_file.setInlineComments("Limit.Size.MinZ", List.of(Translation.Config_Comment_SizeMinZ.trans()));
|
||||
_file.set("Limit.SizeX", groupLimits.get("default").getLimitSizeX(null));
|
||||
_file.setInlineComments("Limit.SizeX", List.of(Translation.Config_Comment_SizeX.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.SizeY", groupLimits.get("default").getLimitSizeY(null));
|
||||
_file.setInlineComments("Limit.SizeY", List.of(Translation.Config_Comment_SizeY.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.SizeZ", groupLimits.get("default").getLimitSizeZ(null));
|
||||
_file.setInlineComments("Limit.SizeZ", List.of(Translation.Config_Comment_SizeZ.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.Amount", groupLimits.get("default").getLimitAmount(null));
|
||||
_file.setInlineComments("Limit.Amount", List.of(Translation.Config_Comment_Amount.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
_file.set("Limit.Depth", groupLimits.get("default").getLimitDepth(null));
|
||||
@ -180,8 +146,6 @@ public class ConfigManager {
|
||||
|
||||
_file.set("Tool", _tool);
|
||||
_file.setComments("Tool", List.of(Translation.Config_Comment_ToolName.trans()));
|
||||
_file.set("InfoTool", _info_tool);
|
||||
_file.setComments("InfoTool", List.of(Translation.Config_Comment_InfoToolName.trans()));
|
||||
|
||||
_file.setComments("Economy", Arrays.asList(Translation.Config_Comment_Economy.trans(), Translation.Config_Comment_VaultRequired.trans()));
|
||||
_file.set("Economy.Enable", _economy_enable);
|
||||
@ -270,42 +234,22 @@ public class ConfigManager {
|
||||
return _db_pass;
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxX(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMaxX(player.getWorld());
|
||||
public Integer getLimitSizeX(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeX(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxY(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMaxY(player.getWorld());
|
||||
public Integer getLimitSizeY(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeY(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxZ(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMaxZ(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinX(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMinX(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinY(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMinY(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinZ(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeMinZ(player.getWorld());
|
||||
public Integer getLimitSizeZ(Player player) {
|
||||
return groupLimits.get(getPlayerGroup(player)).getLimitSizeZ(player.getWorld());
|
||||
}
|
||||
|
||||
public Integer getAutoCreateRadius() {
|
||||
return _auto_create_radius;
|
||||
}
|
||||
|
||||
public String getDefaultJoinMessage() {
|
||||
return _default_join_message;
|
||||
}
|
||||
|
||||
public String getDefaultLeaveMessage() {
|
||||
return _default_leave_message;
|
||||
}
|
||||
|
||||
public void setAutoCreateRadius(Integer radius) {
|
||||
_auto_create_radius = radius;
|
||||
_file.set("AutoCreateRadius", radius);
|
||||
@ -323,14 +267,6 @@ public class ConfigManager {
|
||||
return _auto_clean_after_days;
|
||||
}
|
||||
|
||||
public MessageDisplay.Place getMessageDisplayNoPermission() {
|
||||
return MessageDisplay.Place.valueOf(_message_display_no_permission);
|
||||
}
|
||||
|
||||
public MessageDisplay.Place getMessageDisplayJoinLeave() {
|
||||
return MessageDisplay.Place.valueOf(_message_display_join_leave);
|
||||
}
|
||||
|
||||
public void setAutoCleanAfterDays(Integer auto_clean_after_days) {
|
||||
_auto_clean_after_days = auto_clean_after_days;
|
||||
_file.set("AutoCleanAfterDays", auto_clean_after_days);
|
||||
@ -399,15 +335,6 @@ public class ConfigManager {
|
||||
_file.set("Tool", tool);
|
||||
}
|
||||
|
||||
public Material getInfoTool() {
|
||||
return Material.getMaterial(_info_tool);
|
||||
}
|
||||
|
||||
public void setInfoTool(String info_tool) {
|
||||
_info_tool = info_tool;
|
||||
_file.set("InfoTool", info_tool);
|
||||
}
|
||||
|
||||
public Boolean getEconomyEnable() {
|
||||
return _economy_enable;
|
||||
}
|
||||
@ -462,26 +389,14 @@ public class ConfigManager {
|
||||
XLogger.err(Translation.Config_Check_ToolNameError);
|
||||
setTool("ARROW");
|
||||
}
|
||||
if (Material.getMaterial(_info_tool) == null) {
|
||||
XLogger.err(Translation.Config_Check_InfoToolNameError);
|
||||
setInfoTool("STRING");
|
||||
}
|
||||
if (getAutoCreateRadius() <= 0 && getAutoCreateRadius() != -1) {
|
||||
if (getAutoCreateRadius() == 0) {
|
||||
XLogger.err(Translation.Config_Check_AutoCreateRadiusError);
|
||||
setAutoCreateRadius(10);
|
||||
}
|
||||
if (getAutoCleanAfterDays() <= 0 && getAutoCleanAfterDays() != -1) {
|
||||
if (getAutoCleanAfterDays() == 0) {
|
||||
XLogger.err(Translation.Config_Check_AutoCleanAfterDaysError);
|
||||
setAutoCleanAfterDays(180);
|
||||
}
|
||||
if (Arrays.stream(MessageDisplay.Place.values()).noneMatch(place -> place.name().equals(getMessageDisplayNoPermission().name()))) {
|
||||
XLogger.err(Translation.Config_Check_MessageDisplayError, getMessageDisplayNoPermission());
|
||||
_message_display_no_permission = "ACTION_BAR";
|
||||
}
|
||||
if (Arrays.stream(MessageDisplay.Place.values()).noneMatch(place -> place.name().equals(getMessageDisplayJoinLeave().name()))) {
|
||||
XLogger.err(Translation.Config_Check_MessageDisplayError, getMessageDisplayJoinLeave());
|
||||
_message_display_join_leave = "ACTION_BAR";
|
||||
}
|
||||
if (getTpDelay() < 0) {
|
||||
XLogger.err(Translation.Config_Check_TpDelayError);
|
||||
setTpDelay(0);
|
||||
@ -511,8 +426,6 @@ public class ConfigManager {
|
||||
private String _language;
|
||||
|
||||
private Integer _auto_create_radius;
|
||||
private String _default_join_message;
|
||||
private String _default_leave_message;
|
||||
|
||||
private Boolean _limit_op_bypass;
|
||||
|
||||
@ -525,9 +438,7 @@ public class ConfigManager {
|
||||
private Boolean _tp_enable;
|
||||
private Integer _tp_delay;
|
||||
private Integer _tp_cool_down;
|
||||
|
||||
private String _tool;
|
||||
private String _info_tool;
|
||||
|
||||
private Boolean _economy_enable;
|
||||
|
||||
@ -539,9 +450,6 @@ public class ConfigManager {
|
||||
private String _group_title_prefix;
|
||||
private String _group_title_suffix;
|
||||
|
||||
private String _message_display_no_permission;
|
||||
private String _message_display_join_leave;
|
||||
|
||||
private final Map<String, GroupLimit> groupLimits = new HashMap<>();
|
||||
|
||||
private String getPlayerGroup(@Nullable Player player) {
|
||||
|
@ -1,27 +1,16 @@
|
||||
package cn.lunadeer.dominion.managers;
|
||||
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.commands.Operator;
|
||||
import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.*;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.AddColumn;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.CreateTable;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.InsertRow;
|
||||
import cn.lunadeer.minecraftpluginutils.databse.syntax.RemoveColumn;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DatabaseTables {
|
||||
public static void migrate() {
|
||||
@ -125,8 +114,8 @@ public class DatabaseTables {
|
||||
Field server_dom_y2_field = new Field("y2", 2147483647);
|
||||
Field server_dom_z2_field = new Field("z2", 2147483647);
|
||||
Field server_dom_parent_dom_id_field = new Field("parent_dom_id", -1);
|
||||
Field server_dom_join_message_field = new Field("join_message", "");
|
||||
Field server_dom_leave_message_field = new Field("leave_message", "");
|
||||
Field server_dom_join_message_field = new Field("join_message", "欢迎");
|
||||
Field server_dom_leave_message_field = new Field("leave_message", "再见");
|
||||
InsertRow insert_server_dom = new InsertRow().table("dominion").onConflictDoNothing(server_dom_id_field)
|
||||
.field(server_dom_id_field)
|
||||
.field(server_dom_owner_field)
|
||||
@ -271,79 +260,4 @@ public class DatabaseTables {
|
||||
new RemoveColumn("world").table("dominion").IfExists().execute();
|
||||
}
|
||||
}
|
||||
|
||||
private static final File export_path = new File(Dominion.instance.getDataFolder(), "ExportedDatabaseTables");
|
||||
|
||||
public static void Export(CommandSender sender) {
|
||||
Scheduler.runTaskAsync(() -> {
|
||||
Notification.info(sender, Translation.Commands_Operator_ExportDBBegin);
|
||||
if (!export_path.exists()) {
|
||||
export_path.mkdirs();
|
||||
}
|
||||
Common.ExportCSV("player_name", new File(export_path, "player_name.csv"));
|
||||
Common.ExportCSV("privilege_template", new File(export_path, "privilege_template.csv"));
|
||||
Common.ExportCSV("dominion", new File(export_path, "dominion.csv"));
|
||||
Common.ExportCSV("dominion_group", new File(export_path, "dominion_group.csv"));
|
||||
Common.ExportCSV("dominion_member", new File(export_path, "dominion_member.csv"));
|
||||
Map<String, String> world_uid_map = Dominion.instance.getServer().getWorlds().stream().collect(HashMap::new, (m, w) -> m.put(w.getName(), w.getUID().toString()), HashMap::putAll);
|
||||
YamlConfiguration world_uid = new YamlConfiguration();
|
||||
for (Map.Entry<String, String> entry : world_uid_map.entrySet()) {
|
||||
world_uid.set(entry.getKey(), entry.getValue());
|
||||
}
|
||||
try {
|
||||
world_uid.save(new File(export_path, "world_uid_mapping.yml"));
|
||||
} catch (Exception e) {
|
||||
XLogger.err("Save world_uid_mapping.yml failed: %s", e.getMessage());
|
||||
return;
|
||||
}
|
||||
Notification.info(sender, Translation.Commands_Operator_ExportDBSuccess);
|
||||
Notification.info(sender, "Path: %s", export_path.getAbsolutePath());
|
||||
});
|
||||
}
|
||||
|
||||
public static void Import(CommandSender sender) {
|
||||
Scheduler.runTaskAsync(() -> {
|
||||
if (!export_path.exists()) {
|
||||
Notification.error(sender, Translation.Commands_Operator_ImportDBFail);
|
||||
return;
|
||||
}
|
||||
Notification.info(sender, Translation.Commands_Operator_ImportDBBegin);
|
||||
Map<String, String> world_uid_map = Dominion.instance.getServer().getWorlds().stream().collect(HashMap::new, (m, w) -> m.put(w.getName(), w.getUID().toString()), HashMap::putAll);
|
||||
File player_name_csv = new File(export_path, "player_name.csv");
|
||||
File privilege_template_csv = new File(export_path, "privilege_template.csv");
|
||||
File dominion_csv = new File(export_path, "dominion.csv");
|
||||
File world_uid_mapping = new File(export_path, "world_uid_mapping.yml");
|
||||
File dominion_group_csv = new File(export_path, "dominion_group.csv");
|
||||
File dominion_member_csv = new File(export_path, "dominion_member.csv");
|
||||
if (!player_name_csv.exists() || !privilege_template_csv.exists() || !dominion_csv.exists() || !world_uid_mapping.exists() || !dominion_group_csv.exists() || !dominion_member_csv.exists()) {
|
||||
Notification.error(sender, Translation.Commands_Operator_ImportDBIncompleteFail);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String dominion_file_str = Files.readString(dominion_csv.toPath());
|
||||
YamlConfiguration world_uid = YamlConfiguration.loadConfiguration(world_uid_mapping);
|
||||
for (String key : world_uid.getKeys(false)) {
|
||||
if (world_uid_map.containsKey(key)) {
|
||||
String old_uid = world_uid.getString(key);
|
||||
String new_uid = world_uid_map.get(key);
|
||||
if (old_uid == null || new_uid == null) {
|
||||
continue;
|
||||
}
|
||||
dominion_file_str = dominion_file_str.replace(old_uid, world_uid_map.get(key));
|
||||
}
|
||||
}
|
||||
Files.writeString(dominion_csv.toPath(), dominion_file_str);
|
||||
} catch (IOException e) {
|
||||
XLogger.err("Import world_uid_mapping.yml failed: %s", e.getMessage());
|
||||
return;
|
||||
}
|
||||
Common.ImportCSV("player_name", "id", player_name_csv);
|
||||
Common.ImportCSV("privilege_template", "id", privilege_template_csv);
|
||||
Common.ImportCSV("dominion", "id", dominion_csv);
|
||||
Common.ImportCSV("dominion_group", "id", dominion_group_csv);
|
||||
Common.ImportCSV("dominion_member", "id", dominion_member_csv);
|
||||
Notification.info(sender, Translation.Commands_Operator_ImportDBSuccess);
|
||||
Operator.reloadCache(sender, new String[0]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.lunadeer.dominion.managers;
|
||||
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -34,21 +33,9 @@ public class GroupLimit {
|
||||
WorldSetting defaultSetting = new WorldSetting(filePath.getName());
|
||||
defaultSetting.min_y = config.getInt("MinY", -64);
|
||||
defaultSetting.max_y = config.getInt("MaxY", 320);
|
||||
if (config.contains("SizeX")) { // todo: should be removed in the future
|
||||
defaultSetting.size_max_x = config.getInt("SizeX", 128);
|
||||
defaultSetting.size_max_y = config.getInt("SizeY", 64);
|
||||
defaultSetting.size_max_z = config.getInt("SizeZ", 128);
|
||||
defaultSetting.size_min_x = 4;
|
||||
defaultSetting.size_min_y = 4;
|
||||
defaultSetting.size_min_z = 4;
|
||||
} else {
|
||||
defaultSetting.size_max_x = config.getInt("Size.MaxX", 128);
|
||||
defaultSetting.size_max_y = config.getInt("Size.MaxY", 64);
|
||||
defaultSetting.size_max_z = config.getInt("Size.MaxZ", 128);
|
||||
defaultSetting.size_min_x = config.getInt("Size.MinX", 4);
|
||||
defaultSetting.size_min_y = config.getInt("Size.MinY", 4);
|
||||
defaultSetting.size_min_z = config.getInt("Size.MinZ", 4);
|
||||
}
|
||||
defaultSetting.size_x = config.getInt("SizeX", 128);
|
||||
defaultSetting.size_y = config.getInt("SizeY", 64);
|
||||
defaultSetting.size_z = config.getInt("SizeZ", 128);
|
||||
defaultSetting.amount = config.getInt("Amount", 10);
|
||||
defaultSetting.depth = config.getInt("Depth", 3);
|
||||
defaultSetting.vert = config.getBoolean("Vert", false);
|
||||
@ -80,51 +67,27 @@ public class GroupLimit {
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxX(@Nullable World world) {
|
||||
public Integer getLimitSizeX(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_max_x;
|
||||
return world_limits.get("default").size_x;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_max_x;
|
||||
return world_limits.get(world.getName()).size_x;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxY(@Nullable World world) {
|
||||
public Integer getLimitSizeY(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_max_y;
|
||||
return world_limits.get("default").size_y;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_max_y;
|
||||
return world_limits.get(world.getName()).size_y;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMaxZ(@Nullable World world) {
|
||||
public Integer getLimitSizeZ(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_max_z;
|
||||
return world_limits.get("default").size_z;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_max_z;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinX(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_min_x;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_min_x;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinY(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_min_y;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_min_y;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getLimitSizeMinZ(@Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
return world_limits.get("default").size_min_z;
|
||||
} else {
|
||||
return world_limits.get(world.getName()).size_min_z;
|
||||
return world_limits.get(world.getName()).size_z;
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,51 +144,27 @@ public class GroupLimit {
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMaxX(Integer size_x, @Nullable World world) {
|
||||
public void setLimitSizeX(Integer size_x, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_max_x = size_x;
|
||||
world_limits.get("default").size_x = size_x;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_max_x = size_x;
|
||||
world_limits.get(world.getName()).size_x = size_x;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMaxY(Integer size_y, @Nullable World world) {
|
||||
public void setLimitSizeY(Integer size_y, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_max_y = size_y;
|
||||
world_limits.get("default").size_y = size_y;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_max_y = size_y;
|
||||
world_limits.get(world.getName()).size_y = size_y;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMaxZ(Integer size_z, @Nullable World world) {
|
||||
public void setLimitSizeZ(Integer size_z, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_max_z = size_z;
|
||||
world_limits.get("default").size_z = size_z;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_max_z = size_z;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMinX(Integer size_x, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_min_x = size_x;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_min_x = size_x;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMinY(Integer size_y, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_min_y = size_y;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_min_y = size_y;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimitSizeMinZ(Integer size_z, @Nullable World world) {
|
||||
if (world == null || !world_limits.containsKey(world.getName())) {
|
||||
world_limits.get("default").size_min_z = size_z;
|
||||
} else {
|
||||
world_limits.get(world.getName()).size_min_z = size_z;
|
||||
world_limits.get(world.getName()).size_z = size_z;
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,18 +250,12 @@ public class GroupLimit {
|
||||
this.config.setInlineComments("MinY", List.of(Translation.Config_Comment_MinY.trans()));
|
||||
this.config.set("MaxY", world_limits.get("default").max_y);
|
||||
this.config.setInlineComments("MaxY", List.of(Translation.Config_Comment_MaxY.trans()));
|
||||
this.config.set("Size.MaxX", world_limits.get("default").size_max_x);
|
||||
this.config.setInlineComments("Size.MaxX", List.of(Translation.Config_Comment_SizeMaxX.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("Size.MaxY", world_limits.get("default").size_max_y);
|
||||
this.config.setInlineComments("Size.MaxY", List.of(Translation.Config_Comment_SizeMaxY.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("Size.MaxZ", world_limits.get("default").size_max_z);
|
||||
this.config.setInlineComments("Size.MaxZ", List.of(Translation.Config_Comment_SizeMaxZ.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("Size.MinX", world_limits.get("default").size_min_x);
|
||||
this.config.setInlineComments("Size.MinX", List.of(Translation.Config_Comment_SizeMinX.trans()));
|
||||
this.config.set("Size.MinY", world_limits.get("default").size_min_y);
|
||||
this.config.setInlineComments("Size.MinY", List.of(Translation.Config_Comment_SizeMinY.trans()));
|
||||
this.config.set("Size.MinZ", world_limits.get("default").size_min_z);
|
||||
this.config.setInlineComments("Size.MinZ", List.of(Translation.Config_Comment_SizeMinZ.trans()));
|
||||
this.config.set("SizeX", world_limits.get("default").size_x);
|
||||
this.config.setInlineComments("SizeX", List.of(Translation.Config_Comment_SizeX.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("SizeY", world_limits.get("default").size_y);
|
||||
this.config.setInlineComments("SizeY", List.of(Translation.Config_Comment_SizeY.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("SizeZ", world_limits.get("default").size_z);
|
||||
this.config.setInlineComments("SizeZ", List.of(Translation.Config_Comment_SizeZ.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("Amount", world_limits.get("default").amount);
|
||||
this.config.setInlineComments("Amount", List.of(Translation.Config_Comment_Amount.trans() + Translation.Config_Comment_NegativeOneUnlimited.trans()));
|
||||
this.config.set("Depth", world_limits.get("default").depth);
|
||||
@ -376,17 +309,9 @@ public class GroupLimit {
|
||||
|
||||
public List<String> getWorldBlackList() {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (world_limits.getOrDefault("default", new WorldSetting("default")).amount == 0) {
|
||||
list.addAll(Dominion.instance.getServer().getWorlds().stream().map(World::getName).toList());
|
||||
}
|
||||
for (Map.Entry<String, WorldSetting> entry : world_limits.entrySet()) {
|
||||
if (entry.getKey().equals("default")) {
|
||||
continue;
|
||||
}
|
||||
if (entry.getValue().amount == 0) {
|
||||
if (!entry.getValue().allow) {
|
||||
list.add(entry.getKey());
|
||||
} else {
|
||||
list.remove(entry.getKey());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cn.lunadeer.dominion.managers;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.GroupDTO;
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
@ -31,13 +30,6 @@ public class PlaceHolderApi extends PlaceholderExpansion {
|
||||
}
|
||||
return group.getNameColoredBukkit();
|
||||
}
|
||||
if (params.equalsIgnoreCase("current_dominion")) {
|
||||
DominionDTO dominion = Cache.instance.getDominionByLoc(bukkitPlayer.getLocation());
|
||||
if (dominion == null) {
|
||||
return "";
|
||||
}
|
||||
return dominion.getName();
|
||||
}
|
||||
return null; //
|
||||
}
|
||||
|
||||
|
@ -148,22 +148,31 @@ public class Translation extends Localization {
|
||||
public static i18n Commands_Operator_ReloadingConfig;
|
||||
@i18nField(defaultValue = "配置文件已重新加载")
|
||||
public static i18n Commands_Operator_ReloadedConfig;
|
||||
@i18nField(defaultValue = "你正在尝试导出数据库表,此行为会踢出所有玩家并关闭服务器,如确认继续请输入 /dominion export_db confirm")
|
||||
public static i18n Commands_Operator_ExportDBConfirm;
|
||||
@i18nField(defaultValue = "正在导出数据库表...")
|
||||
public static i18n Commands_Operator_ExportDBBegin;
|
||||
@i18nField(defaultValue = "数据库表导出完成")
|
||||
public static i18n Commands_Operator_ExportDBSuccess;
|
||||
@i18nField(defaultValue = "你正在尝试导入数据库表,此行为会踢出所有玩家并关闭服务器,如确认继续请输入 /dominion import_db confirm")
|
||||
public static i18n Commands_Operator_ImportDBConfirm;
|
||||
@i18nField(defaultValue = "正在导入数据库表...")
|
||||
public static i18n Commands_Operator_ImportDBBegin;
|
||||
@i18nField(defaultValue = "数据库表导入完成")
|
||||
public static i18n Commands_Operator_ImportDBSuccess;
|
||||
@i18nField(defaultValue = "没有可导入的数据")
|
||||
public static i18n Commands_Operator_ImportDBFail;
|
||||
@i18nField(defaultValue = "导入失败,数据不完整,请重新导出文件")
|
||||
public static i18n Commands_Operator_ImportDBIncompleteFail;
|
||||
|
||||
@i18nField(defaultValue = "最高Y坐标限制不能小于最低Y坐标限制")
|
||||
public static i18n Commands_SetConfig_MinYShouldBeLessThanMaxY;
|
||||
@i18nField(defaultValue = "最低Y坐标限制不能大于最高Y坐标限制")
|
||||
public static i18n Commands_SetConfig_MaxYShouldBeGreaterThanMinY;
|
||||
@i18nField(defaultValue = "X轴(东西)最大尺寸不能小于4")
|
||||
public static i18n Commands_SetConfig_SizeXShouldBeGreaterThan4;
|
||||
@i18nField(defaultValue = "Z轴(南北)最大尺寸不能小于4")
|
||||
public static i18n Commands_SetConfig_SizeZShouldBeGreaterThan4;
|
||||
@i18nField(defaultValue = "Y轴(垂直)最大尺寸不能小于4")
|
||||
public static i18n Commands_SetConfig_SizeYShouldBeGreaterThan4;
|
||||
@i18nField(defaultValue = "每个玩家领地数量限制不能小于0")
|
||||
public static i18n Commands_SetConfig_AmountShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "领地深度限制不能小于0")
|
||||
public static i18n Commands_SetConfig_DepthShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "传送延迟不能小于0")
|
||||
public static i18n Commands_SetConfig_TpDelayShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "传送冷却时间不能小于0")
|
||||
public static i18n Commands_SetConfig_TpCoolDownShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "每方块单价不能小于0")
|
||||
public static i18n Commands_SetConfig_PriceShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "领地退款比例不能小于0")
|
||||
public static i18n Commands_SetConfig_RefundShouldBeGreaterThan0;
|
||||
@i18nField(defaultValue = "出生点保护半径不能小于或等于0")
|
||||
public static i18n Commands_SetConfig_SpawnProtectRadiusShouldBeGreaterThan0;
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion template create <模板名称>")
|
||||
public static i18n Commands_Template_CreateTemplateUsage;
|
||||
@ -318,18 +327,14 @@ public class Translation extends Localization {
|
||||
public static i18n Messages_SetMapColorSuccess;
|
||||
@i18nField(defaultValue = "尺寸不合法")
|
||||
public static i18n Messages_SizeInvalid;
|
||||
@i18nField(defaultValue = "领地的任意一边长度不得小于4")
|
||||
public static i18n Messages_SizeShouldBeGreaterThan4;
|
||||
@i18nField(defaultValue = "领地X方向(东西)长度不能超过 %d")
|
||||
public static i18n Messages_SizeXShouldBeLessThan;
|
||||
@i18nField(defaultValue = "领地Y方向(上下)高度不能超过 %d")
|
||||
public static i18n Messages_SizeYShouldBeLessThan;
|
||||
@i18nField(defaultValue = "领地Z方向(南北)长度不能超过 %d")
|
||||
public static i18n Messages_SizeZShouldBeLessThan;
|
||||
@i18nField(defaultValue = "领地X方向(东西)长度不能少于 %d")
|
||||
public static i18n Messages_SizeXShouldBeGreaterThan;
|
||||
@i18nField(defaultValue = "领地Y方向(上下)高度不能少于 %d")
|
||||
public static i18n Messages_SizeYShouldBeGreaterThan;
|
||||
@i18nField(defaultValue = "领地Z方向(南北)长度不能少于 %d")
|
||||
public static i18n Messages_SizeZShouldBeGreaterThan;
|
||||
@i18nField(defaultValue = "领地Y坐标上限不能超过 %d")
|
||||
public static i18n Messages_MaxYShouldBeLessThan;
|
||||
@i18nField(defaultValue = "领地Y坐标下限不能超过 %d")
|
||||
@ -592,6 +597,10 @@ public class Translation extends Localization {
|
||||
public static i18n TUI_Menu_AllDominionButton;
|
||||
@i18nField(defaultValue = "查看所有领地")
|
||||
public static i18n TUI_Menu_AllDominionDescription;
|
||||
@i18nField(defaultValue = "系统配置")
|
||||
public static i18n TUI_Menu_ConfigButton;
|
||||
@i18nField(defaultValue = "查看/修改系统配置")
|
||||
public static i18n TUI_Menu_ConfigDescription;
|
||||
@i18nField(defaultValue = "重载缓存")
|
||||
public static i18n TUI_Menu_ReloadCacheButton;
|
||||
@i18nField(defaultValue = "手动刷新缓存可解决一些玩家操作无效问题,不建议频繁操作")
|
||||
@ -822,34 +831,18 @@ public class Translation extends Localization {
|
||||
|
||||
@i18nField(defaultValue = "AutoCreateRadius 不能等于 0,已重置为 10")
|
||||
public static i18n Config_Check_AutoCreateRadiusError;
|
||||
@i18nField(defaultValue = "MessageDisplay 不能设置为 %s,已重置为 ACTION_BAR")
|
||||
public static i18n Config_Check_MessageDisplayError;
|
||||
@i18nField(defaultValue = "AutoCleanAfterDays 不能等于 0,已重置为 180")
|
||||
public static i18n Config_Check_AutoCleanAfterDaysError;
|
||||
@i18nField(defaultValue = "Tool 名称设置错误,已重置为 ARROW")
|
||||
@i18nField(defaultValue = "工具名称设置错误,已重置为 ARROW")
|
||||
public static i18n Config_Check_ToolNameError;
|
||||
@i18nField(defaultValue = "InfoTool 名称设置错误,已重置为 STRING")
|
||||
public static i18n Config_Check_InfoToolNameError;
|
||||
@i18nField(defaultValue = "%s 的 MinY 不能大于等于 MaxY,已重置为 -64 和 320")
|
||||
public static i18n Config_Check_GroupMinYError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MaxX 设置过小,已重置为 128")
|
||||
public static i18n Config_Check_GroupSizeMaxXError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MaxY 设置过小,已重置为 64")
|
||||
public static i18n Config_Check_GroupSizeMaxYError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MaxZ 设置过小,已重置为 128")
|
||||
public static i18n Config_Check_GroupSizeMaxZError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MinX 设置过小,已重置为 4")
|
||||
public static i18n Config_Check_GroupSizeMinXError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MinY 设置过小,已重置为 4")
|
||||
public static i18n Config_Check_GroupSizeMinYError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MinZ 设置过小,已重置为 4")
|
||||
public static i18n Config_Check_GroupSizeMinZError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MaxX 不能小于 MinX,已重置为 128 和 4")
|
||||
public static i18n Config_Check_GroupMaxMinXError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MinY 不能小于 MinY,已重置为 64 和 4")
|
||||
public static i18n Config_Check_GroupMaxMinYError;
|
||||
@i18nField(defaultValue = "%s 的 Size.MaxZ 不能小于 MinZ,已重置为 128 和 4")
|
||||
public static i18n Config_Check_GroupMaxMinZError;
|
||||
@i18nField(defaultValue = "%s 的 SizeX 设置过小,已重置为 128")
|
||||
public static i18n Config_Check_GroupSizeXError;
|
||||
@i18nField(defaultValue = "%s 的 SizeY 设置过小,已重置为 64")
|
||||
public static i18n Config_Check_GroupSizeYError;
|
||||
@i18nField(defaultValue = "%s 的 SizeZ 设置过小,已重置为 128")
|
||||
public static i18n Config_Check_GroupSizeZError;
|
||||
@i18nField(defaultValue = "%s 的 Amount 设置不合法,已重置为 10")
|
||||
public static i18n Config_Check_GroupAmountError;
|
||||
@i18nField(defaultValue = "%s 的 Depth 设置不合法,已重置为 3")
|
||||
@ -869,16 +862,6 @@ public class Translation extends Localization {
|
||||
public static i18n Config_Comment_Language;
|
||||
@i18nField(defaultValue = "自动创建领地的半径,单位为方块")
|
||||
public static i18n Config_Comment_AutoCreateRadius;
|
||||
@i18nField(defaultValue = "默认进入领地提示消息")
|
||||
public static i18n Config_Comment_DefaultJoinMessage;
|
||||
@i18nField(defaultValue = "默认离开领地提示消息")
|
||||
public static i18n Config_Comment_DefaultLeaveMessage;
|
||||
@i18nField(defaultValue = "提示消息显示位置(BOSS_BAR, ACTION_BAR, TITLE, SUBTITLE, CHAT)")
|
||||
public static i18n Config_Comment_MessageDisplay;
|
||||
@i18nField(defaultValue = "玩家没有权限时的提示消息位置")
|
||||
public static i18n Config_Comment_MessageDisplayNoPermission;
|
||||
@i18nField(defaultValue = "进入/离开领地时的提示消息位置")
|
||||
public static i18n Config_Comment_MessageDisplayJoinLeave;
|
||||
@i18nField(defaultValue = "-1表示不开启")
|
||||
public static i18n Config_Comment_NegativeOneDisabled;
|
||||
@i18nField(defaultValue = "默认玩家圈地限制")
|
||||
@ -892,17 +875,11 @@ public class Translation extends Localization {
|
||||
@i18nField(defaultValue = "-1表示不限制")
|
||||
public static i18n Config_Comment_NegativeOneUnlimited;
|
||||
@i18nField(defaultValue = "X方向最大长度")
|
||||
public static i18n Config_Comment_SizeMaxX;
|
||||
public static i18n Config_Comment_SizeX;
|
||||
@i18nField(defaultValue = "Y方向最大长度")
|
||||
public static i18n Config_Comment_SizeMaxY;
|
||||
public static i18n Config_Comment_SizeY;
|
||||
@i18nField(defaultValue = "Z方向最大长度")
|
||||
public static i18n Config_Comment_SizeMaxZ;
|
||||
@i18nField(defaultValue = "X方向最小长度")
|
||||
public static i18n Config_Comment_SizeMinX;
|
||||
@i18nField(defaultValue = "Y方向最小长度")
|
||||
public static i18n Config_Comment_SizeMinY;
|
||||
@i18nField(defaultValue = "Z方向最小长度")
|
||||
public static i18n Config_Comment_SizeMinZ;
|
||||
public static i18n Config_Comment_SizeZ;
|
||||
@i18nField(defaultValue = "最大领地数量")
|
||||
public static i18n Config_Comment_Amount;
|
||||
@i18nField(defaultValue = "子领地深度")
|
||||
@ -923,8 +900,6 @@ public class Translation extends Localization {
|
||||
public static i18n Config_Comment_AutoCleanAfterDays;
|
||||
@i18nField(defaultValue = "圈地工具名称")
|
||||
public static i18n Config_Comment_ToolName;
|
||||
@i18nField(defaultValue = "查询领地信息工具名称")
|
||||
public static i18n Config_Comment_InfoToolName;
|
||||
@i18nField(defaultValue = "经济设置")
|
||||
public static i18n Config_Comment_Economy;
|
||||
@i18nField(defaultValue = "需要安装 Vault 前置及插件")
|
||||
@ -969,31 +944,6 @@ public class Translation extends Localization {
|
||||
@i18nField(defaultValue = "管理领地内的其他成员权限")
|
||||
public static i18n Flags_admin_Description;
|
||||
|
||||
@i18nField(defaultValue = "已选择第一个点: %d %d %d")
|
||||
public static i18n Tool_SelectFirstPoint;
|
||||
@i18nField(defaultValue = "已选择第二个点: %d %d %d")
|
||||
public static i18n Tool_SelectSecondPoint;
|
||||
@i18nField(defaultValue = "两个点不在同一个世界")
|
||||
public static i18n Tool_NotSameWorld;
|
||||
@i18nField(defaultValue = "已选择两个点,可以使用 /dominion create <领地名称> 创建领地")
|
||||
public static i18n Tool_SelectTwoPoints;
|
||||
@i18nField(defaultValue = "预计领地创建价格为 %.2f %s")
|
||||
public static i18n Tool_CreateDominionPrice;
|
||||
@i18nField(defaultValue = "尺寸: %d x %d x %d")
|
||||
public static i18n Tool_DominionSize;
|
||||
@i18nField(defaultValue = "面积: %d")
|
||||
public static i18n Tool_DominionSquare;
|
||||
@i18nField(defaultValue = "体积: %d")
|
||||
public static i18n Tool_DominionVolume;
|
||||
@i18nField(defaultValue = "高度: %d")
|
||||
public static i18n Tool_DominionHeight;
|
||||
@i18nField(defaultValue = "这个方块(%d, %d, %d)不在任何领地内")
|
||||
public static i18n Tool_LocationNotInDominion;
|
||||
@i18nField(defaultValue = "这个方块(%d, %d, %d)在领地 %s 内")
|
||||
public static i18n Tool_LocationInDominion;
|
||||
@i18nField(defaultValue = "领地主人: %s")
|
||||
public static i18n Tool_DominionOwner;
|
||||
|
||||
|
||||
public Translation(JavaPlugin plugin) {
|
||||
super(plugin);
|
||||
|
@ -9,15 +9,13 @@ import java.util.Map;
|
||||
public class WorldSetting {
|
||||
public Integer min_y;
|
||||
public Integer max_y;
|
||||
public Integer size_max_x;
|
||||
public Integer size_max_y;
|
||||
public Integer size_max_z;
|
||||
public Integer size_min_x;
|
||||
public Integer size_min_y;
|
||||
public Integer size_min_z;
|
||||
public Integer size_x;
|
||||
public Integer size_y;
|
||||
public Integer size_z;
|
||||
public Integer amount;
|
||||
public Integer depth;
|
||||
public Boolean vert;
|
||||
public Boolean allow = true;
|
||||
private final String sourceName;
|
||||
|
||||
/**
|
||||
@ -29,15 +27,13 @@ public class WorldSetting {
|
||||
YamlConfiguration section = new YamlConfiguration();
|
||||
section.set("some_world_name.MinY", -64);
|
||||
section.set("some_world_name.MaxY", 320);
|
||||
section.set("some_world_name.Size.MaxX", 128);
|
||||
section.set("some_world_name.Size.MaxY", 64);
|
||||
section.set("some_world_name.Size.MaxZ", 128);
|
||||
section.set("some_world_name.Size.MinX", 4);
|
||||
section.set("some_world_name.Size.MinY", 4);
|
||||
section.set("some_world_name.Size.MinZ", 4);
|
||||
section.set("some_world_name.SizeX", 128);
|
||||
section.set("some_world_name.SizeY", 64);
|
||||
section.set("some_world_name.SizeZ", 128);
|
||||
section.set("some_world_name.Amount", 10);
|
||||
section.set("some_world_name.Depth", 3);
|
||||
section.set("some_world_name.Vert", false);
|
||||
section.set("some_world_name.Allow", false);
|
||||
return section;
|
||||
}
|
||||
|
||||
@ -51,27 +47,13 @@ public class WorldSetting {
|
||||
WorldSetting setting = new WorldSetting(sourceName);
|
||||
setting.min_y = worldSettings.getInt(worldName + ".MinY", -64);
|
||||
setting.max_y = worldSettings.getInt(worldName + ".MaxY", 320);
|
||||
if (worldSettings.contains(worldName + ".SizeX")) { // todo: should be removed in the future
|
||||
setting.size_max_x = worldSettings.getInt(worldName + ".SizeX", 128);
|
||||
setting.size_max_y = worldSettings.getInt(worldName + ".SizeY", 64);
|
||||
setting.size_max_z = worldSettings.getInt(worldName + ".SizeZ", 128);
|
||||
setting.size_min_x = 4;
|
||||
setting.size_min_y = 4;
|
||||
setting.size_min_z = 4;
|
||||
} else {
|
||||
setting.size_max_x = worldSettings.getInt(worldName + ".Size.MaxX", 128);
|
||||
setting.size_max_y = worldSettings.getInt(worldName + ".Size.MaxY", 64);
|
||||
setting.size_max_z = worldSettings.getInt(worldName + ".Size.MaxZ", 128);
|
||||
setting.size_min_x = worldSettings.getInt(worldName + ".Size.MinX", 4);
|
||||
setting.size_min_y = worldSettings.getInt(worldName + ".Size.MinY", 4);
|
||||
setting.size_min_z = worldSettings.getInt(worldName + ".Size.MinZ", 4);
|
||||
}
|
||||
setting.size_x = worldSettings.getInt(worldName + ".SizeX", 128);
|
||||
setting.size_y = worldSettings.getInt(worldName + ".SizeY", 64);
|
||||
setting.size_z = worldSettings.getInt(worldName + ".SizeZ", 128);
|
||||
setting.amount = worldSettings.getInt(worldName + ".Amount", 10);
|
||||
setting.depth = worldSettings.getInt(worldName + ".Depth", 3);
|
||||
setting.vert = worldSettings.getBoolean(worldName + ".Vert", false);
|
||||
if (worldSettings.contains(worldName + ".Allow") && !worldSettings.getBoolean(worldName + ".Allow")) {
|
||||
setting.amount = 0;
|
||||
}
|
||||
setting.allow = worldSettings.getBoolean(worldName + ".Allow", false);
|
||||
world_limits.put(worldName, setting);
|
||||
}
|
||||
return world_limits;
|
||||
@ -81,15 +63,13 @@ public class WorldSetting {
|
||||
YamlConfiguration section = new YamlConfiguration();
|
||||
section.set("MinY", min_y);
|
||||
section.set("MaxY", max_y);
|
||||
section.set("Size.MaxX", size_max_x);
|
||||
section.set("Size.MaxY", size_max_y);
|
||||
section.set("Size.MaxZ", size_max_z);
|
||||
section.set("Size.MinX", size_min_x);
|
||||
section.set("Size.MinY", size_min_y);
|
||||
section.set("Size.MinZ", size_min_z);
|
||||
section.set("SizeX", size_x);
|
||||
section.set("SizeY", size_y);
|
||||
section.set("SizeZ", size_z);
|
||||
section.set("Amount", amount);
|
||||
section.set("Depth", depth);
|
||||
section.set("Vert", vert);
|
||||
section.set("Allow", allow);
|
||||
return section;
|
||||
}
|
||||
|
||||
@ -99,46 +79,19 @@ public class WorldSetting {
|
||||
min_y = -64;
|
||||
max_y = 320;
|
||||
}
|
||||
if (size_max_x <= 4 && size_max_x != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMaxXError, sourceName);
|
||||
size_max_x = 128;
|
||||
if (size_x <= 4 && size_x != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeXError, sourceName);
|
||||
size_x = 128;
|
||||
}
|
||||
if (size_max_y <= 4 && size_max_y != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMaxYError, sourceName);
|
||||
size_max_y = 64;
|
||||
if (size_y <= 4 && size_y != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeYError, sourceName);
|
||||
size_y = 64;
|
||||
}
|
||||
if (size_max_z <= 4 && size_max_z != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMaxZError, sourceName);
|
||||
size_max_z = 128;
|
||||
if (size_z <= 4 && size_z != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeZError, sourceName);
|
||||
size_z = 128;
|
||||
}
|
||||
if (size_min_x <= 0) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMinXError, sourceName);
|
||||
size_min_x = 4;
|
||||
}
|
||||
if (size_min_y <= 0) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMinYError, sourceName);
|
||||
size_min_y = 4;
|
||||
}
|
||||
if (size_min_z <= 0) {
|
||||
XLogger.err(Translation.Config_Check_GroupSizeMinZError, sourceName);
|
||||
size_min_z = 4;
|
||||
}
|
||||
if (size_max_x < size_min_x && size_max_x != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupMaxMinXError, sourceName);
|
||||
size_max_x = 128;
|
||||
size_min_x = 4;
|
||||
}
|
||||
if (size_max_y < size_min_y && size_max_y != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupMaxMinYError, sourceName);
|
||||
size_max_y = 64;
|
||||
size_min_y = 4;
|
||||
}
|
||||
if (size_max_z < size_min_z && size_max_z != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupMaxMinZError, sourceName);
|
||||
size_max_z = 128;
|
||||
size_min_z = 4;
|
||||
}
|
||||
if (amount < 0 && amount != -1) {
|
||||
if (amount <= 0 && amount != -1) {
|
||||
XLogger.err(Translation.Config_Check_GroupAmountError, sourceName);
|
||||
amount = 10;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class CreateDominion {
|
||||
Map<Integer, Location> points = autoPoints(sender);
|
||||
operator.getResponse().thenAccept(result -> {
|
||||
if (Objects.equals(result.getStatus(), AbstractOperator.Result.SUCCESS)) {
|
||||
DominionManage.show(sender, new String[]{"manage", input});
|
||||
DominionManage.show(sender, new String[]{"list"});
|
||||
}
|
||||
});
|
||||
DominionController.create(operator, input, points.get(0), points.get(1));
|
||||
|
@ -9,6 +9,11 @@ import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.ListView;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.components.Button;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.components.Line;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.format.Style;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class EnvSetting {
|
||||
.append(Button.create(Translation.TUI_Navigation_DominionList).setExecuteCommand("/dominion list").build())
|
||||
.append(Button.create(Translation.TUI_Navigation_Manage).setExecuteCommand("/dominion manage " + dominion.getName()).build())
|
||||
.append(Translation.TUI_Navigation_EnvSetting));
|
||||
for (Flag flag : Flag.getEnvironmentFlagsEnabled()) {
|
||||
for (Flag flag : Flag.getDominionOnlyFlagsEnabled()) {
|
||||
view.add(createOption(flag, dominion.getFlagValue(flag), dominion.getName(), page));
|
||||
}
|
||||
view.showOn(player, page);
|
||||
|
@ -63,14 +63,14 @@ public class GroupList {
|
||||
for (GroupDTO group : groups) {
|
||||
Line line = new Line();
|
||||
Button del = Button.createRed(Translation.TUI_DeleteButton)
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_DeleteDescription.trans(), group.getNamePlain()))
|
||||
.setExecuteCommand("/dominion group delete " + dominion.getName() + " " + group.getNamePlain());
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_DeleteDescription.trans(), group.getName()))
|
||||
.setExecuteCommand("/dominion group delete " + dominion.getName() + " " + group.getName());
|
||||
Button edit = Button.create(Translation.TUI_EditButton)
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_EditDescription.trans(), group.getNamePlain()))
|
||||
.setExecuteCommand("/dominion group setting " + dominion.getName() + " " + group.getNamePlain());
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_EditDescription.trans(), group.getName()))
|
||||
.setExecuteCommand("/dominion group setting " + dominion.getName() + " " + group.getName());
|
||||
Button add = Button.createGreen("+")
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_AddMemberDescription.trans(), group.getNamePlain()))
|
||||
.setExecuteCommand("/dominion group select_member " + dominion.getName() + " " + group.getNamePlain() + " " + page);
|
||||
.setHoverText(String.format(Translation.TUI_GroupList_AddMemberDescription.trans(), group.getName()))
|
||||
.setExecuteCommand("/dominion group select_member " + dominion.getName() + " " + group.getName() + " " + page);
|
||||
line.append(del.build()).append(edit.build()).append(group.getNameColoredComponent()).append(add.build());
|
||||
view.add(line);
|
||||
List<MemberDTO> players = MemberDTO.selectByGroupId(group.getId());
|
||||
@ -80,9 +80,9 @@ public class GroupList {
|
||||
if (p == null) continue;
|
||||
Button remove = Button.createRed("-")
|
||||
.setHoverText(
|
||||
String.format(Translation.TUI_GroupList_RemoveMemberDescription.trans(), p.getLastKnownName(), group.getNamePlain())
|
||||
String.format(Translation.TUI_GroupList_RemoveMemberDescription.trans(), p.getLastKnownName(), group.getName())
|
||||
)
|
||||
.setExecuteCommand("/dominion group remove_member " + dominion.getName() + " " + group.getNamePlain() + " " + p.getLastKnownName() + " " + page);
|
||||
.setExecuteCommand("/dominion group remove_member " + dominion.getName() + " " + group.getName() + " " + p.getLastKnownName() + " " + page);
|
||||
Line playerLine = new Line().setDivider("");
|
||||
playerLine.append(Component.text(" "));
|
||||
playerLine.append(remove.build()).append(" | " + p.getLastKnownName());
|
||||
|
@ -45,7 +45,7 @@ public class GroupSetting {
|
||||
return;
|
||||
}
|
||||
|
||||
ListView view = ListView.create(10, "/dominion group setting " + dominion.getName() + " " + group.getNamePlain());
|
||||
ListView view = ListView.create(10, "/dominion group setting " + dominion.getName() + " " + group.getName());
|
||||
view.title(Component.text(Translation.TUI_GroupSetting_TitleL.trans())
|
||||
.append(group.getNameColoredComponent())
|
||||
.append(Component.text(Translation.TUI_GroupSetting_TitleR.trans())));
|
||||
@ -58,31 +58,31 @@ public class GroupSetting {
|
||||
.append(Translation.TUI_Navigation_GroupSetting)
|
||||
);
|
||||
Button rename_btn = Button.create(Translation.TUI_GroupSetting_RenameButton)
|
||||
.setHoverText(String.format(Translation.TUI_GroupSetting_RenameDescription.trans(), group.getNamePlain()))
|
||||
.setExecuteCommand("/dominion cui_rename_group " + dominion.getName() + " " + group.getNamePlain());
|
||||
.setHoverText(String.format(Translation.TUI_GroupSetting_RenameDescription.trans(), group.getName()))
|
||||
.setExecuteCommand("/dominion cui_rename_group " + dominion.getName() + " " + group.getName());
|
||||
view.add(Line.create().append(rename_btn.build()));
|
||||
|
||||
if (group.getAdmin()) {
|
||||
view.add(Line.create()
|
||||
.append(Button.createGreen("☑")
|
||||
.setExecuteCommand(parseCommand(dominion.getName(), group.getNamePlain(), "admin", false, page))
|
||||
.setExecuteCommand(parseCommand(dominion.getName(), group.getName(), "admin", false, page))
|
||||
.build())
|
||||
.append(
|
||||
Component.text(Translation.Flags_admin_DisplayName.trans())
|
||||
.hoverEvent(Component.text(Translation.Flags_admin_Description.trans()))
|
||||
));
|
||||
view.add(createOption(Flag.GLOW, group.getFlagValue(Flag.GLOW), dominion.getName(), group.getNamePlain(), page));
|
||||
view.add(createOption(Flag.GLOW, group.getFlagValue(Flag.GLOW), dominion.getName(), group.getName(), page));
|
||||
} else {
|
||||
view.add(Line.create()
|
||||
.append(Button.createRed("☐")
|
||||
.setExecuteCommand(parseCommand(dominion.getName(), group.getNamePlain(), "admin", true, page))
|
||||
.setExecuteCommand(parseCommand(dominion.getName(), group.getName(), "admin", true, page))
|
||||
.build())
|
||||
.append(
|
||||
Component.text(Translation.Flags_admin_DisplayName.trans())
|
||||
.hoverEvent(Component.text(Translation.Flags_admin_Description.trans()))
|
||||
));
|
||||
for (Flag flag : Flag.getPrivilegeFlagsEnabled()) {
|
||||
view.add(createOption(flag, group.getFlagValue(flag), dominion.getName(), group.getNamePlain(), page));
|
||||
view.add(createOption(flag, group.getFlagValue(flag), dominion.getName(), group.getName(), page));
|
||||
}
|
||||
}
|
||||
view.showOn(player, page);
|
||||
|
@ -39,9 +39,9 @@ public class SelectMember {
|
||||
}
|
||||
int backPage = getPage(args, 4);
|
||||
int page = getPage(args, 5);
|
||||
ListView view = ListView.create(10, "/dominion group select_member " + dominion.getName() + " " + group.getNamePlain() + " " + backPage);
|
||||
ListView view = ListView.create(10, "/dominion group select_member " + dominion.getName() + " " + group.getName() + " " + backPage);
|
||||
view.title(Translation.TUI_SelectMember_Title);
|
||||
Line sub = Line.create().append(String.format(Translation.TUI_SelectMember_Description.trans(), group.getNamePlain()))
|
||||
Line sub = Line.create().append(String.format(Translation.TUI_SelectMember_Description.trans(), group.getName()))
|
||||
.append(Button.create(Translation.TUI_BackButton).setExecuteCommand("/dominion group list " + dominion.getName() + " " + backPage).build());
|
||||
view.subtitle(sub);
|
||||
List<MemberDTO> members = MemberDTO.selectByDomGroupId(dominion.getId(), -1);
|
||||
@ -50,7 +50,7 @@ public class SelectMember {
|
||||
if (p == null) continue;
|
||||
view.add(Line.create()
|
||||
.append(Button.create(p.getLastKnownName())
|
||||
.setExecuteCommand("/dominion group add_member " + dominion.getName() + " " + group.getNamePlain() + " " + p.getLastKnownName() + " " + backPage)
|
||||
.setExecuteCommand("/dominion group add_member " + dominion.getName() + " " + group.getName() + " " + p.getLastKnownName() + " " + backPage)
|
||||
.build()));
|
||||
}
|
||||
view.showOn(player, page);
|
||||
|
@ -99,7 +99,7 @@ public class MemberList {
|
||||
}
|
||||
}
|
||||
if (group != null) {
|
||||
prev.setDisabled(String.format(Translation.TUI_MemberList_BelongToGroup.trans(), group.getNamePlain()));
|
||||
prev.setDisabled(String.format(Translation.TUI_MemberList_BelongToGroup.trans(), group.getName()));
|
||||
}
|
||||
line.append(remove.build());
|
||||
line.append(prev.build());
|
||||
|
@ -7,6 +7,12 @@ import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.dominion.dtos.GroupDTO;
|
||||
import cn.lunadeer.dominion.dtos.MemberDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.format.Style;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@ -71,9 +77,11 @@ public class EventUtils {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
String msg = String.format(Translation.Messages_NoPermissionForFlag.trans(), flag.getDisplayName(), flag.getDescription());
|
||||
msg = "&#FF0000" + "&l" + msg;
|
||||
MessageDisplay.show(player, Dominion.config.getMessageDisplayNoPermission(), msg);
|
||||
TextComponent msg = Component.text(
|
||||
String.format(Translation.Messages_NoPermissionForFlag.trans(), flag.getDisplayName(), flag.getDescription()),
|
||||
Style.style(TextColor.color(0xFF0000), TextDecoration.BOLD))
|
||||
.hoverEvent(Component.text(flag.getDescription()));
|
||||
Notification.actionBar(player, msg);
|
||||
if (event != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package cn.lunadeer.dominion.utils;
|
||||
|
||||
import cn.lunadeer.minecraftpluginutils.ColorParser;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class MessageDisplay {
|
||||
public enum Place {
|
||||
BOSS_BAR,
|
||||
ACTION_BAR,
|
||||
TITLE,
|
||||
SUBTITLE,
|
||||
CHAT
|
||||
}
|
||||
|
||||
public static void show(Player player, Place place, String message) {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
message = PlaceholderAPI.setPlaceholders(player, message);
|
||||
}
|
||||
message = ColorParser.getBukkitType(message);
|
||||
// BOSS_BAR, ACTION_BAR, TITLE, SUBTITLE, CHAT
|
||||
if (place == Place.BOSS_BAR) {
|
||||
Notification.bossBar(player, message);
|
||||
} else if (place == Place.CHAT) {
|
||||
player.sendMessage(message);
|
||||
} else if (place == Place.TITLE) {
|
||||
Notification.title(player, message);
|
||||
} else if (place == Place.SUBTITLE) {
|
||||
Notification.subTitle(player, message);
|
||||
} else {
|
||||
Notification.actionBar(player, message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ import cn.lunadeer.dominion.dtos.MemberDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.ListView;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.components.Button;
|
||||
import cn.lunadeer.minecraftpluginutils.stui.components.Line;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.lunadeer.dominion.utils.map;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.api.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.PlayerDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
@ -22,7 +22,7 @@ public class BlueMapConnect {
|
||||
try {
|
||||
BlueMapAPI.getInstance().ifPresent(api -> {
|
||||
Map<String, List<DominionDTO>> world_dominions = new HashMap<>();
|
||||
for (DominionDTO dominion : Cache.instance.getAllDominions()) {
|
||||
for (DominionDTO dominion : Cache.instance.getDominions()) {
|
||||
if (dominion.getWorld() == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.lunadeer.dominion.utils.map;
|
||||
|
||||
import cn.lunadeer.dominion.api.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.dtos.PlayerDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
|
@ -14,7 +14,7 @@ public class MapRender {
|
||||
}
|
||||
|
||||
if (Dominion.config.getDynmap()) {
|
||||
DynmapConnect.instance.setDominionMarkers(Cache.instance.getAllDominions());
|
||||
DynmapConnect.instance.setDominionMarkers(Cache.instance.getDominions());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,24 +9,14 @@ Database:
|
||||
Language: zh-cn
|
||||
|
||||
AutoCreateRadius: 10
|
||||
DefaultJoinMessage: '&3{OWNER}: Welcome to {DOM}!'
|
||||
DefaultLeaveMessage: '&3{OWNER}: Leaving {DOM}...'
|
||||
|
||||
MessageDisplay:
|
||||
NoPermission: ACTION_BAR
|
||||
JoinLeave: ACTION_BAR
|
||||
|
||||
Limit:
|
||||
SpawnProtection: 10
|
||||
MinY: -64
|
||||
MaxY: 320
|
||||
Size:
|
||||
MaxX: 128
|
||||
MaxY: 64
|
||||
MaxZ: 128
|
||||
MinX: 4
|
||||
MinY: 4
|
||||
MinZ: 4
|
||||
SizeX: 128
|
||||
SizeY: 64
|
||||
SizeZ: 128
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
@ -35,16 +25,13 @@ Limit:
|
||||
some_world_name:
|
||||
MinY: -64
|
||||
MaxY: 320
|
||||
Size:
|
||||
MaxX: 128
|
||||
MaxY: 64
|
||||
MaxZ: 128
|
||||
MinX: 4
|
||||
MinY: 4
|
||||
MinZ: 4
|
||||
SizeX: 128
|
||||
SizeY: 64
|
||||
SizeZ: 128
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
Allow: false
|
||||
|
||||
Teleport:
|
||||
Enable: true
|
||||
@ -55,8 +42,6 @@ AutoCleanAfterDays: 180
|
||||
|
||||
Tool: ARROW
|
||||
|
||||
InfoTool: STRING
|
||||
|
||||
Economy:
|
||||
Enable: false
|
||||
Price: 10.0
|
||||
|
@ -1,12 +1,8 @@
|
||||
MinY: -64
|
||||
MaxY: 320
|
||||
Size:
|
||||
MaxX: 128
|
||||
MaxY: 64
|
||||
MaxZ: 128
|
||||
MinX: 4
|
||||
MinY: 4
|
||||
MinZ: 4
|
||||
SizeX: 128
|
||||
SizeY: 64
|
||||
SizeZ: 128
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
@ -17,13 +13,10 @@ WorldSettings:
|
||||
some_world_name:
|
||||
MinY: -64
|
||||
MaxY: 320
|
||||
Size:
|
||||
MaxX: 128
|
||||
MaxY: 64
|
||||
MaxZ: 128
|
||||
MinX: 4
|
||||
MinY: 4
|
||||
MinZ: 4
|
||||
SizeX: 128
|
||||
SizeY: 64
|
||||
SizeZ: 128
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
Allow: false
|
||||
|
@ -3,12 +3,10 @@ version: @version@
|
||||
main: cn.lunadeer.dominion.Dominion
|
||||
api-version: '1.20'
|
||||
folia-supported: true
|
||||
libraries: [ ]
|
||||
softdepend:
|
||||
- Vault
|
||||
- dynmap
|
||||
- PlaceholderAPI
|
||||
- BlueMap
|
||||
commands:
|
||||
Dominion:
|
||||
description: 领地插件命令
|
||||
|
@ -1,15 +1,6 @@
|
||||
## Dominion Documentation
|
||||
|
||||
[![GitHub Repository](https://img.shields.io/badge/SourceCode-GitHub-blue?logo=github)](https://github.com/ColdeZhang/Dominion)
|
||||
[![bStats](https://img.shields.io/badge/bStats-Statistics-eacd76?logo=google-analytics)](https://bstats.org/plugin/bukkit/Dominion/21445)
|
||||
|
||||
[![Hangar](https://img.shields.io/badge/To-Hangar-004ee9)](https://hangar.papermc.io/zhangyuheng/Dominion)
|
||||
[![Modrinth](https://img.shields.io/badge/To-Modrinth-1bd96a)](https://modrinth.com/plugin/zhangyuheng-dominion)
|
||||
[![Spigot](https://img.shields.io/badge/To-Spigot-ed8106)](https://www.spigotmc.org/resources/dominion.119514/)
|
||||
|
||||
[![Latest Build](https://img.shields.io/github/v/release/ColdeZhang/Dominion?label=LatestBuild&logo=github&color=0aa344)](https://github.com/ColdeZhang/Dominion/releases/latest)
|
||||
|
||||
## Brief
|
||||
## Preface
|
||||
|
||||
First of all, thank you very much for choosing and using this plugin.
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* [Territory Management](manage-dominion/README.md)
|
||||
* [Environment Settings](manage-dominion/environment.md)
|
||||
* [Permission Management](manage-dominion/permission/README.md)
|
||||
* [Guest Permissions](manage-dominion/permission/guest.md)
|
||||
* [Guest Permissions](manage-dominion/permission/guest)
|
||||
* [Territory members](manage-dominion/permission/member.md)
|
||||
* [Permission Groups](manage-dominion/permission/permission-group.md)
|
||||
* [Permission Templates](manage-dominion/permission/template.md)
|
||||
@ -21,4 +21,3 @@
|
||||
* [flags.yml](operator/flags.md)
|
||||
* [Privileged Player Configuration](operator/privilege.md)
|
||||
* [Cross-group teleportation (global-tp in testing)](operator/global-tp.md)
|
||||
* [Developer](developer.md)
|
@ -1,99 +0,0 @@
|
||||
# 开发者文档
|
||||
|
||||
> DominionAPI 自 Dominion-2.9.0-beta 开始支持。
|
||||
|
||||
## 一、接入 DominionAPI
|
||||
|
||||
### 1. 引入依赖
|
||||
|
||||
如果您使用 gradle,可以在您的 `build.gradle` 文件中添加如下代码:
|
||||
|
||||
```groovy
|
||||
// build.gradle
|
||||
repositories {
|
||||
maven { url = "https://ssl.lunadeer.cn:14454/repository/maven-snapshots/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
或者你使用的是 gradle kotlin dsl:
|
||||
|
||||
```kotlin
|
||||
// build.gradle.kts
|
||||
repositories {
|
||||
maven("https://ssl.lunadeer.cn:14454/repository/maven-snapshots/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
再或者您使用 maven,可以在您的 `pom.xml` 文件中添加如下代码:
|
||||
|
||||
```xml
|
||||
<!-- pom.xml -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>lunadeer</id>
|
||||
<url>https://ssl.lunadeer.cn:14454/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>DominionAPI</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
### 2. plugin.yml 配置
|
||||
|
||||
在您的插件的 `plugin.yml` 文件中添加如下配置,以确保在 Dominion 准备完成后再加载您的插件:
|
||||
|
||||
```yaml
|
||||
# plugin.yml
|
||||
depend: [ Dominion ]
|
||||
```
|
||||
|
||||
## 二、使用 DominionAPI
|
||||
|
||||
可以通过如下方法直接获取 DominionAPI 实例:
|
||||
|
||||
```java
|
||||
import cn.lunadeer.dominion.api.Dominion;
|
||||
import cn.lunadeer.dominion.api.DominionAPI;
|
||||
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
```
|
||||
|
||||
例如,获取某个位置的领地信息:
|
||||
|
||||
```java
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
try {
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
DominionDTO d = dominionAPI.getDominionByLoc(some_location);
|
||||
if (d == null) {
|
||||
this.getLogger().info("no dominion found");
|
||||
return;
|
||||
}
|
||||
this.getLogger().info("name:" + d.getName());
|
||||
} catch (Exception e) {
|
||||
this.getLogger().info(e.getMessage());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[示例项目地址](https://github.com/ColdeZhang/DominionAddonExample)。
|
||||
|
||||
[Javadoc地址](https://coldezhang.github.io/DominionAPI/)。
|
@ -4,6 +4,7 @@
|
||||
|
||||
- 1.20.1 及以上;
|
||||
- Spigot、Paper、Folia...;
|
||||
- Java 21 及以上;
|
||||
|
||||
> 虽然本插件支持 Spigot 但是我们强烈推荐您升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。
|
||||
|
||||
|
@ -101,9 +101,6 @@ Timer: false # 性能测试计时器
|
||||
|
||||
语言设置,参考 languages 文件夹下的文件名。
|
||||
|
||||
如果需要更新语言文件,请删除 `plugins/Dominion/languages` 文件夹下对应的文件,然后重启服务器。
|
||||
插件会自动生成最新的对应语言文件。
|
||||
|
||||
### AutoCreateRadius
|
||||
|
||||
配置玩家在使用“自动创建”功能时会自动向XYZ三个方向延伸此距离创建领地。
|
||||
|
@ -1,12 +1,5 @@
|
||||
# Dominion 文档
|
||||
|
||||
[![GitHub Repository](https://img.shields.io/badge/仓库地址-GitHub-blue?logo=github)](https://github.com/ColdeZhang/Dominion)
|
||||
[![bStats](https://img.shields.io/badge/bStats-数据统计-eacd76?logo=google-analytics)](https://bstats.org/plugin/bukkit/Dominion/21445)
|
||||
|
||||
[![Latest Build](https://img.shields.io/github/v/release/ColdeZhang/Dominion?label=%E6%9C%80%E6%96%B0%E6%9E%84%E5%BB%BA%E4%B8%8B%E8%BD%BD&logo=github&color=0aa344)](https://github.com/ColdeZhang/Dominion/releases/latest)
|
||||
|
||||
[![Latest Build](https://img.shields.io/github/v/release/ColdeZhang/Dominion?label=%E5%A4%87%E7%94%A8%E4%B8%8B%E8%BD%BD%E5%9C%B0%E5%9D%80&logo=gitea&color=0aa344)](https://ssl.lunadeer.cn:14446/mirror/Dominion/releases)
|
||||
|
||||
## 前言
|
||||
|
||||
首先十分感谢您选择并使用本插件。
|
||||
@ -25,6 +18,3 @@ Dominion 是一个完全开源、免费,专为高版本开发,面向未来
|
||||
1. [安装、必读、常见问题](operator/README.md)
|
||||
2. [配置文件参考](operator/config.md)
|
||||
|
||||
什么,你是新手服主?推荐通读一下[驿站](https://github.com/postyizhan)大佬的 [笨蛋文档|一群笨蛋们写的 Minecraft 开服教程](https://yizhan.wiki/NitWikit/Java/intro)。
|
||||
希望能对你的开服之路有所帮助!
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* [领地管理](manage-dominion/README.md)
|
||||
* [环境设置](manage-dominion/environment.md)
|
||||
* [权限管理](manage-dominion/permission/README.md)
|
||||
* [访客权限](manage-dominion/permission/guest.md)
|
||||
* [访客权限](manage-dominion/permission/guest)
|
||||
* [领地成员](manage-dominion/permission/member.md)
|
||||
* [权限组](manage-dominion/permission/permission-group.md)
|
||||
* [权限模板](manage-dominion/permission/template.md)
|
||||
@ -20,7 +20,5 @@
|
||||
* [配置文件参考](operator/config.md)
|
||||
* [flags.yml](operator/flags.md)
|
||||
* [特权玩家配置](operator/privilege.md)
|
||||
* [Papi一览](operator/papi.md)
|
||||
* [跨群组服传送(global-tp 测试中)](operator/global-tp.md)
|
||||
* [开发者文档](developer.md)
|
||||
|
||||
|
@ -1,99 +0,0 @@
|
||||
# 开发者文档
|
||||
|
||||
> DominionAPI 自 Dominion-2.9.0-beta 开始支持。
|
||||
|
||||
## 一、接入 DominionAPI
|
||||
|
||||
### 1. 引入依赖
|
||||
|
||||
如果您使用 gradle,可以在您的 `build.gradle` 文件中添加如下代码:
|
||||
|
||||
```groovy
|
||||
// build.gradle
|
||||
repositories {
|
||||
maven { url = "https://ssl.lunadeer.cn:14454/repository/maven-snapshots/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
或者你使用的是 gradle kotlin dsl:
|
||||
|
||||
```kotlin
|
||||
// build.gradle.kts
|
||||
repositories {
|
||||
maven("https://ssl.lunadeer.cn:14454/repository/maven-snapshots/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
再或者您使用 maven,可以在您的 `pom.xml` 文件中添加如下代码:
|
||||
|
||||
```xml
|
||||
<!-- pom.xml -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>lunadeer</id>
|
||||
<url>https://ssl.lunadeer.cn:14454/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>DominionAPI</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
### 2. plugin.yml 配置
|
||||
|
||||
在您的插件的 `plugin.yml` 文件中添加如下配置,以确保在 Dominion 准备完成后再加载您的插件:
|
||||
|
||||
```yaml
|
||||
# plugin.yml
|
||||
depend: [ Dominion ]
|
||||
```
|
||||
|
||||
## 二、使用 DominionAPI
|
||||
|
||||
可以通过如下方法直接获取 DominionAPI 实例:
|
||||
|
||||
```java
|
||||
import cn.lunadeer.dominion.api.Dominion;
|
||||
import cn.lunadeer.dominion.api.DominionAPI;
|
||||
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
```
|
||||
|
||||
例如,获取某个位置的领地信息:
|
||||
|
||||
```java
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
try {
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
DominionDTO d = dominionAPI.getDominionByLoc(some_location);
|
||||
if (d == null) {
|
||||
this.getLogger().info("no dominion found");
|
||||
return;
|
||||
}
|
||||
this.getLogger().info("name:" + d.getName());
|
||||
} catch (Exception e) {
|
||||
this.getLogger().info(e.getMessage());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[示例项目地址](https://github.com/ColdeZhang/DominionAddonExample)。
|
||||
|
||||
[Javadoc地址](https://coldezhang.github.io/DominionAPI/)。
|
@ -15,17 +15,3 @@
|
||||
```
|
||||
/dominion set_leave_msg <提示语> [领地名称]
|
||||
```
|
||||
|
||||
## 特殊占位符
|
||||
|
||||
- `{OWNER}`:会被自动替换为领地主人的名字;
|
||||
- `{DOM}`:会被自动替换为领地名称;
|
||||
|
||||
## 提示
|
||||
|
||||
- 提示语支持 PlaceholderAPI 占位符,例如 `%player%`
|
||||
会被替换为玩家名,本插件支持的占位符请参考 [PlaceHolderApi 一览](../operator/papi.md);
|
||||
- 提示语支持颜色代码,例如 `&a` 会被替换为亮绿色;
|
||||
- 提示语支持渐变色,更多关于颜色的效果参见 [彩色字符](https://ssl.lunadeer.cn:14448/doc/81/)。
|
||||
|
||||
> PlaceholderAPI 占位符需要服务器管理员安装 PlaceholderAPI 插件方可支持。
|
||||
|
@ -15,7 +15,7 @@
|
||||
## 权限
|
||||
|
||||
当玩家处在一个子领地内时,其行为只收到子领地的权限控制。
|
||||
子领地的权限设置与父领地完全相同,参考[权限管理](permission/README.md)。
|
||||
子领地的权限设置与傅领地完全相同,参考[权限管理](permission/README.md)。
|
||||
|
||||
## 关于子领地嵌套
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
- 1.20.1 及以上;
|
||||
- Spigot、Paper、Folia...;
|
||||
- Java 21 及以上;
|
||||
|
||||
> 虽然本插件支持 Spigot 但是我们强烈推荐您升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。
|
||||
|
||||
|
@ -16,30 +16,14 @@ Language: zh-cn
|
||||
# -1表示不开启
|
||||
AutoCreateRadius: 10
|
||||
|
||||
# 默认进入领地提示消息
|
||||
DefaultJoinMessage: '&3{OWNER}: Welcome to {DOM}!'
|
||||
# 默认离开领地提示消息
|
||||
DefaultLeaveMessage: '&3{OWNER}: Leaving {DOM}...'
|
||||
|
||||
# 领地提示消息显示位置(BOSS_BAR, ACTION_BAR, TITLE, SUBTITLE, CHAT)
|
||||
MessageDisplay:
|
||||
# 玩家没有权限时的提示消息位置
|
||||
NoPermission: ACTION_BAR
|
||||
# 进入/离开领地时的提示消息位置
|
||||
JoinLeave: SUBTITLE
|
||||
|
||||
# 默认玩家圈地限制
|
||||
Limit:
|
||||
SpawnProtection: 10 # 出生点保护半径 出生点此范围内不允许圈地-1表示不开启
|
||||
MinY: -64 # 最小Y坐标
|
||||
MaxY: 320 # 最大Y坐标
|
||||
Size:
|
||||
MaxX: 628 # X方向最大长度-1表示不限制
|
||||
MaxY: 64 # Y方向最大长度-1表示不限制
|
||||
MaxZ: 628 # Z方向最大长度-1表示不限制
|
||||
MinX: 4 # X方向最小长度
|
||||
MinY: 4 # Y方向最小长度
|
||||
MinZ: 4 # Z方向最小长度
|
||||
SizeX: 128 # X方向最大长度-1表示不限制
|
||||
SizeY: 64 # Y方向最大长度-1表示不限制
|
||||
SizeZ: 128 # Z方向最大长度-1表示不限制
|
||||
Amount: 10 # 最大领地数量-1表示不限制
|
||||
Depth: 3 # 子领地深度0表示不开启-1表示不限制
|
||||
Vert: false # 是否自动延伸到 MaxY 和 MinY
|
||||
@ -54,6 +38,7 @@ Limit:
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
Allow: false
|
||||
|
||||
Teleport:
|
||||
Enable: true
|
||||
@ -67,9 +52,6 @@ AutoCleanAfterDays: 180
|
||||
# 圈地工具名称
|
||||
Tool: ARROW
|
||||
|
||||
# 查询领地信息工具名称
|
||||
InfoTool: STRING
|
||||
|
||||
# 经济设置
|
||||
# 需要安装 Vault 前置及插件
|
||||
Economy:
|
||||
@ -119,42 +101,24 @@ Timer: false # 性能测试计时器
|
||||
|
||||
语言设置,参考 languages 文件夹下的文件名。
|
||||
|
||||
如果需要更新语言文件,请删除 `plugins/Dominion/languages` 文件夹下对应的文件,然后重启服务器。
|
||||
插件会自动生成最新的对应语言文件。
|
||||
|
||||
### AutoCreateRadius
|
||||
|
||||
配置玩家在使用“自动创建”功能时会自动向XYZ三个方向延伸此距离创建领地。
|
||||
|
||||
### DefaultJoinMessage & DefaultLeaveMessage
|
||||
|
||||
默认进入领地提示消息和默认离开领地提示消息。
|
||||
|
||||
### MessageDisplay
|
||||
|
||||
配置提示消息显示位置,可选项:`BOSS_BAR`, `ACTION_BAR`, `TITLE`, `SUBTITLE`, `CHAT`。
|
||||
|
||||
- NoPermission:玩家没有权限时的提示消息位置
|
||||
- JoinLeave:进入/离开领地时的提示消息位置
|
||||
|
||||
### Limit
|
||||
|
||||
玩家使用此插件的一些限制:
|
||||
- SpawnProtection:出生点半径保护,此半径范围内普通玩家无法创建领地
|
||||
- MinY:领地的最小Y坐标
|
||||
- MaxY:领地的最大Y坐标
|
||||
- Size:领地的大小限制
|
||||
- MaxX:X方向最大长度 -1表示不限制
|
||||
- MaxY:Y方向最大长度 -1表示不限制
|
||||
- MaxZ:Z方向最大长度 -1表示不限制
|
||||
- MinX:X方向最小长度 不能小于等于0 不能大于MaxX
|
||||
- MinY:Y方向最小长度 不能小于等于0 不能大于MaxY
|
||||
- MinZ:Z方向最小长度 不能小于等于0 不能大于MaxZ
|
||||
- Amount:每个玩家拥有的最大领地数量 -1表示不限制
|
||||
- SizeX:X方向最大长度 1表示不限制
|
||||
- SizeY:Y方向最大长度 1表示不限制
|
||||
- SizeZ:Z方向最大长度 1表示不限制
|
||||
- Amount:每个玩家拥有的最大领地数量 1表示不限制
|
||||
- Depth:子领地深度、0表示不允许子领地、 -1表示不限制
|
||||
- Vert:当设置为 `true` 时,玩家选择区域创建或者自动创建领地,会自动将Y向下向上延伸到MinY和MaxY
|
||||
- Vert:当设置为 `true` 时,玩家选择区域创建或者自动创建领地,会自动将Y向下向上延伸到MinY和MaxY。**同时也会根据 MinY 和 MaxY 的设置自动调整 SizeY 的配置保证数值逻辑一致。**
|
||||
- WorldSettings:单独设置某个世界的圈地规则(如不设置则使用上述默认规则)
|
||||
- OpByPass:是否允许OP无视领地限制
|
||||
- Allow:是否允许在此世界圈地
|
||||
|
||||
> 您服务器世界的名称应该避免使用 `default` 这样的特殊单词,否则会导致不可预料的意外错误。
|
||||
|
||||
@ -170,10 +134,6 @@ Timer: false # 性能测试计时器
|
||||
|
||||
配置手动圈地时的选取工具。如果配置错误会被设置为默认值“ARROW”箭矢。
|
||||
|
||||
### InfoTool
|
||||
|
||||
配置查询领地信息工具。如果配置错误会被设置为默认值“STRING”字符串。使用左键配合该物品点击领地内方块时会显示领地信息。
|
||||
|
||||
### Economy
|
||||
|
||||
经济控制支持,让玩家需要花费金钱圈地。使用此特性需要安装 Vault 经济前置插件。
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 跨群组服传送
|
||||
|
||||
**该功能暂未上线**
|
||||
**改功能暂未上线**
|
||||
|
||||
## 新服务器配置
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
# PlaceHolderApi 一览
|
||||
|
||||
## `%dominion_group_title%`:权限组称号
|
||||
|
||||
## `%dominion_current_dominion%`:玩家当前所在领地名
|
||||
|
||||
|
||||
|
@ -1,14 +1,5 @@
|
||||
# Dominion 文檔
|
||||
|
||||
[![GitHub Repository](https://img.shields.io/badge/SourceCode-GitHub-blue?logo=github)](https://github.com/ColdeZhang/Dominion)
|
||||
[![bStats](https://img.shields.io/badge/bStats-Statistics-eacd76?logo=google-analytics)](https://bstats.org/plugin/bukkit/Dominion/21445)
|
||||
|
||||
[![Hangar](https://img.shields.io/badge/To-Hangar-004ee9)](https://hangar.papermc.io/zhangyuheng/Dominion)
|
||||
[![Modrinth](https://img.shields.io/badge/To-Modrinth-1bd96a)](https://modrinth.com/plugin/zhangyuheng-dominion)
|
||||
[![Spigot](https://img.shields.io/badge/To-Spigot-ed8106)](https://www.spigotmc.org/resources/dominion.119514/)
|
||||
|
||||
[![Latest Build](https://img.shields.io/github/v/release/ColdeZhang/Dominion?label=LatestBuild&logo=github&color=0aa344)](https://github.com/ColdeZhang/Dominion/releases/latest)
|
||||
|
||||
## 前言
|
||||
|
||||
首先十分感謝您選擇並使用本插件。
|
||||
|
@ -5,7 +5,7 @@
|
||||
* [領地管理](manage-dominion/README.md)
|
||||
* [環境設置](manage-dominion/environment.md)
|
||||
* [權限管理](manage-dominion/permission/README.md)
|
||||
* [訪客權限](manage-dominion/permission/guest.md)
|
||||
* [訪客權限](manage-dominion/permission/guest)
|
||||
* [領地成員](manage-dominion/permission/member.md)
|
||||
* [權限組](manage-dominion/permission/permission-group.md)
|
||||
* [權限模板](manage-dominion/permission/template.md)
|
||||
@ -21,5 +21,4 @@
|
||||
* [flags.yml](operator/flags.md)
|
||||
* [特權玩家配置](operator/privilege.md)
|
||||
* [跨群組服傳送(global-tp 測試中)](operator/global-tp.md)
|
||||
* [开发者文档](developer.md)
|
||||
|
||||
|
@ -1,99 +0,0 @@
|
||||
# 开发者文档
|
||||
|
||||
> DominionAPI 自 Dominion-2.9.0-beta 开始支持。
|
||||
|
||||
## 一、接入 DominionAPI
|
||||
|
||||
### 1. 引入依赖
|
||||
|
||||
如果您使用 gradle,可以在您的 `build.gradle` 文件中添加如下代码:
|
||||
|
||||
```groovy
|
||||
// build.gradle
|
||||
repositories {
|
||||
maven { url = "https://ssl.lunadeer.cn:14454/repository/maven-snapshots/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
或者你使用的是 gradle kotlin dsl:
|
||||
|
||||
```kotlin
|
||||
// build.gradle.kts
|
||||
repositories {
|
||||
maven("https://ssl.lunadeer.cn:14454/repository/maven-snapshots/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("cn.lunadeer:DominionAPI:2.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
再或者您使用 maven,可以在您的 `pom.xml` 文件中添加如下代码:
|
||||
|
||||
```xml
|
||||
<!-- pom.xml -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>lunadeer</id>
|
||||
<url>https://ssl.lunadeer.cn:14454/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>DominionAPI</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
### 2. plugin.yml 配置
|
||||
|
||||
在您的插件的 `plugin.yml` 文件中添加如下配置,以确保在 Dominion 准备完成后再加载您的插件:
|
||||
|
||||
```yaml
|
||||
# plugin.yml
|
||||
depend: [ Dominion ]
|
||||
```
|
||||
|
||||
## 二、使用 DominionAPI
|
||||
|
||||
可以通过如下方法直接获取 DominionAPI 实例:
|
||||
|
||||
```java
|
||||
import cn.lunadeer.dominion.api.Dominion;
|
||||
import cn.lunadeer.dominion.api.DominionAPI;
|
||||
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
```
|
||||
|
||||
例如,获取某个位置的领地信息:
|
||||
|
||||
```java
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
try {
|
||||
DominionAPI dominionAPI = Dominion.getInstance();
|
||||
DominionDTO d = dominionAPI.getDominionByLoc(some_location);
|
||||
if (d == null) {
|
||||
this.getLogger().info("no dominion found");
|
||||
return;
|
||||
}
|
||||
this.getLogger().info("name:" + d.getName());
|
||||
} catch (Exception e) {
|
||||
this.getLogger().info(e.getMessage());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[示例项目地址](https://github.com/ColdeZhang/DominionAddonExample)。
|
||||
|
||||
[Javadoc地址](https://coldezhang.github.io/DominionAPI/)。
|
@ -4,6 +4,7 @@
|
||||
|
||||
- 1.20.1 及以上;
|
||||
- Spigot、Paper、Folia...;
|
||||
- Java 21 及以上;
|
||||
|
||||
> 雖然本插件支持 Spigot 但是我們強烈推薦您升級到 Paper 或其分支核心(如 Purpur)以獲得更好的性能體驗。
|
||||
|
||||
|
@ -92,9 +92,6 @@ Timer: false # 性能測試計時器
|
||||
|
||||
語言設置,參考 languages 文件夾下的文件名。
|
||||
|
||||
如果需要更新语言文件,请删除 `plugins/Dominion/languages` 文件夹下对应的文件,然后重启服务器。
|
||||
插件会自动生成最新的对应语言文件。
|
||||
|
||||
### AutoCreateRadius
|
||||
|
||||
配置玩家在使用「自動創建」功能時會自動向XYZ三個方向延伸此距離創建領地。
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 128 KiB |
@ -6,5 +6,4 @@
|
||||
<img src="imgs/Dominion-05.png" alt="" width="100%"/>
|
||||
<img src="imgs/Dominion-06.png" alt="" width="100%"/>
|
||||
<img src="imgs/Dominion-07.png" alt="" width="100%"/>
|
||||
<img src="imgs/Dominion-08.png" alt="" width="100%"/>
|
||||
</div>
|
@ -4,92 +4,105 @@
|
||||
# Translated by: YOUR_NAME_HERE
|
||||
Commands:
|
||||
Dominion:
|
||||
SetFlagUsage: 'Usage: /dominion set <flag_name> <true/false> [dominion name]'
|
||||
CreateDominionUsage: 'Usage: /dominion create <dominion name>'
|
||||
CreateSelectPointsFirst: Please first use the tool to select the points, or use /dominion auto_create <dominion name> to create dominion automatically.
|
||||
CreateSubDominionUsage: 'Usage: /dominion create_sub <sub name> [parent name]'
|
||||
CreateSubSelectPointsFirst: Please first use the tool to select the points, or use /dominion auto_create_sub <sub name> [parent name] to create sub-dominion automatically.
|
||||
AutoCreateDominionUsage: 'Usage: /dominion auto_create <dominion name>'
|
||||
AutoCreateSubDominionUsage: 'Usage: /dominion auto_create_sub <sub name> [parent name]'
|
||||
AutoCreateDominionDisabled: Automatic creation function has been disabled by operator.
|
||||
ExpandDominionUsage: 'Usage: /dominion expand [size] [dominion name]'
|
||||
ContractDominionUsage: 'Usage: /dominion contract [size] [dominion name]'
|
||||
SizeShouldBeInteger: Size should be an integer.
|
||||
SizeShouldBePositive: Size should be greater than 0.
|
||||
DeleteDominionUsage: 'Usage: /dominion delete <dominion name>'
|
||||
SetEnterMessageUsage: 'Usage: /dominion set_enter_msg <msg> [dominion name]'
|
||||
SetLeaveMessageUsage: 'Usage: /dominion set_leave_msg <msg> [dominion name]'
|
||||
SetTpLocationUsage: 'Usage: /dominion set_tp_location [dominion name]'
|
||||
RenameDominionUsage: 'Usage: /dominion rename <old name> <new name>'
|
||||
GiveDominionUsage: 'Usage: /dominion give <dominion name> <player name>'
|
||||
TpDominionUsage: 'Usage: /dominion tp <dominion name>'
|
||||
DominionNotExist: Dominion does not exist.
|
||||
SetMapColorUsage: 'Usage: /dominion set_map_color <hex color> [dominion name]'
|
||||
SetFlagUsage: 'Usage: /dominion set <flag_name> <true/false> [dominion_name]'
|
||||
CreateDominionUsage: 'Usage: /dominion create <territory_name>'
|
||||
CreateSelectPointsFirst: Please first use the tool to select the diagonal points of the territory, or use /dominion auto_create <territory_name> to create an automatic territory
|
||||
CreateSubDominionUsage: 'Usage: /dominion create_sub <sub_territory_name> [parent_territory_name]'
|
||||
CreateSubSelectPointsFirst: Please first use the tool to select the diagonal points of the sub-territory, or use /dominion auto_create_sub <sub_territory_name> [parent_territory_name] to create an automatic sub-territory
|
||||
AutoCreateDominionUsage: 'Usage: /dominion auto_create <territory_name>'
|
||||
AutoCreateSubDominionUsage: 'Usage: /dominion auto_create_sub <sub_territory_name> [parent_territory_name]'
|
||||
AutoCreateDominionDisabled: Automatic dominion creation function has been disabled
|
||||
ExpandDominionUsage: 'Usage: /dominion expand [size] [dominion_name]'
|
||||
ContractDominionUsage: 'Usage: /dominion contract [size] [dominion_name]'
|
||||
SizeShouldBeInteger: Size should be an integer
|
||||
SizeShouldBePositive: Size should be greater than 0
|
||||
DeleteDominionUsage: 'Usage: /dominion delete <territory_name>'
|
||||
SetEnterMessageUsage: 'Usage: /dominion set_enter_msg <prompt> [territory_name]'
|
||||
SetLeaveMessageUsage: 'Usage: /dominion set_leave_msg <prompt> [territory_name]'
|
||||
SetTpLocationUsage: 'Usage: /dominion set_tp_location [dominion_name]'
|
||||
RenameDominionUsage: 'Usage: /dominion rename <original_territory_name> <new_territory_name>'
|
||||
GiveDominionUsage: 'Usage: /dominion give <territory_name> <player_name>'
|
||||
TpDominionUsage: 'Usage: /dominion tp <territory_name>'
|
||||
DominionNotExist: Dominion does not exist
|
||||
SetMapColorUsage: 'Usage: /dominion set_map_color <color> [territory_name]'
|
||||
Group:
|
||||
CreateGroupUsage: 'Usage: /dominion group create <dominion name> <group name>'
|
||||
DeleteGroupUsage: 'Usage: /dominion group delete <dominion name> <group name>'
|
||||
RenameGroupUsage: 'Usage: /dominion group rename <dominion name> <old name> <new name>'
|
||||
SetGroupFlagUsage: 'Usage: /dominion group set_flag <dominion name> <group name> <flag name> <true|false>'
|
||||
AddGroupMemberUsage: 'Usage: /dominion group add_member <dominion name> <group name> <player name>'
|
||||
RemoveGroupMemberUsage: 'Usage: /dominion group remove_member <dominion name> <group name> <player name>'
|
||||
CreateGroupUsage: 'Usage: /dominion group create <territory_name> <permission_group_name>'
|
||||
DeleteGroupUsage: 'Usage: /dominion group delete <territory_name> <permission_group_name>'
|
||||
RenameGroupUsage: 'Usage: /dominion group rename <territory_name> <old_permission_group_name> <new_name>'
|
||||
SetGroupFlagUsage: 'Usage: /dominion group set_flag <territory_name> <permission_group_name> <permission_name> <true|false>'
|
||||
AddGroupMemberUsage: 'Usage: /dominion group add_member <territory_name> <permission_group_name> <player_name>'
|
||||
RemoveGroupMemberUsage: 'Usage: /dominion group remove_member <territory_name> <permission_group_name> <player_name>'
|
||||
GroupUsage: 'Usage: /dominion group <create|delete|rename|set_flag|add_member|remove_member|select_member|setting|list>'
|
||||
NewGroupName: New group name
|
||||
Member:
|
||||
DominionAddMemberUsage: 'Usage: /dominion member add <dominion name> <player name>'
|
||||
DominionSetFlagUsage: 'Usage: /dominion member set_flag <dominion name> <player name> <flag name> <true/false>'
|
||||
DominionRemoveMemberUsage: 'Usage: /dominion member remove <dominion name> <player name>'
|
||||
DominionApplyTemplateUsage: 'Usage: /dominion member apply_template <dominion name> <player name> <template name>'
|
||||
DominionAddMemberUsage: 'Usage: /dominion member add <territory_name> <player_name>'
|
||||
DominionSetFlagUsage: 'Usage: /dominion member set_flag <territory_name> <player_name> <permission_name> <true/false>'
|
||||
DominionRemoveMemberUsage: 'Usage: /dominion member remove <territory_name> <player_name>'
|
||||
DominionApplyTemplateUsage: 'Usage: /dominion member apply_template <territory_name> <player_name> <template_name>'
|
||||
MemberUsage: 'Usage: /dominion member <add/set_flag/remove/apply_template/list/setting/select_player/select_template>'
|
||||
PageOptional: Page (optional)
|
||||
ArgumentsNotEnough: Insufficient parameters.
|
||||
UnknownArgument: Unknown argument.
|
||||
PageOptional: Page number (optional)
|
||||
ArgumentsNotEnough: Insufficient parameters
|
||||
UnknownArgument: Unknown argument
|
||||
SizeInteger: Size (integer)
|
||||
DominionName: Dominion Name
|
||||
SubDominionName: Sub-dominion Name
|
||||
EnterMessageContent: Enter Message
|
||||
LeaveMessageContent: Leave Message
|
||||
InputColor: Color (HEX)
|
||||
NewDominionName: New Dominion Name
|
||||
DominionName: Dominion name
|
||||
SubDominionName: Sub-dominion name
|
||||
EnterMessageContent: Enter message content
|
||||
LeaveMessageContent: Leave message content
|
||||
InputColor: Input color (hexadecimal)
|
||||
NewDominionName: New dominion name
|
||||
Residence:
|
||||
MigrationDisabled: Migration from residence has been disabled by operator.
|
||||
MigrateUsage: 'Usage: /dominion migrate <res territory name>'
|
||||
NoMigrationData: You have no data to migrate.
|
||||
NoResidenceDominion: Specified res territory not found.
|
||||
ResidenceNotOwner: You are not the owner of this res territory, cannot migrate it.
|
||||
MigrateFailed: 'Migration failed: %s.'
|
||||
MigrateSuccess: Territory %s has been migrated from Residence to Dominion.
|
||||
MigrationDisabled: Residence migration feature is not enabled
|
||||
MigrateUsage: 'Usage: /dominion migrate <res_dominion_name>'
|
||||
NoMigrationData: You have no data to migrate
|
||||
NoResidenceDominion: Specified Residence dominion not found
|
||||
ResidenceNotOwner: You are not the owner of this dominion, cannot migrate it
|
||||
MigrateFailed: 'Migration failed: %s'
|
||||
MigrateSuccess: Dominion %s has been migrated from Residence to Dominion
|
||||
Operator:
|
||||
ReloadingDominionCache: Reloading cache from the database...
|
||||
ReloadedDominionCache: Cache has been reloaded.
|
||||
ReloadingPrivilegeCache: Reloading player permission cache from the database...
|
||||
ReloadedPrivilegeCache: Player permission cache has been reloaded.
|
||||
ReloadingDominionCache: Reloading dominion cache from the database...
|
||||
ReloadedDominionCache: Dominion cache has been reloaded
|
||||
ReloadingPrivilegeCache: Reloading player privilege cache from the database...
|
||||
ReloadedPrivilegeCache: Player privilege cache has been reloaded
|
||||
ReloadingGroupCache: Reloading group cache from the database...
|
||||
ReloadedGroupCache: Group cache has been reloaded.
|
||||
ExportingMCAList: Exporting the list of MCA files containing dominions...
|
||||
CreateExportFolderFailed: Failed to create export folder.
|
||||
ReloadedGroupCache: Group cache has been reloaded
|
||||
ExportingMCAList: Exporting the list of MCA files for owned territories...
|
||||
CreateExportFolderFailed: Failed to create export folder
|
||||
ExportingMCAListForWorld: Exporting the list of MCA files for %s...
|
||||
DeleteMCAListFailed: Failed to delete the MCA file list for %s.
|
||||
CreateMCAListFailed: Failed to create the MCA file list for %s.
|
||||
WriteMCAListFailed: Failed to write to %s.
|
||||
ExportMCAListFailed: Failed to export the MCA file list for %s.
|
||||
ExportedMCAList: MCA file list has been exported to %s.
|
||||
DeleteMCAListFailed: Failed to delete the MCA file list for %s
|
||||
CreateMCAListFailed: Failed to create the MCA file list for %s
|
||||
WriteMCAListFailed: Failed to write to %s
|
||||
ExportMCAListFailed: Failed to export the MCA file list for %s
|
||||
ExportedMCAList: MCA file list has been exported to %s
|
||||
ReloadingConfig: Reloading configuration file...
|
||||
ReloadedConfig: Configuration file has been reloaded.
|
||||
ReloadedConfig: Configuration file has been reloaded
|
||||
SetConfig:
|
||||
MinYShouldBeLessThanMaxY: The maximum Y coordinate limit cannot be less than the minimum Y coordinate limit
|
||||
MaxYShouldBeGreaterThanMinY: The minimum Y coordinate limit cannot be greater than the maximum Y coordinate limit
|
||||
SizeXShouldBeGreaterThan4: The maximum size on the X axis (East-West) cannot be less than 4
|
||||
SizeZShouldBeGreaterThan4: The maximum size on the Z axis (North-South) cannot be less than 4
|
||||
SizeYShouldBeGreaterThan4: The maximum size on the Y axis (Vertical) cannot be less than 4
|
||||
AmountShouldBeGreaterThan0: The limit of the number of dominions per player cannot be less than 0
|
||||
DepthShouldBeGreaterThan0: The depth limit of the dominion cannot be less than 0
|
||||
TpDelayShouldBeGreaterThan0: Teleport delay cannot be less than 0
|
||||
TpCoolDownShouldBeGreaterThan0: Teleport cooldown cannot be less than 0
|
||||
PriceShouldBeGreaterThan0: The price per block cannot be less than 0
|
||||
RefundShouldBeGreaterThan0: The refund ratio for the dominion cannot be less than 0
|
||||
SpawnProtectRadiusShouldBeGreaterThan0: Spawn protection radius cannot be less than or equal to 0
|
||||
Template:
|
||||
CreateTemplateUsage: 'Usage: /dominion template create <template name>'
|
||||
DeleteTemplateUsage: 'Usage: /dominion template delete <template name>'
|
||||
SetTemplateFlagUsage: 'Usage: /dominion template set_flag <template name> <flag name> <true/false>'
|
||||
CreateTemplateUsage: 'Usage: /dominion template create <template_name>'
|
||||
DeleteTemplateUsage: 'Usage: /dominion template delete <template_name>'
|
||||
SetTemplateFlagUsage: 'Usage: /dominion template set_flag <template_name> <permission_name> <true/false>'
|
||||
TemplateUsage: 'Usage: /dominion template <list|setting|delete|create|set_flag>'
|
||||
NewTemplateName: New template name
|
||||
Title:
|
||||
UseTitleUsage: 'Usage: /dominion use_title <group id>'
|
||||
RemoveTitleSuccess: Successfully removed title.
|
||||
GroupNotExist: Group does not exist.
|
||||
GroupDominionNotExist: Group %s does not belong to any dominion.
|
||||
NotDominionMember: You are not a member of dominion %s and cannot use its title.
|
||||
NotGroupMember: You are not a member of group %s and cannot use its title.
|
||||
UseTitleSuccess: Successfully used group title %s.
|
||||
UseTitleFailed: 'Using title failed: %s.'
|
||||
UseTitleUsage: 'Usage: /dominion use_title <permission_group_id>'
|
||||
RemoveTitleSuccess: Successfully removed group title
|
||||
GroupNotExist: Group does not exist
|
||||
GroupDominionNotExist: Group %s does not belong to any dominion
|
||||
NotDominionMember: You are not a member of dominion %s and cannot use its title
|
||||
NotGroupMember: You are not a member of group %s and cannot use its title
|
||||
UseTitleSuccess: Successfully used group %s title
|
||||
UseTitleFailed: 'Using title failed: %s'
|
||||
Messages:
|
||||
OpBypassTpLimit: You are OP, you will bypass territory teleportation limits
|
||||
WorldNotExist: The world where the dominion is located does not exist
|
||||
@ -243,172 +256,174 @@ Messages:
|
||||
AutoCleanEnd: Automatic cleanup completed
|
||||
MapInfoDetail: '<div>%s</div><div>Everyone: %s</div>'
|
||||
TUI:
|
||||
NotDominionOwnerOrAdminForPage: You are not the owner or admin of %s and have no access to this page
|
||||
NotDominionOwnerOrAdminForPage: You are not the owner or admin of territory %s and have no access to this page
|
||||
CommandHelp:
|
||||
Title: Commands Help List
|
||||
SubTitle: <> is necessary, [] is optional
|
||||
Title: Territory plugin command help
|
||||
SubTitle: <> indicates required parameters and [] indicates optional parameters
|
||||
Navigation:
|
||||
Menu: MAIN
|
||||
DominionList: DOMS
|
||||
Manage: MANAGE
|
||||
EnvSetting: ENV
|
||||
GuestSetting: GUEST
|
||||
MemberList: MEMBERS
|
||||
MemberSetting: MEMBER
|
||||
GroupList: GROUPS
|
||||
GroupSetting: GROUP
|
||||
AllDominion: ALL_DOMS
|
||||
TemplateList: TEMPLATES
|
||||
TemplateSetting: TEMPLATE
|
||||
MigrateList: RES_DATA
|
||||
TitleList: TITLES
|
||||
ManageButton: MANAGE
|
||||
DeleteButton: DELETE
|
||||
SearchButton: SEARCH
|
||||
BackButton: BACK
|
||||
SelectButton: SELECT
|
||||
EditButton: EDIT
|
||||
Menu: Main Menu
|
||||
DominionList: My Territories
|
||||
Manage: Management Interface
|
||||
EnvSetting: Environmental Settings
|
||||
GuestSetting: Guest Permissions
|
||||
MemberList: Member List
|
||||
MemberSetting: Member Permissions
|
||||
GroupList: Permission Group List
|
||||
GroupSetting: Permission Group Management
|
||||
AllDominion: All Territories
|
||||
TemplateList: Template List
|
||||
TemplateSetting: Template Management
|
||||
MigrateList: Res Data List
|
||||
TitleList: Permission Group Title List
|
||||
ManageButton: Manage
|
||||
DeleteButton: Delete
|
||||
SearchButton: Search
|
||||
BackButton: Return
|
||||
SelectButton: Select
|
||||
EditButton: Edit
|
||||
Menu:
|
||||
Title: Dominion Main Menu
|
||||
CreateDominionButton: CREATE
|
||||
CreateDominionDescription: Create a dominion automatically around you.
|
||||
MyDominionButton: DOMINIONS
|
||||
MyDominionDescription: List all your dominions.
|
||||
TitleListButton: TITLES
|
||||
TitleListDescription: List/Use group titles.
|
||||
TemplateListButton: TEMPLATES
|
||||
TemplateListDescription: Permission template list.
|
||||
CommandHelpButton: HELP
|
||||
CommandHelpDescription: View command list.
|
||||
DocumentButton: DOCS
|
||||
DocumentDescription: Open usage documentation in the browser.
|
||||
MigrateButton: MIGRATE
|
||||
MigrateDescription: Migrate your territories from Residence.
|
||||
AllDominionButton: ALL_DOMS
|
||||
AllDominionDescription: List all dominions of server.
|
||||
ReloadCacheButton: RELOAD_CACHE
|
||||
ReloadCacheDescription: Could solve some weird problem. DONT DO THIS FREQUENTLY!
|
||||
ReloadConfigButton: RELOAD_CONF
|
||||
ReloadConfigDescription: Reload configuration file from disk.
|
||||
OpOnlySection: '--- FOLLOWING VISIBLE OP ONLY ---'
|
||||
Title: Dominion Territory System
|
||||
CreateDominionButton: Create Territory
|
||||
CreateDominionDescription: Automatically create a new territory centered on you
|
||||
MyDominionButton: My Territories
|
||||
MyDominionDescription: View my territory list
|
||||
TitleListButton: Title List
|
||||
TitleListDescription: View/use permission group titles
|
||||
TemplateListButton: Template List
|
||||
TemplateListDescription: Member Permission Template List
|
||||
CommandHelpButton: Command Help
|
||||
CommandHelpDescription: View command list
|
||||
DocumentButton: Usage Documentation
|
||||
DocumentDescription: Open usage documentation in the browser
|
||||
MigrateButton: Migrate Data
|
||||
MigrateDescription: Migrate your territory from Residence to Dominion
|
||||
AllDominionButton: All Territories
|
||||
AllDominionDescription: View all territories
|
||||
ConfigButton: System Configuration
|
||||
ConfigDescription: View/modify system configuration
|
||||
ReloadCacheButton: Reload Cache
|
||||
ReloadCacheDescription: Manually refreshing the cache can solve some player operation issues. Frequent operation is not recommended
|
||||
ReloadConfigButton: Reload Configuration
|
||||
ReloadConfigDescription: Reload configuration file
|
||||
OpOnlySection: '--- The following options are visible only to OP ---'
|
||||
DominionList:
|
||||
Title: My Dominion List
|
||||
AdminSection: '--- YOU ARE ADMIN OF FOLLOWING ---'
|
||||
Title: My Territory List
|
||||
AdminSection: '--- The following are the territories where you have admin privileges ---'
|
||||
DominionManage:
|
||||
Title: '%s Management'
|
||||
InfoButton: DETAILS
|
||||
InfoDescription: View details of this dominion.
|
||||
EnvSettingButton: ENV_SETTING
|
||||
EnvSettingDescription: Set some environmental behaviors.
|
||||
GuestSettingButton: GUEST_SETTING
|
||||
GuestSettingDescription: Configure guest permissions.
|
||||
MemberListButton: MEMBERS
|
||||
MemberListDescription: Manage the permissions of members.
|
||||
GroupListButton: GROUPS
|
||||
GroupListDescription: Manage the permission groups.
|
||||
SetTpLocationButton: SET_TP_LOC
|
||||
SetTpLocationDescription: Set the teleport point.
|
||||
RenameButton: RENAME
|
||||
RenameDescription: Rename the dominion.
|
||||
EditJoinMessageButton: EDIT_ENTER_MSG
|
||||
EditJoinMessageDescription: Message displayed when enter.
|
||||
EditLeaveMessageButton: EDIT_LEAVE_MSG
|
||||
EditLeaveMessageDescription: Message displayed when leave.
|
||||
SetMapColorButton: COLOR
|
||||
SetMapColorDescription: Color will be shown on web map.
|
||||
Title: Management Interface for Territory %s
|
||||
InfoButton: Detailed Information
|
||||
InfoDescription: View detailed information of the territory
|
||||
EnvSettingButton: Environmental Settings
|
||||
EnvSettingDescription: Set some environmental behaviors within the territory
|
||||
GuestSettingButton: Guest Permissions
|
||||
GuestSettingDescription: Configure guest permissions in this territory
|
||||
MemberListButton: Member Management
|
||||
MemberListDescription: Manage the permissions of members of this territory
|
||||
GroupListButton: Permission Groups
|
||||
GroupListDescription: Manage the permission groups of this territory
|
||||
SetTpLocationButton: Set Teleport Points
|
||||
SetTpLocationDescription: Set your current location as the teleport point for this territory
|
||||
RenameButton: Rename
|
||||
RenameDescription: Rename the territory
|
||||
EditJoinMessageButton: Edit Welcome Message
|
||||
EditJoinMessageDescription: Message displayed when a player enters the territory
|
||||
EditLeaveMessageButton: Edit Leave Message
|
||||
EditLeaveMessageDescription: Message displayed when a player leaves the territory
|
||||
SetMapColorButton: Set Land Color
|
||||
SetMapColorDescription: Set the land color on the satellite map
|
||||
NotInDominion: You are not in any dominion, please specify the dominion name /dominion manage <dominion name>
|
||||
EnvSetting:
|
||||
Title: '%s Environmental Settings'
|
||||
Usage: 'Usage: /dominion env_setting <dominion name> [page]'
|
||||
Title: Environmental Settings for Territory %s
|
||||
Usage: 'Usage: /dominion env_setting <dominion name> [page number]'
|
||||
GuestSetting:
|
||||
Title: '%s Guest Settings'
|
||||
Usage: 'Usage: /dominion guest_setting <dominion name> [page]'
|
||||
Title: Guest Permissions for Territory %s
|
||||
Usage: 'Usage: /dominion guest_setting <dominion name> [page number]'
|
||||
SizeInfo:
|
||||
Title: '%s Size Information'
|
||||
Owner: 'Owner:'
|
||||
Size: 'Size:'
|
||||
Title: Size Information for Territory %s
|
||||
Owner: 'Territory Owner:'
|
||||
Size: 'Territory Size:'
|
||||
Center: 'Center Coordinates:'
|
||||
Vertical: 'Vertical Height:'
|
||||
VertY: 'Y-axis Coordinates:'
|
||||
Square: 'Square:'
|
||||
Volume: 'Volume:'
|
||||
TpLocation: 'Teleport Coordinates:'
|
||||
NoneTp: None Tp Info
|
||||
Square: 'Horizontal Area:'
|
||||
Volume: 'Territory Volume:'
|
||||
TpLocation: 'Teleport Point Coordinates:'
|
||||
NoneTp: None
|
||||
Usage: You are not in any dominion, please specify the dominion name /dominion info <dominion name>
|
||||
MemberList:
|
||||
Title: '%s Member List'
|
||||
AddButton: ADD_MEMBER
|
||||
FlagButton: PERMS
|
||||
FlagDescription: Configure member permissions.
|
||||
RemoveButton: REMOVE
|
||||
RemoveDescription: Remove this member (to guest).
|
||||
NoPermissionSet: Only owner can set admin permissions.
|
||||
NoPermissionRemove: Only owner can remove admin permissions.
|
||||
BelongToGroup: This member belongs to group %s and cannot set permissions separately.
|
||||
Usage: 'Usage: /dominion member list <dominion name> [page]'
|
||||
AdminTag: This member is an ADMIN.
|
||||
NormalTag: This is a regular MEMBER.
|
||||
BlacklistTag: This is a BLACKLIST member.
|
||||
GroupTag: This member is in a GROUP.
|
||||
Title: Member List for Territory %s
|
||||
AddButton: Add Member
|
||||
FlagButton: Permissions
|
||||
FlagDescription: Configure Member Permissions
|
||||
RemoveButton: Remove
|
||||
RemoveDescription: Remove this member (turn to guest)
|
||||
NoPermissionSet: You are not the territory owner and cannot edit admin permissions
|
||||
NoPermissionRemove: You are not the territory owner and cannot remove the admin
|
||||
BelongToGroup: This member belongs to permission group %s and cannot edit permissions separately
|
||||
Usage: 'Usage: /dominion member list <dominion name> [page number]'
|
||||
AdminTag: This member is an admin
|
||||
NormalTag: This is a regular member
|
||||
BlacklistTag: This is a blacklist member
|
||||
GroupTag: This member is in a permission group
|
||||
MemberSetting:
|
||||
Title: '%s Permission in %s'
|
||||
ApplyTemplateButton: APPLY_TEMPLATE
|
||||
ApplyTemplateDescription: Choose a template to apply.
|
||||
Usage: 'Usage: /dominion member setting <dominion name> <player name> [page]'
|
||||
Title: Permission Settings for Player %s in Territory %s
|
||||
ApplyTemplateButton: Apply Template
|
||||
ApplyTemplateDescription: Choose a permission template to apply
|
||||
Usage: 'Usage: /dominion member setting <dominion name> <player name> [page number]'
|
||||
SelectPlayer:
|
||||
Title: Select Player to Add as Member
|
||||
Description: You can only select players who have logged before.
|
||||
Usage: 'Usage: /dominion member select_player <dominion name> [page]'
|
||||
Description: You can only select players who have logged in
|
||||
Usage: 'Usage: /dominion member select_player <dominion name> [page number]'
|
||||
SelectTemplate:
|
||||
Title: Select a Template
|
||||
Description: Apply to %s in %s.
|
||||
Usage: 'Usage: /dominion member select_template <dominion name> <player name> [page]'
|
||||
Description: Apply to member %s in territory %s
|
||||
Usage: 'Usage: /dominion member select_template <dominion name> <player name> [page number]'
|
||||
GroupList:
|
||||
Title: '%s Group List'
|
||||
CreateButton: CREATE_GROUP
|
||||
CreateDescription: Create a new group.
|
||||
DeleteDescription: Delete group %s.
|
||||
EditDescription: Edit group %s.
|
||||
AddMemberDescription: Add member to group %s.
|
||||
RemoveMemberDescription: Remove %s from group %s.
|
||||
Usage: 'Usage: /dominion group list <dominion name> [page]'
|
||||
Title: Permission Group List for Territory %s
|
||||
CreateButton: Create Permission Group
|
||||
CreateDescription: Create a new permission group
|
||||
DeleteDescription: Delete permission group %s
|
||||
EditDescription: Edit permission group %s
|
||||
AddMemberDescription: Add member to permission group %s
|
||||
RemoveMemberDescription: Remove %s from permission group %s
|
||||
Usage: 'Usage: /dominion group list <dominion name> [page number]'
|
||||
GroupSetting:
|
||||
RenameButton: RENAME_GROUP
|
||||
Usage: 'Usage: /dominion group setting <dominion name> <group name> [page]'
|
||||
TitleL: 'Group '
|
||||
RenameButton: Rename this permission group
|
||||
Usage: 'Usage: /dominion group setting <dominion name> <permission group name> [page number]'
|
||||
TitleL: 'Permission Group '
|
||||
TitleR: ' Management'
|
||||
RenameDescription: Rename group %s.
|
||||
RenameDescription: Rename permission group %s
|
||||
SelectMember:
|
||||
Title: Select Member
|
||||
Description: Select a member to add to group %s.
|
||||
Usage: 'Usage: /dominion group select_member <dominion name> <group name> [cb page] [page]'
|
||||
Description: Select members to add to permission group %s
|
||||
Usage: 'Usage: /dominion group select_member <dominion name> <permission group name> [echo page number] [page number]'
|
||||
TemplateList:
|
||||
Title: Permission Template List
|
||||
CreateButton: CREATE_TEMPLATE
|
||||
CreateDescription: Create a new permission template.
|
||||
Title: Member Permission Template List
|
||||
CreateButton: Create Member Permission Template
|
||||
CreateDescription: Create a new member permission template
|
||||
TemplateSetting:
|
||||
Title: Template %s Management
|
||||
Title: Manage Permissions for Template %s
|
||||
Migrate:
|
||||
Title: Migration from Residence
|
||||
NoData: You do not have any data to migrate.
|
||||
Button: MIGRATE
|
||||
SubDominion: Sub-territories cannot be migrated manually, they will migrate automatically with the parent territory.
|
||||
Title: Migrate Data from Residence
|
||||
NoData: You do not have any data to migrate
|
||||
Button: Migrate
|
||||
SubDominion: Sub-territories cannot be migrated manually; they will migrate automatically with the parent territory
|
||||
TitleList:
|
||||
Title: My Group Titles
|
||||
RemoveButton: UNSET
|
||||
ApplyButton: USE
|
||||
FromDominion: 'From Dominion:'
|
||||
Title: Permission Group Titles I Can Use
|
||||
RemoveButton: Remove
|
||||
ApplyButton: Use
|
||||
FromDominion: 'From Territory:'
|
||||
CUI:
|
||||
Input:
|
||||
CreateDominion: Type New Dominion Name
|
||||
CreateGroup: Type New Group Name
|
||||
CreateTemplate: Type New Template Name
|
||||
EditEnterMessage: Edit Enter Message
|
||||
EditLeaveMessage: Edit Leave Message
|
||||
AddMember: Type Player Name to Add Member
|
||||
RenameDominion: Rename Dominion
|
||||
RenameGroup: Rename Group
|
||||
SetMapColor: Type HEX Color
|
||||
CreateDominion: Enter the name of the territory to create
|
||||
CreateGroup: Enter the name of the permission group to create
|
||||
CreateTemplate: Enter the name of the template to create
|
||||
EditEnterMessage: Edit the territory entry message content
|
||||
EditLeaveMessage: Edit the territory exit message content
|
||||
AddMember: Enter player name to add as a member
|
||||
RenameDominion: Rename Territory
|
||||
RenameGroup: Rename Permission Group
|
||||
SetMapColor: Enter the hex color for the satellite map plots
|
||||
Config:
|
||||
Check:
|
||||
AutoCreateRadiusError: AutoCreateRadius cannot be 0, reset to 10
|
||||
@ -675,7 +690,7 @@ Flags:
|
||||
DisplayName: Wither Spawn
|
||||
Description: Wither spawn and the explosion caused by wither spawn
|
||||
Localization:
|
||||
LoadLanguageSuccess: Successfully loaded language file en-us
|
||||
LoadLanguageSuccess: Successfully loaded language file zh-cn
|
||||
LoadLanguageFailed: 'Failed to load language file: %s'
|
||||
LanguageFileNotFound: Language file %s not found, using default zh-cn.
|
||||
Utils:
|
||||
@ -686,41 +701,41 @@ Utils:
|
||||
DownloadPage: 'Download page: %s'
|
||||
CurrentVersion: 'You are currently on the latest version: %s'
|
||||
GetUpdateFailed: 'Failed to get updates: %s'
|
||||
NewVersionConsole: 'New version found: %s . Check the console for details or click the link below'
|
||||
VaultNotAvailable: Vault not available.
|
||||
VaultUnlockedNotAvailable: VaultUnlocked not available.
|
||||
NoEconomyPlugin: No available economy plugin.
|
||||
NewVersionConsole: 'New version found: %s Check the console for details or click the link below'
|
||||
VaultNotAvailable: Vault not available
|
||||
VaultUnlockedNotAvailable: VaultUnlocked not available
|
||||
NoEconomyPlugin: No available economy plugin
|
||||
TUI:
|
||||
Navigation: NAV
|
||||
Navigation: Navigation
|
||||
NoContent: Uh oh, there’s no content here ~
|
||||
PageError: PAGE ERROR
|
||||
Add: ADD
|
||||
Sub: SUB
|
||||
PreviousPage: '<'
|
||||
NextPage: '>'
|
||||
PageError: Page error
|
||||
Add: Add
|
||||
Sub: Subtract
|
||||
PreviousPage: Previous page
|
||||
NextPage: Next page
|
||||
PageL: 'Page '
|
||||
PageR: ' '
|
||||
PageR: ' pages '
|
||||
CUI:
|
||||
Input: Please Type Below
|
||||
InputBox: Text here...
|
||||
NotAvailable: CUI TextInput functionality is not available on non-Paper servers, please use commands to perform operations.
|
||||
SuggestCommand: 'Suggestion: %s'
|
||||
LeftRightClick: 'L-Click: Confirm, R-Click: Cancel'
|
||||
NoSpace: No spaces allowed.
|
||||
Input: Please enter
|
||||
InputBox: Input box
|
||||
NotAvailable: CUI TextInput functionality is not available on non-Paper servers, please use commands to perform corresponding operations.
|
||||
SuggestCommand: 'Suggested command: %s'
|
||||
LeftRightClick: Left-click to confirm | Right-click to cancel
|
||||
NoSpace: Input cannot contain spaces
|
||||
Database:
|
||||
Connecting: Connecting to %s database...
|
||||
Connecting: Connecting to %s database
|
||||
UnsupportedType: 'Unsupported database type: '
|
||||
ConnectionFailed: 'Database connection failed: '
|
||||
ConnectionSuccess: Database connection successful!
|
||||
Reconnecting: Trying to reconnect to the database...
|
||||
ReconnectionSuccess: Database reconnection successful!
|
||||
ReconnectionFailed: Database reconnection failed!
|
||||
ErrorTitle: '=== CRITICAL DATABASE ERROR ==='
|
||||
ReconnectionUnexpected: Database connection unexpectedly closed, trying to reconnect...
|
||||
OperationAbort: Operation aborted!
|
||||
ConnectionSuccess: Database connection successful
|
||||
Reconnecting: Trying to reconnect to the database
|
||||
ReconnectionSuccess: Database reconnection successful
|
||||
ReconnectionFailed: Database reconnection failed
|
||||
ErrorTitle: '=== Critical error ==='
|
||||
ReconnectionUnexpected: Database connection unexpectedly closed, trying to reconnect
|
||||
OperationAbort: Operation aborted
|
||||
OperationFailed: 'Database operation failed: '
|
||||
Closing: Closing database connection...
|
||||
Closed: Database connection closed.
|
||||
Closing: Closing database connection
|
||||
Closed: Database connection closed
|
||||
CloseFailed: 'Failed to close database connection: '
|
||||
CheckColumnFailed: Failed to check if column exists.
|
||||
CheckTableFailed: Failed to check if table exists.
|
||||
CheckColumnFailed: Failed to check if column exists
|
||||
CheckTableFailed: Failed to check if table exists
|
||||
|
@ -75,6 +75,19 @@ Commands:
|
||||
ExportedMCAList: '%s に MCA ファイルのリストがエクスポートされました'
|
||||
ReloadingConfig: 設定ファイルを再読み込みしています...
|
||||
ReloadedConfig: 設定ファイルが再読み込みされました
|
||||
SetConfig:
|
||||
MinYShouldBeLessThanMaxY: 最高Y座標制限は最低Y座標制限より小さくすることはできません
|
||||
MaxYShouldBeGreaterThanMinY: 最低Y座標制限は最高Y座標制限より大きくすることはできません
|
||||
SizeXShouldBeGreaterThan4: X軸(東西)の最大サイズは4未満にできません
|
||||
SizeZShouldBeGreaterThan4: Z軸(南北)の最大サイズは4未満にできません
|
||||
SizeYShouldBeGreaterThan4: Y軸(垂直)の最大サイズは4未満にできません
|
||||
AmountShouldBeGreaterThan0: 各プレイヤーの領地数制限は0未満にすることはできません
|
||||
DepthShouldBeGreaterThan0: 領地の深さ制限は0未満にすることはできません
|
||||
TpDelayShouldBeGreaterThan0: テレポート遅延は0未満にすることはできません
|
||||
TpCoolDownShouldBeGreaterThan0: テレポートクールダウンは0未満にすることはできません
|
||||
PriceShouldBeGreaterThan0: 各ブロック単価は0未満にすることはできません
|
||||
RefundShouldBeGreaterThan0: 領地の返金率は0未満にすることはできません
|
||||
SpawnProtectRadiusShouldBeGreaterThan0: スポーンポイント保護半径は0以下にはできません
|
||||
Template:
|
||||
CreateTemplateUsage: '使い方: /dominion template create <テンプレート名>'
|
||||
DeleteTemplateUsage: '使い方: /dominion template delete <テンプレート名>'
|
||||
@ -286,6 +299,8 @@ TUI:
|
||||
MigrateDescription: あなたの領地をResidenceからDominionに移行します
|
||||
AllDominionButton: すべての領地
|
||||
AllDominionDescription: すべての領地を表示
|
||||
ConfigButton: システム設定
|
||||
ConfigDescription: システム設定を表示/変更
|
||||
ReloadCacheButton: キャッシュをリロード
|
||||
ReloadCacheDescription: 手動でキャッシュをリロードすると、一部のプレイヤー操作が無効になる問題を解決できます。ただし頻繁に行うことは推奨されません
|
||||
ReloadConfigButton: 設定をリロード
|
||||
@ -675,7 +690,7 @@ Flags:
|
||||
DisplayName: ウィザー生成
|
||||
Description: 死にゆくもの生成および死にゆくもの生成時に発生する爆発
|
||||
Localization:
|
||||
LoadLanguageSuccess: 言語ファイル ja-jp を正常にロードしました
|
||||
LoadLanguageSuccess: 言語ファイル zh-cn を正常にロードしました
|
||||
LoadLanguageFailed: 言語ファイルのロードに失敗しました:%s
|
||||
LanguageFileNotFound: 言語ファイル %s が見つかりませんでした。デフォルトの zh-cn を使用します。
|
||||
Utils:
|
||||
|
@ -1,727 +0,0 @@
|
||||
# Help us to translate this file into your language.
|
||||
# Guide: https://github.com/ColdeZhang/Dominion/blob/master/CONTRIBUTING.md#translate-plugin-messages-
|
||||
# Don't forget to leave your name here, so that we can give you credit for your translation.
|
||||
# Translated by: cygbs
|
||||
|
||||
Commands:
|
||||
Dominion:
|
||||
SetFlagUsage: '用法: /dominion set <权限名称> <true/false> [领地名称]'
|
||||
CreateDominionUsage: '用法: /dominion create <领地名称>'
|
||||
CreateSelectPointsFirst: 恳请君上启用之以供御疆,命曰“/dominion auto_create <领地名称>”,由此创生自动之领地。
|
||||
CreateSubDominionUsage: '用法: /dominion create_sub <子领地名称> [父领地名称]'
|
||||
CreateSubSelectPointsFirst: 欲先定界子领地,可择工具以标对角线之两点,界定其范围;或借由指令“/dominion auto_create_sub <子领地名称> [父领地名称]”自动生成子领地,并指定其父领地,以明其属。
|
||||
AutoCreateDominionUsage: '用法: /dominion auto_create <领地名称>'
|
||||
AutoCreateSubDominionUsage: '用法: /dominion auto_create_sub <子领地名称> [父领地名称]'
|
||||
AutoCreateDominionDisabled: 自动辟地之功能已闭。
|
||||
ExpandDominionUsage: '用法: /dominion expand [大小] [领地名称]'
|
||||
ContractDominionUsage: '用法: /dominion contract [大小] [领地名称]'
|
||||
SizeShouldBeInteger: 若论领地之大小,理应为整数所量。盖因尺寸度量,非可细至毫厘,必以整数计之,方能明晰无误,便于管理也。
|
||||
SizeShouldBePositive: 若论领地之广袤,理当超越零数,必为正整数所限。盖零者,无物之象,而领地则需实体之域,方能立足于世,故大小之设,必大于零,方合情理。
|
||||
DeleteDominionUsage: '用法: /dominion delete <领地名称>'
|
||||
SetEnterMessageUsage: '用法: /dominion set_enter_msg <提示语> [领地名称]'
|
||||
SetLeaveMessageUsage: '用法: /dominion set_leave_msg <提示语> [领地名称]'
|
||||
SetTpLocationUsage: '用法: /dominion set_tp_location [领地名称]'
|
||||
RenameDominionUsage: '用法: /dominion rename <原领地名称> <新领地名称>'
|
||||
GiveDominionUsage: '用法: /dominion give <领地名称> <玩家名称>'
|
||||
TpDominionUsage: '用法: /dominion tp <领地名称>'
|
||||
DominionNotExist: 领地尚不存矣!
|
||||
SetMapColorUsage: '用法: /dominion set_map_color <颜色> [领地名称]'
|
||||
Group:
|
||||
CreateGroupUsage: '用法: /dominion group create <领地名称> <权限组名称>'
|
||||
DeleteGroupUsage: '用法: /dominion group delete <领地名称> <权限组名称>'
|
||||
RenameGroupUsage: '用法: /dominion group rename <领地名称> <权限组旧名称> <新名称>'
|
||||
SetGroupFlagUsage: '用法: /dominion group set_flag <领地名称> <权限组名称> <权限名称> <true|false>'
|
||||
AddGroupMemberUsage: '用法: /dominion group add_member <领地名称> <权限组名称> <玩家名称>'
|
||||
RemoveGroupMemberUsage: '用法: /dominion group remove_member <领地名称> <权限组名称> <玩家名称>'
|
||||
GroupUsage: '用法: /dominion group <create|delete|rename|set_flag|add_member|remove_member|select_member|setting|list>'
|
||||
NewGroupName: 新权柄之组名
|
||||
Member:
|
||||
DominionAddMemberUsage: '用法: /dominion member add <领地名称> <玩家名称>'
|
||||
DominionSetFlagUsage: '用法: /dominion member set_flag <领地名称> <玩家名称> <权限名称> <true/false>'
|
||||
DominionRemoveMemberUsage: '用法: /dominion member remove <领地名称> <玩家名称>'
|
||||
DominionApplyTemplateUsage: '用法: /dominion member apply_template <领地名称> <玩家名称> <模板名称>'
|
||||
MemberUsage: '用法: /dominion member <add/set_flag/remove/apply_template/list/setting/select_player/select_template>'
|
||||
PageOptional: 页(可择)
|
||||
ArgumentsNotEnough: 参数未足
|
||||
UnknownArgument: 未知之参数
|
||||
SizeInteger: 大小(必为整数)
|
||||
DominionName: 领地名称
|
||||
SubDominionName: 子领地名称
|
||||
EnterMessageContent: 入而示语曰……
|
||||
LeaveMessageContent: 出而示语曰……
|
||||
InputColor: 绘色以十六进位之码输入之
|
||||
NewDominionName: 新领地名称
|
||||
Residence:
|
||||
MigrationDisabled: Residence 迁移功能未启
|
||||
MigrateUsage: '用法: /dominion migrate <res领地名称>'
|
||||
NoMigrationData: 汝无数据可徙也
|
||||
NoResidenceDominion: 未寻得所指定之“Residence”领地
|
||||
ResidenceNotOwner: 汝非此领地之主,故不能徙之
|
||||
MigrateFailed: '迁移失败: %s'
|
||||
MigrateSuccess: 领地 %s 已从 Residence 迁移至 Dominion
|
||||
Operator:
|
||||
ReloadingDominionCache: 正自库中重载领地之缓存……
|
||||
ReloadedDominionCache: 领地之缓存已重载
|
||||
ReloadingPrivilegeCache: 正自库中重载玩家权限之缓存……
|
||||
ReloadedPrivilegeCache: 玩家权限之缓存已重载
|
||||
ReloadingGroupCache: 正自库中重载权限组之缓存……
|
||||
ReloadedGroupCache: 权限组之缓存已重载
|
||||
ExportingMCAList: 正导出领地所属之MCA文件名录……
|
||||
CreateExportFolderFailed: 创建导出之文件夹未果
|
||||
ExportingMCAListForWorld: 正导出 %s 之MCA文件名录……
|
||||
DeleteMCAListFailed: 删除 %s 之MCA文件名录未果
|
||||
CreateMCAListFailed: 创建 %s 之MCA文件名录未果
|
||||
WriteMCAListFailed: 写入 %s 未果
|
||||
ExportMCAListFailed: 导出 %s 之MCA文件名录未果
|
||||
ExportedMCAList: MCA文件名录已导出至 %s
|
||||
ReloadingConfig: 正重新加载配置文件……
|
||||
ReloadedConfig: 配置文件已重新加载
|
||||
Template:
|
||||
CreateTemplateUsage: '用法: /dominion template create <模板名称>'
|
||||
DeleteTemplateUsage: '用法: /dominion template delete <模板名称>'
|
||||
SetTemplateFlagUsage: '用法: /dominion template set_flag <模板名称> <权限名称> <true/false>'
|
||||
TemplateUsage: '用法: /dominion template <list|setting|delete|create|set_flag>'
|
||||
NewTemplateName: 新模板名称
|
||||
Title:
|
||||
UseTitleUsage: '用法: /dominion use_title <权限组ID>'
|
||||
RemoveTitleSuccess: 成功卸下权限组之称号
|
||||
GroupNotExist: 权限组未存于世
|
||||
GroupDominionNotExist: 权限组 %s 所属之领地,未寻得也
|
||||
NotDominionMember: 君非领地 %s 之成员,故无法使用其称号
|
||||
NotGroupMember: 君非权限组 %s 之成员,故无法使用其称号
|
||||
UseTitleSuccess: 成功使用权限组 %s 之称号
|
||||
UseTitleFailed: 使用称号未果:%s
|
||||
Messages:
|
||||
OpBypassTpLimit: 君乃OP,故领地传送之限,可无视之
|
||||
WorldNotExist: 领地所在之世界,未寻得也
|
||||
NoTpLocation: 领地 %s 未设传送点,将尝试传送至其中心
|
||||
TpLocationNotInside: 领地 %s 之传送点,不在领地之内,将尝试传送至中心
|
||||
TpToDominion: 已将君传送至 %s
|
||||
TpDisabled: 管理员未启领地传送之功能
|
||||
DominionNoTp: 此领地,传送禁止
|
||||
GroupNoTp: 君之权限组,不得传送至此领地
|
||||
PrivilegeNoTp: 君不得传送至此领地
|
||||
TpCoolDown: 请待 %d 秒后再行传送
|
||||
TpDelay: 传送将于 %d 秒后执行
|
||||
TpCountDown: 传送倒计时 %d 秒
|
||||
TpFailed: 传送未果,请再试之
|
||||
CreateDominionFailed: 创建领地未果
|
||||
CreateDominionSuccess: 成功创建领地 %s
|
||||
DominionNameShouldNotEmpty: 领地之名,不可为空
|
||||
DominionNameInvalid: 领地之名,不得含空格或点
|
||||
DominionNameExist: 领地之名 %s,已存于世
|
||||
SelectPointsWorldNotSame: 两选点所在世界,不相一致
|
||||
CreateDominionDisabledWorld: 世界 %s,禁止创建领地
|
||||
DominionAmountLimit: 君之领地数量,已达上限(%d个)
|
||||
ParentDominionNotExist: 父领地 %s,未寻得也
|
||||
RootDominionLost: 根领地已失!
|
||||
NotParentDominionOwner: 君非父领地 %s 之主,故无法创建子领地
|
||||
ParentDominionNotInSameWorld: 父领地与子领地,不在同一世界
|
||||
OutOfParentDominionRange: 已超出父领地 %s 之范围
|
||||
ConflictWithSpawnProtect: 与出生点保护相冲突
|
||||
ConflictWithDominion: 与领地 %s 相冲突
|
||||
DatabaseError: 数据库出错,请联络管理员
|
||||
CannotGetDominionAuto: 无法自动获取君之所在领地,请指定其名
|
||||
ExpandDominionFailed: 扩展领地未果
|
||||
DominionWorldLost: 领地所在之世界已失
|
||||
ParentDominionLost: 父领地已失
|
||||
ExpandDominionSuccess: 成功扩展领地 %s %d 格
|
||||
ContractDominionFailed: 缩小领地未果
|
||||
ContractDominionConflict: 缩小后之领地,无法包含子领地 %s
|
||||
ContractDominionSuccess: 成功缩小领地 %s %d 格
|
||||
DeleteDominionFailed: 删除领地未果
|
||||
DeleteDominionSuccess: 领地%s及其所有子领地,已删除
|
||||
DeleteDominionConfirm: 删除领地%s将同时删除其所有子领地,是否继续?
|
||||
DeleteDominionForceConfirm: 请输入 /dominion delete %s force 以确认删除
|
||||
SetEnterMessageSuccess: 成功设置领地 %s 之进入消息
|
||||
SetLeaveMessageSuccess: 成功设置领地 %s 之离开消息
|
||||
SetTpLocationFailed: 设置领地传送点未果
|
||||
DominionNotExist: 领地 %s,未寻得也
|
||||
DominionWorldNotExist: 领地所在之世界,未寻得也
|
||||
SetTpLocationSuccess: 成功设置领地 %s 之传送点于 %d %d %d
|
||||
TpLocationNotInDominion: 传送点不在领地 %s 之内
|
||||
RenameDominionFailed: 重命名领地未果
|
||||
RenameDominionSameName: 新旧名称相同,无需更改
|
||||
RenameDominionSuccess: 成功将领地 %s 重命名为 %s
|
||||
GiveDominionFailed: 转让领地未果
|
||||
PlayerNotExist: 玩家 %s 不存在或未曾登录
|
||||
DominionAlreadyBelong: 领地 %s 已属 %s,无需再转
|
||||
SubDominionCannotGive: 子领地无法转让,可将 %s 设为管理员以管理领地%s
|
||||
GiveDominionConfirm: 转让领地 %s 给 %s 将同时转让其所有子领地,是否继续?
|
||||
GiveDominionForceConfirm: 请输入 /dominion give %s %s force 以确认转让
|
||||
GiveDominionSuccess: 成功将领地 %s 及其所有子领地转让给 %s
|
||||
SetMapColorFailed: 设置领地地图颜色未果
|
||||
MapColorInvalid: 色彩之式不合
|
||||
SetMapColorSuccess: 已设领地 %s 之卫星图色为 %s
|
||||
SizeInvalid: 尺寸非法
|
||||
SizeShouldBeGreaterThan4: 领地任一边长不得小于四
|
||||
SizeXShouldBeLessThan: 领地X向(东西)之长不得过 %d
|
||||
SizeYShouldBeLessThan: 领地Y向(上下)之高不得过 %d
|
||||
SizeZShouldBeLessThan: 领地Z向(南北)之长不得过 %d
|
||||
MaxYShouldBeLessThan: 领地Y标之上限不得过 %d
|
||||
MinYShouldBeLessThan: 领地Y标之下限不得过 %d
|
||||
DepthInvalid: 子领地之深非法
|
||||
CreateSubDominionDisabled: 不许创子领地
|
||||
DepthShouldBeLessThan: 子领地嵌套之深不得过 %d
|
||||
NotDominionOwner: 非领地 %s 之主
|
||||
NoEconomyPlugin: 无经济插件可用,请联服主
|
||||
OpBypassEconomyCheck: 君为OP,已略经济之检
|
||||
NotEnoughMoney: 囊中羞涩,尚需 %.2f%s
|
||||
ChargeMoney: 已扣 %.2f%s
|
||||
RefundMoney: 已还 %.2f%s
|
||||
CannotGetLocation: 无法知君之所在
|
||||
CrossWorldOperationDisallowed: 禁跨世界之操作
|
||||
NotInDominion: 君不在领地 %s 内,无法行此操作
|
||||
CannotGetDirection: 无法知君所向
|
||||
InvalidDirection: 所向非法 %s
|
||||
ContractSizeInvalid: 领地缩小后之尺寸非法
|
||||
SubDominionList: (子领地:%s)
|
||||
SetDominionFlagSuccess: 已设领地权限 %s 为 %s
|
||||
UnknownFlag: 未知之权限 %s
|
||||
PageNoPermission: 君无权访此页
|
||||
CreateGroupFailed: 创建权限组 %s 失败
|
||||
CreateGroupSuccess: 创建权限组 %s 成功
|
||||
GroupNameInvalid: 权限组名不得含空
|
||||
GroupNameExist: 领地 %s 已有名为 %s 之权限组
|
||||
DeleteGroupFailed: 删除权限组 %s 失败
|
||||
DeleteGroupSuccess: 删除权限组 %s 成功
|
||||
GroupNotExist: 领地 %s 无名为 %s 之权限组
|
||||
SetGroupFlagFailed: 设权限组 %s 之权限 %s 为 %s 失败
|
||||
SetGroupFlagSuccess: 设权限组 %s 之权限 %s 为 %s 成功
|
||||
NotDominionOwnerForGroup: 非领地 %s 之主,无法改管理员权限组之权限
|
||||
RenameGroupFailed: 重命名权限组 %s 为 %s 失败
|
||||
RenameGroupSuccess: 重命名权限组 %s 为 %s 成功
|
||||
AddGroupMemberFailed: 添成员 %s 至权限组 %s 失败
|
||||
AddGroupMemberSuccess: 添成员 %s 至权限组 %s 成功
|
||||
NoPermissionForGroupMember: 君无权改领地 %s 之权限组 %s 成员
|
||||
NotDominionOwnerForGroupMember: 非领地 %s 之主,无法添成员至管理员权限组
|
||||
PlayerNotDominionMember: 玩家 %s 非领地 %s 之成员,无法直入权限组
|
||||
PlayerAlreadyInGroup: 玩家 %s 已在权限组 %s 中
|
||||
PlayerIsOwnerForGroupMember: '%s 乃管理员,非领地 %s 之主,无法添管理员至权限组'
|
||||
RemoveGroupMemberFailed: 自权限组 %s 除成员 %s 失败
|
||||
RemoveGroupMemberSuccess: 自权限组 %s 除成员 %s 成功
|
||||
NoPermissionForRemoveGroupMember: 君无权自领地 %s 之权限组 %s 除成员
|
||||
NotDominionOwnerForRemoveGroupMember: 非领地 %s 之主,无法自管理员权限组除成员
|
||||
PlayerNotMember: 玩家 %s 非领地 %s 之成员
|
||||
PlayerNotInGroup: 玩家 %s 不在权限组 %s 中
|
||||
RemoveMemberFailed: 自领地 %s 除玩家 %s 失败
|
||||
RemoveMemberSuccess: 自领地 %s 除玩家 %s 成功
|
||||
SetMemberFlagFailed: 设玩家 %s 于领地 %s 之权限 %s 为 %s 失败
|
||||
SetMemberFlagSuccess: 设玩家 %s 于领地 %s 之权限 %s 为 %s 成功
|
||||
PlayerBelongToGroup: 玩家 %s 属 %s 权限组,无法单设权限
|
||||
AddMemberFailed: 添玩家 %s 至领地成员 %s 失败
|
||||
AddMemberSuccess: 添玩家 %s 至领地成员 %s 成功
|
||||
PlayerAlreadyMember: 玩家 %s 已是领地 %s 之成员
|
||||
ApplyTemplateSuccess: 应用模板 %s 到玩家 %s 在领地 %s 的权限成功
|
||||
ApplyTemplateFailed: 应用模板 %s 到玩家 %s 在领地 %s 的权限失败
|
||||
TemplateNotExist: 模板 %s 不存在
|
||||
NotDominionOwnerForRemoveAdmin: 你不是领地 %s 的拥有者,无法移除一个领地管理员
|
||||
NotDominionOwnerForSetAdmin: 你不是领地 %s 的拥有者,无法修改其他玩家管理员的权限
|
||||
OwnerCannotBeMember: 玩家 %s 是领地 %s 的拥有者,不可以被添加为成员
|
||||
CreateTemplateSuccess: 创建模板 %s 成功
|
||||
CreateTemplateFailed: 创建模板 %s 失败
|
||||
TemplateNameInvalid: 模板名称不能包含空格
|
||||
TemplateNameExist: 已经存在名为 %s 的权限模板
|
||||
DeleteTemplateSuccess: 删除模板 %s 成功
|
||||
DeleteTemplateFailed: 删除模板 %s 失败
|
||||
SetTemplateFlagSuccess: 设置模板 %s 的权限 %s 为 %s 成功
|
||||
SetTemplateFlagFailed: 设置模板 %s 的权限 %s 为 %s 失败
|
||||
CommandPlayerOnly: 该命令只能由玩家执行
|
||||
NoPermission: 你没有 %s 权限执行此命令
|
||||
NotDominionOwnerOrAdmin: 你不是领地 %s 的拥有者或管理员,无权修改权限
|
||||
InSubDominion: 你当前在子领地内,请指定要操作的领地名称
|
||||
NoPermissionForFlag: 你没有 %s (%s) 权限
|
||||
BlueMapConnectFailed: 无法连接 BlueMap 插件,如果你不打算使用卫星地图渲染建议前往配置文件关闭此功能以避免下方的报错
|
||||
DynmapRegisterSuccess: Dynmap 成功注册
|
||||
DynmapConnectFailed: 无法连接到 Dynmap,如果你不打算使用卫星地图渲染建议前往配置文件关闭此功能
|
||||
PlaceholderAPINotFound: 未找到 PlaceholderAPI 插件,无法使用权限组称号功能,已自动关闭
|
||||
PluginEnabled: 领地插件已启动
|
||||
PluginVersion: 版本:%s
|
||||
PlaceholderAPIRegisterSuccess: 成功注册 PlaceholderAPI 扩展
|
||||
LoadedGroupAmount: 共加载了 %d 个领地组
|
||||
AutoCleanStart: 开始自动清理长时间未登录玩家领地数据
|
||||
AutoCleanPlayer: 已清理玩家 %s 的领地数据
|
||||
AutoCleanEnd: 自动清理完成
|
||||
MapInfoDetail: <div>%s</div><div>所有人:%s</div>
|
||||
TUI:
|
||||
NotDominionOwnerOrAdminForPage: 你不是领地 %s 的拥有者或管理员,无权访问此页面
|
||||
CommandHelp:
|
||||
Title: 领地插件命令帮助
|
||||
SubTitle: <>者必需 []者可选
|
||||
Navigation:
|
||||
Menu: 主菜单
|
||||
DominionList: 我的领地
|
||||
Manage: 管理界面
|
||||
EnvSetting: 环境设置
|
||||
GuestSetting: 访客权限
|
||||
MemberList: 成员列表
|
||||
MemberSetting: 成员权限
|
||||
GroupList: 权限组列表
|
||||
GroupSetting: 权限组管理
|
||||
AllDominion: 所有领地
|
||||
TemplateList: 模板列表
|
||||
TemplateSetting: 模板管理
|
||||
MigrateList: Res数据列表
|
||||
TitleList: 权限组称号列表
|
||||
ManageButton: 管理
|
||||
DeleteButton: 删除
|
||||
SearchButton: 搜索
|
||||
BackButton: 返回
|
||||
SelectButton: 选择
|
||||
EditButton: 编辑
|
||||
Menu:
|
||||
Title: Dominion 领地系统
|
||||
CreateDominionButton: 创建领地
|
||||
CreateDominionDescription: 以子为中心,自动创一新之领地
|
||||
MyDominionButton: 我的领地
|
||||
MyDominionDescription: 览我之领地列表
|
||||
TitleListButton: 称号列表
|
||||
TitleListDescription: 览/用权限组之称号
|
||||
TemplateListButton: 模板列表
|
||||
TemplateListDescription: 成员权限模板之列表
|
||||
CommandHelpButton: 指令帮助
|
||||
CommandHelpDescription: 览指令之列表
|
||||
DocumentButton: 使用文档
|
||||
DocumentDescription: 于浏览器中开使用之文档
|
||||
MigrateButton: 迁移数据
|
||||
MigrateDescription: 迁汝之领地从Residence至Dominion
|
||||
AllDominionButton: 所有领地
|
||||
AllDominionDescription: 览所有之领地
|
||||
ReloadCacheButton: 重载缓存
|
||||
ReloadCacheDescription: 手刷缓存可解一些玩家操作之无效问题,不建议频操
|
||||
ReloadConfigButton: 重载配置
|
||||
ReloadConfigDescription: 重载配置文件
|
||||
OpOnlySection: '--- 以下选项仅OP可见 ---'
|
||||
DominionList:
|
||||
Title: 我的领地列表
|
||||
AdminSection: '--- 以下为你拥有管理员权限的领地 ---'
|
||||
DominionManage:
|
||||
Title: 领地 %s 管理界面
|
||||
InfoButton: 详细信息
|
||||
InfoDescription: 览领地之详细
|
||||
EnvSettingButton: 环境设置
|
||||
EnvSettingDescription: 设领地内之环境行为
|
||||
GuestSettingButton: 访客权限
|
||||
GuestSettingDescription: 配访客于兹领地之权限
|
||||
MemberListButton: 成员管理
|
||||
MemberListDescription: 理此领地成员之权限
|
||||
GroupListButton: 权限组
|
||||
GroupListDescription: 理此领地之权限组
|
||||
SetTpLocationButton: 设置传送点
|
||||
SetTpLocationDescription: 设汝当前之位为此领地传送点
|
||||
RenameButton: 重命名
|
||||
RenameDescription: 更名领地
|
||||
EditJoinMessageButton: 编辑欢迎提示语
|
||||
EditJoinMessageDescription: 当玩家入领地时示之消息
|
||||
EditLeaveMessageButton: 编辑离开提示语
|
||||
EditLeaveMessageDescription: 当玩家离领地时示之消息
|
||||
SetMapColorButton: 设置地块颜色
|
||||
SetMapColorDescription: 设卫星图上之地块颜色
|
||||
NotInDominion: 汝不在任何领地之内,请指定领地之名 /dominion manage <领地名称>
|
||||
EnvSetting:
|
||||
Title: 领地 %s 环境设置
|
||||
Usage: '用法: /dominion env_setting <领地名称> [页码]'
|
||||
GuestSetting:
|
||||
Title: 领地 %s 访客权限
|
||||
Usage: '用法: /dominion guest_setting <领地名称> [页码]'
|
||||
SizeInfo:
|
||||
Title: 领地 %s 的尺寸信息
|
||||
Owner: 领地所有者:
|
||||
Size: 领地大小:
|
||||
Center: 中心坐标:
|
||||
Vertical: 垂直高度:
|
||||
VertY: Y轴坐标:
|
||||
Square: 水平面积:
|
||||
Volume: 领地体积:
|
||||
TpLocation: 传送点坐标:
|
||||
NoneTp: 无
|
||||
Usage: 汝不在任何领地之内,请指定领地之名 /dominion info <领地名称>
|
||||
MemberList:
|
||||
Title: 领地 %s 成员列表
|
||||
AddButton: 添加成员
|
||||
FlagButton: 权限
|
||||
FlagDescription: 配成员之权限
|
||||
RemoveButton: 移除
|
||||
RemoveDescription: 移此成员出(变为访客)
|
||||
NoPermissionSet: 汝非领地之主,不可编管理员之权限
|
||||
NoPermissionRemove: 汝非领地之主,不可除管理员
|
||||
BelongToGroup: 此成员属权限组 %s,不可独编其权限
|
||||
Usage: '用法: /dominion member list <领地名称> [页码]'
|
||||
AdminTag: 此乃管理员
|
||||
NormalTag: 此乃普通成员
|
||||
BlacklistTag: 此乃黑名单成员
|
||||
GroupTag: 此成员属一权限组
|
||||
MemberSetting:
|
||||
Title: 玩家 %s 于领地 %s 之权限置设
|
||||
ApplyTemplateButton: 套用模板
|
||||
ApplyTemplateDescription: 择一权限模板套用之
|
||||
Usage: '用法: /dominion member setting <领地名称> <玩家名称> [页码]'
|
||||
SelectPlayer:
|
||||
Title: 选择玩家添加为成员
|
||||
Description: 仅可选已登录之玩家
|
||||
Usage: '用法: /dominion member select_player <领地名称> [页码]'
|
||||
SelectTemplate:
|
||||
Title: 选择一个模板
|
||||
Description: 套用于领地 %s 之居者 %s
|
||||
Usage: '用法: /dominion member select_template <领地名称> <玩家名称> [页码]'
|
||||
GroupList:
|
||||
Title: 领地 %s 权限组列表
|
||||
CreateButton: 创建权限组
|
||||
CreateDescription: 创一新之权限组
|
||||
DeleteDescription: 删权限组 %s
|
||||
EditDescription: 编权限组 %s
|
||||
AddMemberDescription: 加成员至权限组 %s
|
||||
RemoveMemberDescription: 移 %s 出权限组 %s
|
||||
Usage: '用法: /dominion group list <领地名称> [页码]'
|
||||
GroupSetting:
|
||||
RenameButton: 重命名此权限组
|
||||
Usage: '用法: /dominion group setting <领地名称> <权限组名称> [页码]'
|
||||
TitleL: '权限组 '
|
||||
TitleR: ' 管理'
|
||||
RenameDescription: 重命名权限组 %s
|
||||
SelectMember:
|
||||
Title: 择居者
|
||||
Description: 选择居者添之于权限组 %s
|
||||
Usage: '用法: /dominion group select_member <领地名称> <权限组名称> [回显页码] [页码]'
|
||||
TemplateList:
|
||||
Title: 成员权限模板列表
|
||||
CreateButton: 创建成员权限模板
|
||||
CreateDescription: 创一新之成员权限模板
|
||||
TemplateSetting:
|
||||
Title: 模板 %s 权限管理
|
||||
Migrate:
|
||||
Title: 从 Residence 迁移数据
|
||||
NoData: 汝无数据可迁
|
||||
Button: 迁移
|
||||
SubDominion: 子领地不可手动迁移,将随父领地自动迁之
|
||||
TitleList:
|
||||
Title: 汝可用之权限组称号
|
||||
RemoveButton: 卸下
|
||||
ApplyButton: 用之
|
||||
FromDominion: 自领地:
|
||||
CUI:
|
||||
Input:
|
||||
CreateDominion: 输入欲创之领地名称
|
||||
CreateGroup: 输入欲创之权限组名称
|
||||
CreateTemplate: 输入欲创之模板名称
|
||||
EditEnterMessage: 编辑入领地之提示语内容
|
||||
EditLeaveMessage: 编辑离领地之提示语内容
|
||||
AddMember: 输入玩家名以加为成员
|
||||
RenameDominion: 领地更名
|
||||
RenameGroup: 权限组更名
|
||||
SetMapColor: 输入卫星图上地块之色(16进制)
|
||||
Config:
|
||||
Check:
|
||||
AutoCreateRadiusError: AutoCreateRadius 不能等于 0,已重置为 10
|
||||
AutoCleanAfterDaysError: AutoCleanAfterDays 不能等于 0,已重置为 180
|
||||
ToolNameError: 工具之名设误,已重置为 ARROW
|
||||
LimitSizeXError: Limit.SizeX 之尺寸不得小于 4,已重置为 128
|
||||
LimitSizeYError: Limit.SizeY 之尺寸不得小于 4,已重置为 64
|
||||
LimitSizeZError: Limit.SizeZ 之尺寸不得小于 4,已重置为 128
|
||||
LimitMinYError: Limit.MinY 不得大于或等于 Limit.MaxY,已重置为 -64 至 320
|
||||
RefundError: Economy.Refund 设不合法,已重置为 0.85
|
||||
PriceError: Economy.Price 设不合法,已重置为 10.0
|
||||
LimitSizeYAutoAdjust: 启 Limit.Vert 时 Limit.SizeY 不得小于 Limit.MaxY - Limit.MinY,已自动调为 %d
|
||||
AmountError: Limit.Amount 设不合法,已重置为 10
|
||||
DepthError: Limit.Depth 设不合法,已重置为 3
|
||||
GroupMinYError: 权限组 %s 之 MinY 不得大于或等于 MaxY,已重置为 -64 与 320
|
||||
GroupSizeXError: 权限组 %s 之 SizeX 设过小,已重置为 128
|
||||
GroupSizeYError: 权限组 %s 之 SizeY 设过小,已重置为 64
|
||||
GroupSizeZError: 权限组 %s 之 SizeZ 设过小,已重置为 128
|
||||
GroupAmountError: 权限组 %s 之 Amount 设不合法,已重置为 10
|
||||
GroupDepthError: 权限组 %s 之 Depth 设不合法,已重置为 3
|
||||
GroupPriceError: 权限组 %s 之 Price 设不合法,已重置为 10.0
|
||||
GroupRefundError: 权限组 %s 之 Refund 设不合法,已重置为 0.85
|
||||
LoadFlagError: 读权限配置败:%s
|
||||
TpDelayError: 传送延不得小于 0,已重置为 0
|
||||
TpCoolDownError: 传送冷却不得小于 0,已重置为 0
|
||||
Comment:
|
||||
Language: 语言设置,参 languages 文件夹下之名
|
||||
AutoCreateRadius: 自动创领地之半径,方为块
|
||||
NegativeOneDisabled: -1示不启
|
||||
DefaultLimit: 默玩家圈地之限
|
||||
SpawnProtectRadius: 出生点保护半径,出生点此范围内不允圈地
|
||||
MinY: 最小Y坐标
|
||||
MaxY: 最大Y坐标
|
||||
NegativeOneUnlimited: -1示不限
|
||||
SizeX: X向最大长
|
||||
SizeY: Y向最大长
|
||||
SizeZ: Z向最大长
|
||||
Amount: 最大领地数
|
||||
Depth: 子领地深度
|
||||
ZeroDisabled: 0示不启
|
||||
Vert: 是否自延至 MaxY 与 MinY
|
||||
OpBypass: 是否允OP无视领地限
|
||||
TpDelay: 传送延 秒
|
||||
TpCoolDown: 传送冷却 秒
|
||||
AutoCleanAfterDays: 自动清久未上线玩家之领地(天)
|
||||
ToolName: 圈地工具名
|
||||
Economy: 经济设
|
||||
VaultRequired: 需安 Vault 前置及插件
|
||||
Price: 圈地价格,方为块
|
||||
OnlyXZ: 是否只计xz平面积
|
||||
Refund: 删或缩领地时之退款比例
|
||||
FlyPermission: 飞行权限节点 - 有以下任一权限节点之玩家,不被本插件拦飞行
|
||||
ResidenceMigration: 是否允玩家从 Residence 迁领地数据
|
||||
GroupTitle: 权限组称 - 用权限组作称(需PlaceholderAPI插件)
|
||||
GroupTitleVariable: '变量: %dominion_group_title%'
|
||||
GroupTitleColor: 前后缀如需加色,请用此格 &#ffffff
|
||||
PerformanceTimer: 性能测计时器
|
||||
GroupLine1: '>---------------------------------<'
|
||||
GroupLine2: '| 圈地限制特殊权限组配置 |'
|
||||
GroupLine3: '>---------------------------------<'
|
||||
GroupLine4: 此文可为模,汝可复此文后重名之欲名
|
||||
GroupLine5: 权限组名,然后改其中之配。若欲给赞助玩家(或VIP)
|
||||
GroupLine6: 特惠,如少之圈地价、大之领地等,汝可
|
||||
GroupLine7: 此配。详说参以下链:
|
||||
GroupLine8DocumentAddress: '> https://dominion.lunadeer.cn/%s/operator/privilege.html'
|
||||
WorldSettings: 单设某世界之圈地规(如不设,则用以上规)
|
||||
Flags:
|
||||
admin:
|
||||
DisplayName: 管理员
|
||||
Description: 管理领地内的其他成员权限
|
||||
anchor:
|
||||
DisplayName: 重生锚
|
||||
Description: 是否允许设置/使用重生锚
|
||||
animal_killing:
|
||||
DisplayName: 对动物造成伤害
|
||||
Description: 是否允许对动物造成伤害
|
||||
animal_spawn:
|
||||
DisplayName: 动物生成(繁殖)
|
||||
Description: 是否允许动物生成(包括繁殖)
|
||||
animal_move:
|
||||
DisplayName: 动物移动
|
||||
Description: 是否允许动物在(向)领地内移动
|
||||
anvil:
|
||||
DisplayName: 使用铁砧
|
||||
Description: 是否允许使用铁砧
|
||||
beacon:
|
||||
DisplayName: 信标交互
|
||||
Description: 是否允许与信标交互
|
||||
bed:
|
||||
DisplayName: 床交互
|
||||
Description: 是否允许使用床睡觉或设置重生点
|
||||
brew:
|
||||
DisplayName: 使用酿造台
|
||||
Description: 是否可以使用酿造台
|
||||
break:
|
||||
DisplayName: 破坏方块
|
||||
Description: 是否可以破坏方块(包括:一般方块、展示框、盔甲架)
|
||||
button:
|
||||
DisplayName: 使用按钮
|
||||
Description: 是否可以使用各种材质的按钮
|
||||
cake:
|
||||
DisplayName: 吃蛋糕
|
||||
Description: 是否可以吃蛋糕
|
||||
container:
|
||||
DisplayName: 一般容器
|
||||
Description: 包含:箱子/木桶/潜影盒/盔甲架/展示框
|
||||
craft:
|
||||
DisplayName: 使用工作台
|
||||
Description: 是否可以使用工作台
|
||||
crafter:
|
||||
DisplayName: 合成器
|
||||
Description: 是否可以修改自动合成器
|
||||
creeper_explode:
|
||||
DisplayName: 生物破坏/非TNT爆炸
|
||||
Description: 包含:苦力怕/凋零头颅/末影水晶/火球/床/重生锚爆炸等
|
||||
comparer:
|
||||
DisplayName: 比较器交互
|
||||
Description: 是否可以修改比较器状态
|
||||
door:
|
||||
DisplayName: 门交互
|
||||
Description: 是否可以使用各种材质的门(包括活板门)
|
||||
dragon_break_block:
|
||||
DisplayName: 末影龙破坏方块
|
||||
Description: 末影龙冲撞是否可以破坏方块
|
||||
dragon_egg:
|
||||
DisplayName: 触碰龙蛋
|
||||
Description: 是否可以触碰龙蛋
|
||||
dye:
|
||||
DisplayName: 染色
|
||||
Description: 是否可以使用染料(对羊、狗项圈、猫项圈)染色
|
||||
edit_sign:
|
||||
DisplayName: 编辑告示牌
|
||||
Description: 是否可以编辑告示牌
|
||||
egg:
|
||||
DisplayName: 扔鸡蛋
|
||||
Description: 是否可以扔鸡蛋
|
||||
enchant:
|
||||
DisplayName: 使用附魔台
|
||||
Description: 是否可以使用附魔台
|
||||
ender_man:
|
||||
DisplayName: 末影人行为
|
||||
Description: 包含:末影人是否可以生成、瞬移
|
||||
ender_pearl:
|
||||
DisplayName: 投掷末影珍珠
|
||||
Description: 是否可以使用末影珍珠
|
||||
feed:
|
||||
DisplayName: 喂养动物
|
||||
Description: 是否可以喂养动物
|
||||
fire_spread:
|
||||
DisplayName: 火焰蔓延
|
||||
Description: 是否可以火焰蔓延
|
||||
flow_in_protection:
|
||||
DisplayName: 外部流体是否可以进入
|
||||
Description: 包含:岩浆、水(不会阻止领地内部的流体蔓延)
|
||||
fly:
|
||||
DisplayName: 飞行
|
||||
Description: 不是翅鞘飞行,是类似于创造模式的飞行
|
||||
glow:
|
||||
DisplayName: 玩家发光
|
||||
Description: 类似光灵箭的高亮效果
|
||||
harvest:
|
||||
DisplayName: 收获
|
||||
Description: 收获庄稼、作物
|
||||
honey:
|
||||
DisplayName: 蜂巢交互
|
||||
Description: 是否可以采蜂蜜
|
||||
hook:
|
||||
DisplayName: 使用钓钩
|
||||
Description: 是否可以使用钓钩
|
||||
hopper:
|
||||
DisplayName: 特殊容器
|
||||
Description: 包含:漏斗/熔炉/发射器/投掷器/高炉/烟熏炉
|
||||
hopper_outside:
|
||||
DisplayName: 领地外漏斗对领地内箱子是否生效
|
||||
Description: 领地外的漏斗是否可以对领地内的箱子生效
|
||||
ignite:
|
||||
DisplayName: 点燃
|
||||
Description: 是否可以使用打火石点火
|
||||
item_frame_interactive:
|
||||
DisplayName: 展示框交互
|
||||
Description: 是否可以与物品展示框交互(旋转展示框的东西)
|
||||
item_frame_proj_damage:
|
||||
DisplayName: 投掷物是否可以破坏展示框/画
|
||||
Description: 非玩家发出的投掷物是否可以破坏展示框/画等悬挂物
|
||||
lever:
|
||||
DisplayName: 使用拉杆
|
||||
Description: 是否可以使用拉杆
|
||||
mob_drop_item:
|
||||
DisplayName: 生物战利品掉落
|
||||
Description: 生物死亡时是否产生掉落物
|
||||
monster_killing:
|
||||
DisplayName: 对怪物造成伤害
|
||||
Description: 玩家是否可以对怪物造成伤害
|
||||
monster_spawn:
|
||||
DisplayName: 怪物生成
|
||||
Description: 是否可以生成怪物
|
||||
monster_move:
|
||||
DisplayName: 怪物移动
|
||||
Description: 是否可以在(向)领地内移动
|
||||
move:
|
||||
DisplayName: 移动
|
||||
Description: 是否可以移动
|
||||
note_block:
|
||||
DisplayName: 点击音符盒
|
||||
Description: 红石音乐或者某些红石机器会用到...
|
||||
place:
|
||||
DisplayName: 放置方块
|
||||
Description: 是否可以放置方块(包括:一般方块、展示框、岩浆、水)
|
||||
piston_outside:
|
||||
DisplayName: 活塞是否可以跨领地推动方块
|
||||
Description: 活塞是否可以往领地内推东西或推东西到领地外
|
||||
pressure:
|
||||
DisplayName: 压力板交互
|
||||
Description: 是否可以触发各种材质的压力板
|
||||
riding:
|
||||
DisplayName: 骑乘载具
|
||||
Description: 是否可以骑乘各种载具
|
||||
repeater:
|
||||
DisplayName: 中继器交互
|
||||
Description: 是否可以与中继器交互
|
||||
shear:
|
||||
DisplayName: 剪羊毛
|
||||
Description: 是否可以剪羊毛
|
||||
shoot:
|
||||
DisplayName: 投掷型武器
|
||||
Description: 包括:射箭/雪球/三叉戟/风弹
|
||||
show_border:
|
||||
DisplayName: 显示领地边界
|
||||
Description: 是否显示领地边界
|
||||
teleport:
|
||||
DisplayName: 领地传送
|
||||
Description: 是否开启领地传送
|
||||
tnt_explode:
|
||||
DisplayName: TNT爆炸
|
||||
Description: TNT是否可以爆炸
|
||||
trade:
|
||||
DisplayName: 村民交易
|
||||
Description: 是否可以与村民交易
|
||||
trample:
|
||||
DisplayName: 作物践踏
|
||||
Description: 是否可以践踏作物(关闭意味着保护耕地)
|
||||
trig_pressure_proj:
|
||||
DisplayName: 投掷物触发压力板
|
||||
Description: 投掷物(箭/风弹/雪球)是否可以触发压力板
|
||||
trig_pressure_mob:
|
||||
DisplayName: 生物触发压力板
|
||||
Description: 生物(不包含玩家)是否可以触发压力板
|
||||
trig_pressure_drop:
|
||||
DisplayName: 掉落物触发压力板
|
||||
Description: 掉落物是否可以触发压力板
|
||||
vehicle_destroy:
|
||||
DisplayName: 破坏载具
|
||||
Description: 是否可以破坏载具(主要是矿车)
|
||||
vehicle_spawn:
|
||||
DisplayName: 生成载具
|
||||
Description: 是否可以生成载具(主要是矿车)
|
||||
villager_killing:
|
||||
DisplayName: 对村民造成伤害
|
||||
Description: 是否可以对村民造成伤害
|
||||
villager_spawn:
|
||||
DisplayName: 村民繁殖
|
||||
Description: 是否允许村民繁殖(包括村民蛋)
|
||||
wither_spawn:
|
||||
DisplayName: 凋零生成
|
||||
Description: 凋零生成以及凋零生成时产生的爆炸
|
||||
Localization:
|
||||
LoadLanguageSuccess: 成功载之语言 zh-cn
|
||||
LoadLanguageFailed: 未能载入之:%s
|
||||
LanguageFileNotFound: Language file %s not found, using default lzh.
|
||||
Utils:
|
||||
TeleportUnsafe: 传送所向之地不安,已罢传送
|
||||
CheckingUpdate: 正稽察更新中...
|
||||
NewVersion: 新版见矣:%s
|
||||
VersionInfo: 版本之资讯:
|
||||
DownloadPage: 下载之页:%s
|
||||
CurrentVersion: 当前已是版之至新:%s
|
||||
GetUpdateFailed: '更新之取不得: %s'
|
||||
NewVersionConsole: 新版见矣:%s 欲知详情,请视控制台或点下方之链
|
||||
VaultNotAvailable: Vault 不可用
|
||||
VaultUnlockedNotAvailable: VaultUnlocked 不可用
|
||||
NoEconomyPlugin: 无可用之经济插件
|
||||
TUI:
|
||||
Navigation: 導航
|
||||
NoContent: 嗟乎,此處尚無內容~
|
||||
PageError: 頁碼有誤
|
||||
Add: 增
|
||||
Sub: 減
|
||||
PreviousPage: 上一頁
|
||||
NextPage: 下一頁
|
||||
PageL: '第 '
|
||||
PageR: ' 頁 '
|
||||
CUI:
|
||||
Input: 請輸入
|
||||
InputBox: 輸入框
|
||||
NotAvailable: CUI TextInput 功能於非 Paper 系服務端上不得用,請用指令行其事。
|
||||
SuggestCommand: '參考指令: %s'
|
||||
LeftRightClick: 左鍵確認 | 右鍵取消
|
||||
NoSpace: 輸入內容切忌空格
|
||||
Database:
|
||||
Connecting: 正在連接到 %s 數據庫
|
||||
UnsupportedType: '不支持之數據庫類型: '
|
||||
ConnectionFailed: '數據庫連接不果: '
|
||||
ConnectionSuccess: 數據庫連接已就
|
||||
Reconnecting: 正試再連數據庫
|
||||
ReconnectionSuccess: 再連數據庫成
|
||||
ReconnectionFailed: 再連數據庫敗
|
||||
ErrorTitle: === 嚴重之誤 ===
|
||||
ReconnectionUnexpected: 數據庫連接忽斷,正試再連
|
||||
OperationAbort: 操作中止
|
||||
OperationFailed: '數據庫操作不果: '
|
||||
Closing: 正閉數據庫連接
|
||||
Closed: 數據庫連接已閉
|
||||
CloseFailed: '閉數據庫連接不果: '
|
||||
CheckColumnFailed: 尋列是否存在不果
|
||||
CheckTableFailed: 尋表是否存在不果
|
@ -4,8 +4,7 @@ Commands:
|
||||
CreateDominionUsage: '用法: /dominion create <领地名称>'
|
||||
CreateSelectPointsFirst: 请先使用工具选择领地的对角线两点,或使用 /dominion auto_create <领地名称> 创建自动领地
|
||||
CreateSubDominionUsage: '用法: /dominion create_sub <子领地名称> [父领地名称]'
|
||||
CreateSubSelectPointsFirst: 请先使用工具选择子领地的对角线两点,或使用 /dominion auto_create_sub <子领地名称>
|
||||
[父领地名称] 创建自动子领地
|
||||
CreateSubSelectPointsFirst: 请先使用工具选择子领地的对角线两点,或使用 /dominion auto_create_sub <子领地名称> [父领地名称] 创建自动子领地
|
||||
AutoCreateDominionUsage: '用法: /dominion auto_create <领地名称>'
|
||||
AutoCreateSubDominionUsage: '用法: /dominion auto_create_sub <子领地名称> [父领地名称]'
|
||||
AutoCreateDominionDisabled: 自动创建领地功能已关闭
|
||||
@ -35,8 +34,7 @@ Commands:
|
||||
DominionAddMemberUsage: '用法: /dominion member add <领地名称> <玩家名称>'
|
||||
DominionSetFlagUsage: '用法: /dominion member set_flag <领地名称> <玩家名称> <权限名称> <true/false>'
|
||||
DominionRemoveMemberUsage: '用法: /dominion member remove <领地名称> <玩家名称>'
|
||||
DominionApplyTemplateUsage: '用法: /dominion member apply_template <领地名称> <玩家名称>
|
||||
<模板名称>'
|
||||
DominionApplyTemplateUsage: '用法: /dominion member apply_template <领地名称> <玩家名称> <模板名称>'
|
||||
MemberUsage: '用法: /dominion member <add/set_flag/remove/apply_template/list/setting/select_player/select_template>'
|
||||
PageOptional: 页码(可选)
|
||||
ArgumentsNotEnough: 参数不足
|
||||
@ -73,6 +71,19 @@ Commands:
|
||||
ExportedMCAList: MCA文件列表已导出到 %s
|
||||
ReloadingConfig: 正在重新加载配置文件...
|
||||
ReloadedConfig: 配置文件已重新加载
|
||||
SetConfig:
|
||||
MinYShouldBeLessThanMaxY: 最高Y坐标限制不能小于最低Y坐标限制
|
||||
MaxYShouldBeGreaterThanMinY: 最低Y坐标限制不能大于最高Y坐标限制
|
||||
SizeXShouldBeGreaterThan4: X轴(东西)最大尺寸不能小于4
|
||||
SizeZShouldBeGreaterThan4: Z轴(南北)最大尺寸不能小于4
|
||||
SizeYShouldBeGreaterThan4: Y轴(垂直)最大尺寸不能小于4
|
||||
AmountShouldBeGreaterThan0: 每个玩家领地数量限制不能小于0
|
||||
DepthShouldBeGreaterThan0: 领地深度限制不能小于0
|
||||
TpDelayShouldBeGreaterThan0: 传送延迟不能小于0
|
||||
TpCoolDownShouldBeGreaterThan0: 传送冷却时间不能小于0
|
||||
PriceShouldBeGreaterThan0: 每方块单价不能小于0
|
||||
RefundShouldBeGreaterThan0: 领地退款比例不能小于0
|
||||
SpawnProtectRadiusShouldBeGreaterThan0: 出生点保护半径不能小于或等于0
|
||||
Template:
|
||||
CreateTemplateUsage: '用法: /dominion template create <模板名称>'
|
||||
DeleteTemplateUsage: '用法: /dominion template delete <模板名称>'
|
||||
@ -236,10 +247,10 @@ Messages:
|
||||
PluginVersion: 版本:%s
|
||||
PlaceholderAPIRegisterSuccess: 成功注册 PlaceholderAPI 扩展
|
||||
LoadedGroupAmount: 共加载了 %d 个领地组
|
||||
MapInfoDetail: <div>%s</div><div>所有人:%s</div>
|
||||
AutoCleanStart: 开始自动清理长时间未登录玩家领地数据
|
||||
AutoCleanPlayer: 已清理玩家 %s 的领地数据
|
||||
AutoCleanEnd: 自动清理完成
|
||||
MapInfoDetail: <div>%s</div><div>所有人:%s</div>
|
||||
TUI:
|
||||
NotDominionOwnerOrAdminForPage: 你不是领地 %s 的拥有者或管理员,无权访问此页面
|
||||
CommandHelp:
|
||||
@ -284,6 +295,8 @@ TUI:
|
||||
MigrateDescription: 把你的领地从Residence迁移到Dominion
|
||||
AllDominionButton: 所有领地
|
||||
AllDominionDescription: 查看所有领地
|
||||
ConfigButton: 系统配置
|
||||
ConfigDescription: 查看/修改系统配置
|
||||
ReloadCacheButton: 重载缓存
|
||||
ReloadCacheDescription: 手动刷新缓存可解决一些玩家操作无效问题,不建议频繁操作
|
||||
ReloadConfigButton: 重载配置
|
||||
@ -410,26 +423,31 @@ CUI:
|
||||
Config:
|
||||
Check:
|
||||
AutoCreateRadiusError: AutoCreateRadius 不能等于 0,已重置为 10
|
||||
MessageDisplayError: MessageDisplay 不能设置为 %s,已重置为 ACTION_BAR
|
||||
AutoCleanAfterDaysError: AutoCleanAfterDays 不能等于 0,已重置为 180
|
||||
ToolNameError: 工具名称设置错误,已重置为 ARROW
|
||||
GroupMinYError: '%s 的 MinY 不能大于等于 MaxY,已重置为 -64 和 320'
|
||||
GroupSizeXError: '%s 的 SizeX 设置过小,已重置为 128'
|
||||
GroupSizeYError: '%s 的 SizeY 设置过小,已重置为 64'
|
||||
GroupSizeZError: '%s 的 SizeZ 设置过小,已重置为 128'
|
||||
GroupAmountError: '%s 的 Amount 设置不合法,已重置为 10'
|
||||
GroupDepthError: '%s 的 Depth 设置不合法,已重置为 3'
|
||||
GroupPriceError: '%s 的 Price 设置不合法,已重置为 10.0'
|
||||
GroupRefundError: '%s 的 Refund 设置不合法,已重置为 0.85'
|
||||
LimitSizeXError: Limit.SizeX 尺寸不能小于 4,已重置为 128
|
||||
LimitSizeYError: Limit.SizeY 尺寸不能小于 4,已重置为 64
|
||||
LimitSizeZError: Limit.SizeZ 尺寸不能小于 4,已重置为 128
|
||||
LimitMinYError: Limit.MinY 不能大于或等于 Limit.MaxY,已重置为 -64 320
|
||||
RefundError: Economy.Refund 设置不合法,已重置为 0.85
|
||||
PriceError: Economy.Price 设置不合法,已重置为 10.0
|
||||
LimitSizeYAutoAdjust: 启用 Limit.Vert 时 Limit.SizeY 不能小于 Limit.MaxY - Limit.MinY,已自动调整为 %d
|
||||
AmountError: Limit.Amount 设置不合法,已重置为 10
|
||||
DepthError: Limit.Depth 设置不合法,已重置为 3
|
||||
GroupMinYError: 权限组 %s 的 MinY 不能大于等于 MaxY,已重置为 -64 和 320
|
||||
GroupSizeXError: 权限组 %s 的 SizeX 设置过小,已重置为 128
|
||||
GroupSizeYError: 权限组 %s 的 SizeY 设置过小,已重置为 64
|
||||
GroupSizeZError: 权限组 %s 的 SizeZ 设置过小,已重置为 128
|
||||
GroupAmountError: 权限组 %s 的 Amount 设置不合法,已重置为 10
|
||||
GroupDepthError: 权限组 %s 的 Depth 设置不合法,已重置为 3
|
||||
GroupPriceError: 权限组 %s 的 Price 设置不合法,已重置为 10.0
|
||||
GroupRefundError: 权限组 %s 的 Refund 设置不合法,已重置为 0.85
|
||||
LoadFlagError: 读取权限配置失败:%s
|
||||
TpDelayError: 传送延迟不能小于 0,已重置为 0
|
||||
TpCoolDownError: 传送冷却不能小于 0,已重置为 0
|
||||
Comment:
|
||||
Language: 语言设置,参考 languages 文件夹下的文件名
|
||||
AutoCreateRadius: 自动创建领地的半径,单位为方块
|
||||
MessageDisplay: 提示消息显示位置(BOSS_BAR, ACTION_BAR, TITLE, SUBTITLE, CHAT)
|
||||
MessageDisplayNoPermission: 玩家没有权限时的提示消息位置
|
||||
MessageDisplayJoinLeave: 进入/离开领地时的提示消息位置
|
||||
NegativeOneDisabled: -1表示不开启
|
||||
DefaultLimit: 默认玩家圈地限制
|
||||
SpawnProtectRadius: 出生点保护半径 出生点此范围内不允许圈地
|
||||
@ -444,7 +462,6 @@ Config:
|
||||
ZeroDisabled: 0表示不开启
|
||||
Vert: 是否自动延伸到 MaxY 和 MinY
|
||||
OpBypass: 是否允许OP无视领地限制
|
||||
WorldSettings: 单独设置某个世界的圈地规则(如不设置则使用以上规则)
|
||||
TpDelay: 传送延迟 秒
|
||||
TpCoolDown: 传送冷却 秒
|
||||
AutoCleanAfterDays: 自动清理长时间未上线玩家的领地(天)
|
||||
@ -468,6 +485,7 @@ Config:
|
||||
GroupLine6: 一些特殊优惠,例如更少的圈地价格、更大的领地等,你可以在
|
||||
GroupLine7: 这里配置。详细说明参阅以下链接:
|
||||
GroupLine8DocumentAddress: '> https://dominion.lunadeer.cn/%s/operator/privilege.html'
|
||||
WorldSettings: 单独设置某个世界的圈地规则(如不设置则使用以上规则)
|
||||
Flags:
|
||||
admin:
|
||||
DisplayName: 管理员
|
||||
@ -562,9 +580,6 @@ Flags:
|
||||
glow:
|
||||
DisplayName: 玩家发光
|
||||
Description: 类似光灵箭的高亮效果
|
||||
gravity_block:
|
||||
DisplayName: 允许外部重力方块落入
|
||||
Description: 如果禁止则领地外重力方块进入领地会变为掉落物
|
||||
harvest:
|
||||
DisplayName: 收获
|
||||
Description: 收获庄稼、作物
|
||||
|
@ -75,6 +75,19 @@ Commands:
|
||||
ExportedMCAList: MCA文件列表已導出到 %s
|
||||
ReloadingConfig: 正在重新加載配置文件...
|
||||
ReloadedConfig: 配置文件已重新加載
|
||||
SetConfig:
|
||||
MinYShouldBeLessThanMaxY: 最高Y坐標限製不能小於最低Y坐標限製
|
||||
MaxYShouldBeGreaterThanMinY: 最低Y坐標限製不能大於最高Y坐標限製
|
||||
SizeXShouldBeGreaterThan4: X軸(東西)最大尺寸不能小於4
|
||||
SizeZShouldBeGreaterThan4: Z軸(南北)最大尺寸不能小於4
|
||||
SizeYShouldBeGreaterThan4: Y軸(垂直)最大尺寸不能小於4
|
||||
AmountShouldBeGreaterThan0: 每個玩家領地數量限製不能小於0
|
||||
DepthShouldBeGreaterThan0: 領地深度限製不能小於0
|
||||
TpDelayShouldBeGreaterThan0: 傳送延遲不能小於0
|
||||
TpCoolDownShouldBeGreaterThan0: 傳送冷卻時間不能小於0
|
||||
PriceShouldBeGreaterThan0: 每方塊單價不能小於0
|
||||
RefundShouldBeGreaterThan0: 領地退款比例不能小於0
|
||||
SpawnProtectRadiusShouldBeGreaterThan0: 出生點保護半徑不能小於或等於0
|
||||
Template:
|
||||
CreateTemplateUsage: '用法: /dominion template create <模板名稱>'
|
||||
DeleteTemplateUsage: '用法: /dominion template delete <模板名稱>'
|
||||
@ -286,6 +299,8 @@ TUI:
|
||||
MigrateDescription: 把你的領地從Residence遷移到Dominion
|
||||
AllDominionButton: 所有領地
|
||||
AllDominionDescription: 查看所有領地
|
||||
ConfigButton: 系統配置
|
||||
ConfigDescription: 查看/修改系統配置
|
||||
ReloadCacheButton: 重載緩存
|
||||
ReloadCacheDescription: 手動刷新緩存可解決一些玩家操作無效問題,不建議頻繁操作
|
||||
ReloadConfigButton: 重載配置
|
||||
@ -675,7 +690,7 @@ Flags:
|
||||
DisplayName: 雕零生成
|
||||
Description: 雕零生成以及雕零生成時產生的爆炸
|
||||
Localization:
|
||||
LoadLanguageSuccess: 成功加載語言文件 zh-hk
|
||||
LoadLanguageSuccess: 成功加載語言文件 zh-cn
|
||||
LoadLanguageFailed: 加載語言文件失敗:%s
|
||||
LanguageFileNotFound: Language file %s not found, using default zh-cn.
|
||||
Utils:
|
||||
|
@ -1,7 +1,6 @@
|
||||
rootProject.name = "Dominion"
|
||||
|
||||
include(
|
||||
"api",
|
||||
"core",
|
||||
"v1_20_1",
|
||||
"v1_21"
|
||||
|
@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
|
||||
// utf-8
|
||||
@ -12,7 +12,6 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":api"))
|
||||
compileOnly(project(":core"))
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
||||
}
|
@ -20,11 +20,8 @@ import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import static cn.lunadeer.dominion.utils.EventUtils.checkFlag;
|
||||
import static org.bukkit.Material.FARMLAND;
|
||||
@ -336,7 +333,7 @@ public class EnvironmentEvents implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onHopper(InventoryMoveItemEvent event) { // hopper_outside
|
||||
public void onHopper(InventoryMoveItemEvent event) {
|
||||
Inventory hopper = event.getDestination();
|
||||
Inventory inventory = event.getSource();
|
||||
DominionDTO hopperDom = Cache.instance.getDominionByLoc(hopper.getLocation());
|
||||
@ -352,7 +349,7 @@ public class EnvironmentEvents implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_outside
|
||||
public void onBlockPushedByPiston(BlockPistonExtendEvent event) {
|
||||
Block piston = event.getBlock();
|
||||
DominionDTO pistonDom = Cache.instance.getDominionByLoc(piston.getLocation());
|
||||
BlockFace direction = event.getDirection();
|
||||
@ -372,38 +369,4 @@ public class EnvironmentEvents implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_block
|
||||
Entity entity = event.getEntity();
|
||||
if (!(entity instanceof FallingBlock)) {
|
||||
return;
|
||||
}
|
||||
Block block = event.getBlock();
|
||||
if (event.getTo().isAir()) {
|
||||
fallingBlockMap.put(entity.getUniqueId(), block.getLocation());
|
||||
} else {
|
||||
Location locStart = fallingBlockMap.get(entity.getUniqueId());
|
||||
if (locStart == null) {
|
||||
return;
|
||||
}
|
||||
fallingBlockMap.remove(entity.getUniqueId());
|
||||
Location locEnd = block.getLocation();
|
||||
DominionDTO domStart = Cache.instance.getDominionByLoc(locStart);
|
||||
DominionDTO domEnd = Cache.instance.getDominionByLoc(locEnd);
|
||||
if (domEnd == null) {
|
||||
return;
|
||||
}
|
||||
if (domStart != null && domStart.getId().equals(domEnd.getId())) {
|
||||
return;
|
||||
}
|
||||
if (!checkFlag(domEnd, Flag.GRAVITY_BLOCK, null)) {
|
||||
event.setCancelled(true);
|
||||
locEnd.getWorld().dropItemNaturally(locEnd, new ItemStack(((FallingBlock) entity).getBlockData().getMaterial()));
|
||||
entity.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<UUID, Location> fallingBlockMap = new java.util.HashMap<>();
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
package cn.lunadeer.dominion.events_v1_20_1;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.dominion.utils.Particle;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.VaultConnect.VaultConnect;
|
||||
@ -43,7 +41,7 @@ public class SelectPointEvents implements Listener {
|
||||
|
||||
if (action == Action.LEFT_CLICK_BLOCK) {
|
||||
event.setCancelled(true);
|
||||
Notification.info(player, Translation.Tool_SelectFirstPoint, block.getX(), block.getY(), block.getZ());
|
||||
Notification.info(player, "已选择第一个点: %d %d %d", block.getX(), block.getY(), block.getZ());
|
||||
Location loc = block.getLocation();
|
||||
if (Dominion.config.getLimitVert(player)) {
|
||||
loc.setY(Dominion.config.getLimitMinY(player));
|
||||
@ -51,7 +49,7 @@ public class SelectPointEvents implements Listener {
|
||||
points.put(0, loc);
|
||||
} else if (action == Action.RIGHT_CLICK_BLOCK) {
|
||||
event.setCancelled(true);
|
||||
Notification.info(player, Translation.Tool_SelectSecondPoint, block.getX(), block.getY(), block.getZ());
|
||||
Notification.info(player, "已选择第二个点: %d %d %d", block.getX(), block.getY(), block.getZ());
|
||||
Location loc = block.getLocation();
|
||||
if (Dominion.config.getLimitVert(player)) {
|
||||
loc.setY(Dominion.config.getLimitMaxY(player) - 1);
|
||||
@ -68,10 +66,10 @@ public class SelectPointEvents implements Listener {
|
||||
return;
|
||||
}
|
||||
if (!points.get(0).getWorld().equals(points.get(1).getWorld())) {
|
||||
Notification.warn(player, Translation.Tool_NotSameWorld);
|
||||
Notification.warn(player, "两个点不在同一个世界");
|
||||
return;
|
||||
}
|
||||
Notification.info(player, Translation.Tool_SelectTwoPoints);
|
||||
Notification.info(player, "已选择两个点,可以使用 /dominion create <领地名称> 创建领地");
|
||||
Location loc1 = points.get(0);
|
||||
Location loc2 = points.get(1);
|
||||
int minX = Math.min(loc1.getBlockX(), loc2.getBlockX());
|
||||
@ -84,7 +82,7 @@ public class SelectPointEvents implements Listener {
|
||||
minX, minY, minZ, maxX, maxY, maxZ);
|
||||
if (Dominion.config.getEconomyEnable()) {
|
||||
if (!VaultConnect.instance.economyAvailable()) {
|
||||
Notification.error(player, Translation.Messages_NoEconomyPlugin);
|
||||
Notification.error(player, "计算价格失败,没有可用的经济插件系统,请联系服主。");
|
||||
return;
|
||||
}
|
||||
int count;
|
||||
@ -94,38 +92,13 @@ public class SelectPointEvents implements Listener {
|
||||
count = dominion.getVolume();
|
||||
}
|
||||
float price = count * Dominion.config.getEconomyPrice(player);
|
||||
Notification.info(player, Translation.Tool_CreateDominionPrice, price, VaultConnect.instance.currencyNamePlural());
|
||||
Notification.info(player, "预计领地创建价格为 %.2f %s", price, VaultConnect.instance.currencyNamePlural());
|
||||
}
|
||||
Particle.showBorder(player, dominion);
|
||||
Notification.info(player, Translation.Tool_DominionSize, dominion.getWidthX(), dominion.getHeight(), dominion.getWidthZ());
|
||||
Notification.info(player, Translation.Tool_DominionSquare, dominion.getSquare());
|
||||
Notification.info(player, Translation.Tool_DominionHeight, dominion.getHeight());
|
||||
Notification.info(player, Translation.Tool_DominionVolume, dominion.getVolume());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void selectBlockToShowInfo(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
ItemStack item = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (item.getType() != Dominion.config.getInfoTool()) {
|
||||
return;
|
||||
}
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
Block block = event.getClickedBlock();
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
DominionDTO dominion = Cache.instance.getDominionByLoc(block.getLocation());
|
||||
if (dominion == null) {
|
||||
Notification.info(player, Translation.Tool_LocationNotInDominion, block.getX(), block.getY(), block.getZ());
|
||||
} else {
|
||||
Notification.info(player, Translation.Tool_LocationInDominion, block.getX(), block.getY(), block.getZ(), dominion.getName());
|
||||
Notification.info(player, Translation.Tool_DominionOwner, Cache.instance.getPlayerName(dominion.getOwner()));
|
||||
Notification.info(player, "尺寸: %d x %d x %d", dominion.getWidthX(), dominion.getHeight(), dominion.getWidthZ());
|
||||
Notification.info(player, "面积: %d", dominion.getSquare());
|
||||
Notification.info(player, "高度: %d", dominion.getHeight());
|
||||
Notification.info(player, "体积: %d", dominion.getVolume());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,15 +12,16 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static cn.lunadeer.dominion.utils.EventUtils.checkFlag;
|
||||
|
||||
public class Spigot implements Listener {
|
||||
|
||||
static {
|
||||
ConcurrentHashMap<UUID, Location> entityMap = new ConcurrentHashMap<>();
|
||||
Map<UUID, Location> entityMap = new HashMap<>();
|
||||
Scheduler.runTaskRepeat(() -> {
|
||||
Dominion.instance.getServer().getWorlds().forEach(world -> {
|
||||
world.getEntities().forEach(entity -> {
|
||||
|
@ -12,7 +12,6 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":api"))
|
||||
compileOnly(project(":core"))
|
||||
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
|
||||
}
|
@ -19,11 +19,8 @@ import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import static cn.lunadeer.dominion.utils.EventUtils.checkFlag;
|
||||
import static org.bukkit.Material.FARMLAND;
|
||||
@ -332,7 +329,7 @@ public class EnvironmentEvents implements Listener {
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onHopper(InventoryMoveItemEvent event) { // hopper_outside
|
||||
public void onHopper(InventoryMoveItemEvent event) {
|
||||
Inventory hopper = event.getDestination();
|
||||
Inventory inventory = event.getSource();
|
||||
DominionDTO hopperDom = Cache.instance.getDominionByLoc(hopper.getLocation());
|
||||
@ -348,7 +345,7 @@ public class EnvironmentEvents implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_outside
|
||||
public void onBlockPushedByPiston(BlockPistonExtendEvent event) {
|
||||
Block piston = event.getBlock();
|
||||
DominionDTO pistonDom = Cache.instance.getDominionByLoc(piston.getLocation());
|
||||
BlockFace direction = event.getDirection();
|
||||
@ -368,38 +365,4 @@ public class EnvironmentEvents implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_block
|
||||
Entity entity = event.getEntity();
|
||||
if (!(entity instanceof FallingBlock)) {
|
||||
return;
|
||||
}
|
||||
Block block = event.getBlock();
|
||||
if (event.getTo().isAir()) {
|
||||
fallingBlockMap.put(entity.getUniqueId(), block.getLocation());
|
||||
} else {
|
||||
Location locStart = fallingBlockMap.get(entity.getUniqueId());
|
||||
if (locStart == null) {
|
||||
return;
|
||||
}
|
||||
fallingBlockMap.remove(entity.getUniqueId());
|
||||
Location locEnd = block.getLocation();
|
||||
DominionDTO domStart = Cache.instance.getDominionByLoc(locStart);
|
||||
DominionDTO domEnd = Cache.instance.getDominionByLoc(locEnd);
|
||||
if (domEnd == null) {
|
||||
return;
|
||||
}
|
||||
if (domStart != null && domStart.getId().equals(domEnd.getId())) {
|
||||
return;
|
||||
}
|
||||
if (!checkFlag(domEnd, Flag.GRAVITY_BLOCK, null)) {
|
||||
event.setCancelled(true);
|
||||
locEnd.getWorld().dropItemNaturally(locEnd, new ItemStack(((FallingBlock) entity).getBlockData().getMaterial()));
|
||||
entity.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<UUID, Location> fallingBlockMap = new java.util.HashMap<>();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import cn.lunadeer.dominion.dtos.PlayerDTO;
|
||||
import cn.lunadeer.minecraftpluginutils.Common;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Teleport;
|
||||
import com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
@ -791,19 +790,6 @@ public class PlayerEvents implements Listener {
|
||||
checkFlag(dom, Flag.SHOOT, player, event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // shoot - wind_charge knock back
|
||||
public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) {
|
||||
Entity entity = event.getHitBy();
|
||||
if (!(entity instanceof WindCharge windCharge)) {
|
||||
return;
|
||||
}
|
||||
if (!(windCharge.getShooter() instanceof Player player)) {
|
||||
return;
|
||||
}
|
||||
DominionDTO dom = Cache.instance.getDominionByLoc(windCharge.getLocation());
|
||||
checkFlag(dom, Flag.SHOOT, player, event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // trade
|
||||
public void onTrade(InventoryOpenEvent event) {
|
||||
if (event.getInventory().getType() != InventoryType.MERCHANT) {
|
||||
|
@ -1,9 +1,7 @@
|
||||
package cn.lunadeer.dominion.events_v1_21;
|
||||
|
||||
import cn.lunadeer.dominion.Cache;
|
||||
import cn.lunadeer.dominion.Dominion;
|
||||
import cn.lunadeer.dominion.dtos.DominionDTO;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.dominion.utils.Particle;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.VaultConnect.VaultConnect;
|
||||
@ -43,7 +41,7 @@ public class SelectPointEvents implements Listener {
|
||||
|
||||
if (action == Action.LEFT_CLICK_BLOCK) {
|
||||
event.setCancelled(true);
|
||||
Notification.info(player, Translation.Tool_SelectFirstPoint, block.getX(), block.getY(), block.getZ());
|
||||
Notification.info(player, "已选择第一个点: %d %d %d", block.getX(), block.getY(), block.getZ());
|
||||
Location loc = block.getLocation();
|
||||
if (Dominion.config.getLimitVert(player)) {
|
||||
loc.setY(Dominion.config.getLimitMinY(player));
|
||||
@ -51,7 +49,7 @@ public class SelectPointEvents implements Listener {
|
||||
points.put(0, loc);
|
||||
} else if (action == Action.RIGHT_CLICK_BLOCK) {
|
||||
event.setCancelled(true);
|
||||
Notification.info(player, Translation.Tool_SelectSecondPoint, block.getX(), block.getY(), block.getZ());
|
||||
Notification.info(player, "已选择第二个点: %d %d %d", block.getX(), block.getY(), block.getZ());
|
||||
Location loc = block.getLocation();
|
||||
if (Dominion.config.getLimitVert(player)) {
|
||||
loc.setY(Dominion.config.getLimitMaxY(player) - 1);
|
||||
@ -68,10 +66,10 @@ public class SelectPointEvents implements Listener {
|
||||
return;
|
||||
}
|
||||
if (!points.get(0).getWorld().equals(points.get(1).getWorld())) {
|
||||
Notification.warn(player, Translation.Tool_NotSameWorld);
|
||||
Notification.warn(player, "两个点不在同一个世界");
|
||||
return;
|
||||
}
|
||||
Notification.info(player, Translation.Tool_SelectTwoPoints);
|
||||
Notification.info(player, "已选择两个点,可以使用 /dominion create <领地名称> 创建领地");
|
||||
Location loc1 = points.get(0);
|
||||
Location loc2 = points.get(1);
|
||||
int minX = Math.min(loc1.getBlockX(), loc2.getBlockX());
|
||||
@ -84,7 +82,7 @@ public class SelectPointEvents implements Listener {
|
||||
minX, minY, minZ, maxX, maxY, maxZ);
|
||||
if (Dominion.config.getEconomyEnable()) {
|
||||
if (!VaultConnect.instance.economyAvailable()) {
|
||||
Notification.error(player, Translation.Messages_NoEconomyPlugin);
|
||||
Notification.error(player, "计算价格失败,没有可用的经济插件系统,请联系服主。");
|
||||
return;
|
||||
}
|
||||
int count;
|
||||
@ -94,38 +92,13 @@ public class SelectPointEvents implements Listener {
|
||||
count = dominion.getVolume();
|
||||
}
|
||||
float price = count * Dominion.config.getEconomyPrice(player);
|
||||
Notification.info(player, Translation.Tool_CreateDominionPrice, price, VaultConnect.instance.currencyNamePlural());
|
||||
Notification.info(player, "预计领地创建价格为 %.2f %s", price, VaultConnect.instance.currencyNamePlural());
|
||||
}
|
||||
Particle.showBorder(player, dominion);
|
||||
Notification.info(player, Translation.Tool_DominionSize, dominion.getWidthX(), dominion.getHeight(), dominion.getWidthZ());
|
||||
Notification.info(player, Translation.Tool_DominionSquare, dominion.getSquare());
|
||||
Notification.info(player, Translation.Tool_DominionHeight, dominion.getHeight());
|
||||
Notification.info(player, Translation.Tool_DominionVolume, dominion.getVolume());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void selectBlockToShowInfo(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
ItemStack item = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (item.getType() != Dominion.config.getInfoTool()) {
|
||||
return;
|
||||
}
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
Block block = event.getClickedBlock();
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
DominionDTO dominion = Cache.instance.getDominionByLoc(block.getLocation());
|
||||
if (dominion == null) {
|
||||
Notification.info(player, Translation.Tool_LocationNotInDominion, block.getX(), block.getY(), block.getZ());
|
||||
} else {
|
||||
Notification.info(player, Translation.Tool_LocationInDominion, block.getX(), block.getY(), block.getZ(), dominion.getName());
|
||||
Notification.info(player, Translation.Tool_DominionOwner, Cache.instance.getPlayerName(dominion.getOwner()));
|
||||
Notification.info(player, "尺寸: %d x %d x %d", dominion.getWidthX(), dominion.getHeight(), dominion.getWidthZ());
|
||||
Notification.info(player, "面积: %d", dominion.getSquare());
|
||||
Notification.info(player, "高度: %d", dominion.getHeight());
|
||||
Notification.info(player, "体积: %d", dominion.getVolume());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,15 +12,16 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static cn.lunadeer.dominion.utils.EventUtils.checkFlag;
|
||||
|
||||
public class Spigot implements Listener {
|
||||
|
||||
static {
|
||||
ConcurrentHashMap<UUID, Location> entityMap = new ConcurrentHashMap<>();
|
||||
Map<UUID, Location> entityMap = new HashMap<>();
|
||||
Scheduler.runTaskRepeat(() -> {
|
||||
Dominion.instance.getServer().getWorlds().forEach(world -> {
|
||||
world.getEntities().forEach(entity -> {
|
||||
|
Loading…
Reference in New Issue
Block a user