mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2025-03-15 12:10:23 +08:00
完成了config的部分i18n
This commit is contained in:
parent
dbfe4f2963
commit
5794f28a33
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "cn.lunadeer"
|
||||
version = "2.4.2-beta"
|
||||
version = "2.5.0-beta"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
|
@ -3,10 +3,9 @@ package cn.lunadeer.dominion.commands;
|
||||
import cn.lunadeer.dominion.controllers.BukkitPlayerOperator;
|
||||
import cn.lunadeer.dominion.controllers.FlagsController;
|
||||
import cn.lunadeer.dominion.dtos.Flag;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.dominion.tuis.dominion.manage.EnvSetting;
|
||||
import cn.lunadeer.dominion.tuis.dominion.manage.GuestSetting;
|
||||
import cn.lunadeer.dominion.utils.i18n.i18n;
|
||||
import cn.lunadeer.dominion.utils.i18n.i18nField;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@ -14,13 +13,6 @@ import static cn.lunadeer.dominion.utils.CommandUtils.hasPermission;
|
||||
|
||||
public class DominionFlag {
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion set <权限名称> <true/false> [领地名称]")
|
||||
static i18n SetDominionFlagUsage;
|
||||
|
||||
static {
|
||||
i18n.initializeI18nFields(DominionFlag.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置领地权限
|
||||
* /dominion set <权限名称> <true/false> [领地名称]
|
||||
@ -50,7 +42,7 @@ public class DominionFlag {
|
||||
}
|
||||
|
||||
} else {
|
||||
Notification.error(sender, SetDominionFlagUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_SetDominionFlagUsage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,7 @@ 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 cn.lunadeer.dominion.utils.i18n.i18n;
|
||||
import cn.lunadeer.dominion.utils.i18n.i18nField;
|
||||
import cn.lunadeer.dominion.managers.Translation;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Scheduler;
|
||||
import cn.lunadeer.minecraftpluginutils.Teleport;
|
||||
@ -41,12 +40,12 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2) {
|
||||
Notification.error(sender, CreateDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_CreateDominionUsage);
|
||||
return;
|
||||
}
|
||||
Map<Integer, Location> points = Dominion.pointsSelect.get(player.getUniqueId());
|
||||
if (points == null || points.get(0) == null || points.get(1) == null) {
|
||||
Notification.error(sender, CreateSelectPointsFirst.trans());
|
||||
Notification.error(sender, Translation.Commands_CreateSelectPointsFirst);
|
||||
return;
|
||||
}
|
||||
String name = args[1];
|
||||
@ -54,12 +53,6 @@ public class DominionOperate {
|
||||
DominionController.create(operator, name, points.get(0), points.get(1));
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion create <领地名称>")
|
||||
static i18n CreateDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "请先使用工具选择领地的对角线两点,或使用 /dominion auto_create <领地名称> 创建自动领地")
|
||||
static i18n CreateSelectPointsFirst;
|
||||
|
||||
/**
|
||||
* 创建子领地
|
||||
* /dominion create_sub <子领地名称> [父领地名称]
|
||||
@ -74,12 +67,12 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2 && args.length != 3) {
|
||||
Notification.error(sender, CreateSubDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_CreateSubDominionUsage);
|
||||
return;
|
||||
}
|
||||
Map<Integer, Location> points = Dominion.pointsSelect.get(player.getUniqueId());
|
||||
if (points == null || points.get(0) == null || points.get(1) == null) {
|
||||
Notification.error(sender, CreateSubSelectPointsFirst.trans());
|
||||
Notification.error(sender, Translation.Commands_CreateSubSelectPointsFirst);
|
||||
return;
|
||||
}
|
||||
BukkitPlayerOperator operator = BukkitPlayerOperator.create(player);
|
||||
@ -90,11 +83,7 @@ public class DominionOperate {
|
||||
}
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion create_sub <子领地名称> [父领地名称]")
|
||||
static i18n CreateSubDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "请先使用工具选择子领地的对角线两点,或使用 /dominion auto_create_sub <子领地名称> [父领地名称] 创建自动子领地")
|
||||
static i18n CreateSubSelectPointsFirst;
|
||||
|
||||
/**
|
||||
* 自动创建领地
|
||||
@ -111,11 +100,11 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2) {
|
||||
Notification.error(sender, AutoCreateDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_AutoCreateDominionUsage);
|
||||
return;
|
||||
}
|
||||
if (Dominion.config.getAutoCreateRadius() < 0) {
|
||||
Notification.error(sender, AutoCreateDominionDisabled.trans());
|
||||
Notification.error(sender, Translation.Commands_AutoCreateDominionDisabled);
|
||||
return;
|
||||
}
|
||||
autoPoints(player);
|
||||
@ -137,25 +126,18 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2 && args.length != 3) {
|
||||
Notification.error(sender, AutoCreateSubDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_AutoCreateSubDominionUsage);
|
||||
return;
|
||||
}
|
||||
if (Dominion.config.getAutoCreateRadius() < 0) {
|
||||
Notification.error(sender, AutoCreateDominionDisabled.trans());
|
||||
Notification.error(sender, Translation.Commands_AutoCreateDominionDisabled);
|
||||
return;
|
||||
}
|
||||
autoPoints(player);
|
||||
createSubDominion(sender, args);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion auto_create <领地名称>")
|
||||
static i18n AutoCreateDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion auto_create_sub <子领地名称> [父领地名称]")
|
||||
static i18n AutoCreateSubDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "自动创建领地功能已关闭")
|
||||
static i18n AutoCreateDominionDisabled;
|
||||
|
||||
/**
|
||||
* 扩张领地
|
||||
@ -171,7 +153,7 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2 && args.length != 3) {
|
||||
Notification.error(sender, ExpandDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_ExpandDominionUsage);
|
||||
return;
|
||||
}
|
||||
int size = 10;
|
||||
@ -179,11 +161,11 @@ public class DominionOperate {
|
||||
try {
|
||||
size = Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
Notification.error(sender, SizeShouldBeInteger.trans());
|
||||
Notification.error(sender, Translation.Commands_SizeShouldBeInteger);
|
||||
return;
|
||||
}
|
||||
if (size <= 0) {
|
||||
Notification.error(sender, SizeShouldBePositive.trans());
|
||||
Notification.error(sender, Translation.Commands_SizeShouldBePositive);
|
||||
return;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
@ -211,7 +193,7 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2 && args.length != 3) {
|
||||
Notification.error(sender, ContractDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_ContractDominionUsage);
|
||||
return;
|
||||
}
|
||||
int size = 10;
|
||||
@ -219,11 +201,11 @@ public class DominionOperate {
|
||||
try {
|
||||
size = Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
Notification.error(sender, SizeShouldBeInteger.trans());
|
||||
Notification.error(sender, Translation.Commands_SizeShouldBeInteger);
|
||||
return;
|
||||
}
|
||||
if (size <= 0) {
|
||||
Notification.error(sender, SizeShouldBePositive.trans());
|
||||
Notification.error(sender, Translation.Commands_SizeShouldBePositive);
|
||||
return;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
@ -237,19 +219,6 @@ public class DominionOperate {
|
||||
}
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion expand [大小] [领地名称]")
|
||||
static i18n ExpandDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion contract [大小] [领地名称]")
|
||||
static i18n ContractDominionUsage;
|
||||
|
||||
|
||||
@i18nField(defaultValue = "大小应当为整数")
|
||||
static i18n SizeShouldBeInteger;
|
||||
|
||||
@i18nField(defaultValue = "大小应当大于0")
|
||||
static i18n SizeShouldBePositive;
|
||||
|
||||
/**
|
||||
* 删除领地
|
||||
* /dominion delete <领地名称> [force]
|
||||
@ -274,12 +243,9 @@ public class DominionOperate {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Notification.error(sender, DeleteDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_DeleteDominionUsage);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion delete <领地名称>")
|
||||
static i18n DeleteDominionUsage;
|
||||
|
||||
/**
|
||||
* 设置领地进入提示
|
||||
* /dominion set_enter_msg <提示语> [领地名称]
|
||||
@ -300,12 +266,9 @@ public class DominionOperate {
|
||||
DominionController.setJoinMessage(operator, args[1], args[2]);
|
||||
return;
|
||||
}
|
||||
Notification.error(sender, SetEnterMessageUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_SetEnterMessageUsage);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion set_enter_msg <提示语> [领地名称]")
|
||||
static i18n SetEnterMessageUsage;
|
||||
|
||||
/**
|
||||
* 设置领地离开提示
|
||||
* /dominion set_leave_msg <提示语> [领地名称]
|
||||
@ -326,12 +289,9 @@ public class DominionOperate {
|
||||
DominionController.setLeaveMessage(operator, args[1], args[2]);
|
||||
return;
|
||||
}
|
||||
Notification.error(sender, SetLeaveMessageUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_SetLeaveMessageUsage);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion set_leave_msg <提示语> [领地名称]")
|
||||
static i18n SetLeaveMessageUsage;
|
||||
|
||||
/**
|
||||
* 设置领地传送点
|
||||
* /dominion set_tp_location [领地名称]
|
||||
@ -357,12 +317,9 @@ public class DominionOperate {
|
||||
args[1]);
|
||||
return;
|
||||
}
|
||||
Notification.error(sender, SetTpLocationUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_SetTpLocationUsage);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion set_tp_location [领地名称]")
|
||||
static i18n SetTpLocationUsage;
|
||||
|
||||
/**
|
||||
* 重命名领地
|
||||
* /dominion rename <原领地名称> <新领地名称>
|
||||
@ -376,15 +333,12 @@ public class DominionOperate {
|
||||
}
|
||||
BukkitPlayerOperator operator = BukkitPlayerOperator.create(sender);
|
||||
if (args.length != 3) {
|
||||
Notification.error(sender, RenameDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_RenameDominionUsage);
|
||||
return;
|
||||
}
|
||||
DominionController.rename(operator, args[1], args[2]);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion rename <原领地名称> <新领地名称>")
|
||||
static i18n RenameDominionUsage;
|
||||
|
||||
/**
|
||||
* 转让领地
|
||||
* /dominion give <领地名称> <玩家名称> [force]
|
||||
@ -411,12 +365,9 @@ public class DominionOperate {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Notification.error(sender, GiveDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_GiveDominionUsage);
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion give <领地名称> <玩家名称>")
|
||||
static i18n GiveDominionUsage;
|
||||
|
||||
/**
|
||||
* 传送到领地
|
||||
* /dominion tp <领地名称>
|
||||
@ -431,34 +382,34 @@ public class DominionOperate {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
if (args.length != 2) {
|
||||
Notification.error(sender, TpDominionUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_TpDominionUsage);
|
||||
return;
|
||||
}
|
||||
DominionDTO dominionDTO = DominionDTO.select(args[1]);
|
||||
if (dominionDTO == null) {
|
||||
Notification.error(sender, DominionNotExist.trans());
|
||||
Notification.error(sender, Translation.Commands_DominionNotExist);
|
||||
return;
|
||||
}
|
||||
if (player.isOp() && Dominion.config.getLimitOpBypass()) {
|
||||
Notification.warn(sender, OpBypassTpLimit.trans());
|
||||
Notification.warn(sender, Translation.Commands_OpBypassTpLimit);
|
||||
Location location = dominionDTO.getTpLocation();
|
||||
if (location == null) {
|
||||
int x = (dominionDTO.getX1() + dominionDTO.getX2()) / 2;
|
||||
int z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
||||
World world = dominionDTO.getWorld();
|
||||
if (world == null) {
|
||||
Notification.error(sender, WorldNotExist.trans());
|
||||
Notification.error(sender, Translation.Commands_WorldNotExist);
|
||||
return;
|
||||
}
|
||||
location = new Location(world, x, player.getLocation().getY(), z);
|
||||
XLogger.warn(DominionNoTpLocation.trans(), dominionDTO.getName());
|
||||
XLogger.warn(Translation.Commands_DominionNoTpLocation, dominionDTO.getName());
|
||||
}
|
||||
Teleport.doTeleportSafely(player, location);
|
||||
Notification.info(player, TpToDominion.trans(), dominionDTO.getName());
|
||||
Notification.info(player, Translation.Commands_TpToDominion, dominionDTO.getName());
|
||||
return;
|
||||
}
|
||||
if (!Dominion.config.getTpEnable()) {
|
||||
Notification.error(sender, TpDisabled.trans());
|
||||
Notification.error(sender, Translation.Commands_TpDisabled);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -466,19 +417,19 @@ public class DominionOperate {
|
||||
if (!canByPass(player, dominionDTO, privilegeDTO)) {
|
||||
if (privilegeDTO == null) {
|
||||
if (!dominionDTO.getFlagValue(Flag.TELEPORT)) {
|
||||
Notification.error(sender, DominionNoTp.trans());
|
||||
Notification.error(sender, Translation.Commands_DominionNoTp);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
GroupDTO groupDTO = Cache.instance.getGroup(privilegeDTO.getGroupId());
|
||||
if (privilegeDTO.getGroupId() != -1 && groupDTO != null) {
|
||||
if (!groupDTO.getFlagValue(Flag.TELEPORT)) {
|
||||
Notification.error(sender, GroupNoTp.trans());
|
||||
Notification.error(sender, Translation.Commands_GroupNoTp);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!privilegeDTO.getFlagValue(Flag.TELEPORT)) {
|
||||
Notification.error(sender, PrivilegeNoTp.trans());
|
||||
Notification.error(sender, Translation.Commands_PrivilegeNoTp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -490,19 +441,19 @@ public class DominionOperate {
|
||||
if (next_time != null) {
|
||||
if (now.isBefore(next_time)) {
|
||||
long secs_until_next = now.until(next_time, java.time.temporal.ChronoUnit.SECONDS);
|
||||
Notification.error(player, TpCoolDown.trans(), secs_until_next);
|
||||
Notification.error(player, Translation.Commands_TpCoolDown, secs_until_next);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Dominion.config.getTpDelay() > 0) {
|
||||
Notification.info(player, TpDelay.trans(), Dominion.config.getTpDelay());
|
||||
Notification.info(player, Translation.Commands_TpDelay, Dominion.config.getTpDelay());
|
||||
Scheduler.runTaskAsync(() -> {
|
||||
int i = Dominion.config.getTpDelay();
|
||||
while (i > 0) {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
Notification.actionBar(player, TpCountDown.trans(), i);
|
||||
Notification.actionBar(player, Translation.Commands_TpCountDown, i);
|
||||
i--;
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@ -519,73 +470,28 @@ public class DominionOperate {
|
||||
int center_z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
||||
World world = dominionDTO.getWorld();
|
||||
if (world == null) {
|
||||
Notification.error(player, WorldNotExist.trans());
|
||||
Notification.error(player, Translation.Commands_WorldNotExist);
|
||||
return;
|
||||
}
|
||||
if (location == null) {
|
||||
location = new Location(world, center_x, player.getLocation().getY(), center_z);
|
||||
Notification.warn(player, DominionNoTpLocation.trans(), dominionDTO.getName());
|
||||
Notification.warn(player, Translation.Commands_DominionNoTpLocation, dominionDTO.getName());
|
||||
} else if (!isInDominion(dominionDTO, location)) {
|
||||
location = new Location(world, center_x, player.getLocation().getY(), center_z);
|
||||
Notification.warn(player, DominionTpLocationNotInDominion.trans(), dominionDTO.getName());
|
||||
Notification.warn(player, Translation.Commands_DominionTpLocationNotInDominion, dominionDTO.getName());
|
||||
}
|
||||
if (player.isOnline()) {
|
||||
Teleport.doTeleportSafely(player, location).thenAccept(b -> {
|
||||
if (b) {
|
||||
Notification.info(player, TpToDominion.trans(), dominionDTO.getName());
|
||||
Notification.info(player, Translation.Commands_TpToDominion, dominionDTO.getName());
|
||||
} else {
|
||||
Notification.error(player, TpFailed.trans());
|
||||
Notification.error(player, Translation.Commands_TpFailed);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 20L * Dominion.config.getTpDelay());
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion tp <领地名称>")
|
||||
static i18n TpDominionUsage;
|
||||
|
||||
@i18nField(defaultValue = "领地不存在")
|
||||
static i18n DominionNotExist;
|
||||
|
||||
@i18nField(defaultValue = "你是OP,将忽略领地传送限制")
|
||||
static i18n OpBypassTpLimit;
|
||||
|
||||
@i18nField(defaultValue = "领地所在世界不存在")
|
||||
static i18n WorldNotExist;
|
||||
|
||||
@i18nField(defaultValue = "领地 %s 没有设置传送点,将尝试传送到中心点")
|
||||
static i18n DominionNoTpLocation;
|
||||
|
||||
@i18nField(defaultValue = "领地 %s 传送点不在领地内,将尝试传送到中心点")
|
||||
static i18n DominionTpLocationNotInDominion;
|
||||
|
||||
@i18nField(defaultValue = "已将你传送到 %s")
|
||||
static i18n TpToDominion;
|
||||
|
||||
@i18nField(defaultValue = "管理员没有开启领地传送功能")
|
||||
static i18n TpDisabled;
|
||||
|
||||
@i18nField(defaultValue = "此领地禁止传送")
|
||||
static i18n DominionNoTp;
|
||||
|
||||
@i18nField(defaultValue = "你所在的权限组组不被允许传送到这个领地")
|
||||
static i18n GroupNoTp;
|
||||
|
||||
@i18nField(defaultValue = "你不被允许传送到这个领地")
|
||||
static i18n PrivilegeNoTp;
|
||||
|
||||
@i18nField(defaultValue = "请等待 %d 秒后再传送")
|
||||
static i18n TpCoolDown;
|
||||
|
||||
@i18nField(defaultValue = "传送将在 %d 秒后执行")
|
||||
static i18n TpDelay;
|
||||
|
||||
@i18nField(defaultValue = "传送倒计时 %d 秒")
|
||||
static i18n TpCountDown;
|
||||
|
||||
@i18nField(defaultValue = "传送失败,请重试")
|
||||
static i18n TpFailed;
|
||||
|
||||
/**
|
||||
* 设置领地卫星地图地块颜色
|
||||
*
|
||||
@ -597,7 +503,7 @@ public class DominionOperate {
|
||||
return;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
Notification.error(sender, SetMapColorUsage.trans());
|
||||
Notification.error(sender, Translation.Commands_SetMapColorUsage);
|
||||
return;
|
||||
}
|
||||
BukkitPlayerOperator operator = BukkitPlayerOperator.create(sender);
|
||||
@ -608,12 +514,4 @@ public class DominionOperate {
|
||||
}
|
||||
}
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion set_map_color <颜色> [领地名称]")
|
||||
static i18n SetMapColorUsage;
|
||||
|
||||
static {
|
||||
// 初始化国际化字段
|
||||
i18n.initializeI18nFields(DominionOperate.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,12 +10,14 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigManager {
|
||||
public ConfigManager(Dominion plugin) {
|
||||
new Translation(plugin);
|
||||
_plugin = plugin;
|
||||
_plugin.saveDefaultConfig();
|
||||
reload();
|
||||
@ -25,6 +27,8 @@ public class ConfigManager {
|
||||
public void reload() {
|
||||
_plugin.reloadConfig();
|
||||
_file = _plugin.getConfig();
|
||||
_language = _file.getString("Language", "zh-cn");
|
||||
Translation.instance.loadLocale(_language);
|
||||
_debug = _file.getBoolean("Debug", false);
|
||||
_timer = _file.getBoolean("Timer", false);
|
||||
XLogger.setDebug(_debug);
|
||||
@ -36,7 +40,7 @@ public class ConfigManager {
|
||||
_db_pass = _file.getString("Database.Pass", "postgres");
|
||||
_auto_create_radius = _file.getInt("AutoCreateRadius", 10);
|
||||
if (_auto_create_radius == 0) {
|
||||
XLogger.err("AutoCreateRadius 不能等于 0,已重置为 10");
|
||||
XLogger.err(Translation.Config_AutoCreateRadiusError);
|
||||
setAutoCreateRadius(10);
|
||||
}
|
||||
_spawn_protection = _file.getInt("Limit.SpawnProtection", 10);
|
||||
@ -44,7 +48,7 @@ public class ConfigManager {
|
||||
_dynmap = _file.getBoolean("Dynmap", false);
|
||||
_auto_clean_after_days = _file.getInt("AutoCleanAfterDays", 180);
|
||||
if (_auto_clean_after_days == 0) {
|
||||
XLogger.err("AutoCleanAfterDays 不能等于 0,已重置为 180");
|
||||
XLogger.err(Translation.Config_AutoCleanAfterDaysError);
|
||||
setAutoCleanAfterDays(180);
|
||||
}
|
||||
_limit_op_bypass = _file.getBoolean("Limit.OpByPass", true);
|
||||
@ -54,7 +58,7 @@ public class ConfigManager {
|
||||
_tp_cool_down = _file.getInt("Teleport.CoolDown", 0);
|
||||
_tool = _file.getString("Tool", "ARROW");
|
||||
if (Material.getMaterial(_tool) == null) {
|
||||
XLogger.err("工具名称设置错误,已重置为 ARROW");
|
||||
XLogger.err(Translation.Config_ToolNameError);
|
||||
setTool("ARROW");
|
||||
}
|
||||
_economy_enable = _file.getBoolean("Economy.Enable", false);
|
||||
@ -80,34 +84,33 @@ public class ConfigManager {
|
||||
defaultGroup.setPrice(_file.getDouble("Economy.Price", 10.0));
|
||||
defaultGroup.setPriceOnlyXZ(_file.getBoolean("Economy.OnlyXZ", false));
|
||||
defaultGroup.setRefundRatio(_file.getDouble("Economy.Refund", 0.85));
|
||||
limits.put("default", defaultGroup);
|
||||
if (defaultGroup.getLimitSizeX() <= 4 && defaultGroup.getLimitSizeX() != -1) {
|
||||
XLogger.err("Limit.SizeX 尺寸不能小于 4,已重置为 128");
|
||||
XLogger.err(Translation.Config_LimitSizeXError);
|
||||
setLimitSizeX(128);
|
||||
}
|
||||
if (defaultGroup.getLimitSizeY() <= 4 && defaultGroup.getLimitSizeY() != -1) {
|
||||
XLogger.err("Limit.SizeY 尺寸不能小于 4,已重置为 64");
|
||||
XLogger.err(Translation.Config_LimitSizeYError);
|
||||
setLimitSizeY(64);
|
||||
}
|
||||
if (defaultGroup.getLimitSizeZ() <= 4 && defaultGroup.getLimitSizeZ() != -1) {
|
||||
XLogger.err("Limit.SizeZ 尺寸不能小于 4,已重置为 128");
|
||||
XLogger.err(Translation.Config_LimitSizeZError);
|
||||
setLimitSizeZ(128);
|
||||
}
|
||||
if (defaultGroup.getLimitMinY() >= defaultGroup.getLimitMaxY()) {
|
||||
XLogger.err("Limit.MinY 不能大于或等于 Limit.MaxY,已重置为 -64 320");
|
||||
XLogger.err(Translation.Config_LimitMinYError);
|
||||
setLimitMinY(-64);
|
||||
setLimitMaxY(320);
|
||||
}
|
||||
if (defaultGroup.getRefundRatio() < 0.0 || defaultGroup.getRefundRatio() > 1.0) {
|
||||
XLogger.err("Economy.Refund 设置不合法,已重置为 0.85");
|
||||
XLogger.err(Translation.Config_RefundError);
|
||||
setEconomyRefund(0.85f);
|
||||
}
|
||||
if (defaultGroup.getPrice() < 0.0) {
|
||||
XLogger.err("Economy.Price 设置不合法,已重置为 10.0");
|
||||
XLogger.err(Translation.Config_PriceError);
|
||||
setEconomyPrice(10.0f);
|
||||
}
|
||||
if (defaultGroup.getLimitVert() && defaultGroup.getLimitSizeY() <= defaultGroup.getLimitMaxY() - defaultGroup.getLimitMinY()) {
|
||||
XLogger.warn("启用 Limit.Vert 时 Limit.SizeY 不能小于 Limit.MaxY - Limit.MinY,已自动调整为 " + (defaultGroup.getLimitMaxY() - defaultGroup.getLimitMinY() + 1));
|
||||
XLogger.warn(Translation.Config_LimitSizeYAutoAdjust, (defaultGroup.getLimitMaxY() - defaultGroup.getLimitMinY() + 1));
|
||||
setLimitSizeY(defaultGroup.getLimitMaxY() - defaultGroup.getLimitMinY() + 1);
|
||||
}
|
||||
if (defaultGroup.getLimitAmount() < 0 && defaultGroup.getLimitAmount() != -1) {
|
||||
@ -118,6 +121,7 @@ public class ConfigManager {
|
||||
XLogger.err("Limit.Depth 设置不合法,已重置为 3");
|
||||
setLimitDepth(3);
|
||||
}
|
||||
limits.put("default", defaultGroup);
|
||||
|
||||
limits.putAll(GroupLimit.loadGroups(_plugin));
|
||||
|
||||
@ -142,37 +146,64 @@ public class ConfigManager {
|
||||
_file.set("Database.User", _db_user);
|
||||
_file.set("Database.Pass", _db_pass);
|
||||
|
||||
_file.set("AutoCreateRadius", _auto_create_radius);
|
||||
_file.set("Language", _language);
|
||||
_file.setComments("Language", List.of("语言设置,参考 languages 文件夹下的文件名"));
|
||||
|
||||
_file.set("AutoCreateRadius", _auto_create_radius);
|
||||
_file.setComments("AutoCreateRadius", Arrays.asList("自动创建领地的半径,单位为方块", "-1 表示不开启"));
|
||||
|
||||
_file.setComments("Limit", List.of("默认玩家圈地限制"));
|
||||
_file.set("Limit.SpawnProtection", _spawn_protection);
|
||||
_file.setInlineComments("Limit.SpawnProtection", List.of("出生点保护半径 出生点此范围内不允许圈地 -1 表示不开启"));
|
||||
_file.set("Limit.MinY", limits.get("default").getLimitMinY());
|
||||
_file.setInlineComments("Limit.MinY", List.of("最小Y坐标"));
|
||||
_file.set("Limit.MaxY", limits.get("default").getLimitMaxY());
|
||||
_file.setInlineComments("Limit.MaxY", List.of("最大Y坐标"));
|
||||
_file.set("Limit.SizeX", limits.get("default").getLimitSizeX());
|
||||
_file.setInlineComments("Limit.SizeX", List.of("X方向最大长度 -1:表示不限制"));
|
||||
_file.set("Limit.SizeY", limits.get("default").getLimitSizeY());
|
||||
_file.setInlineComments("Limit.SizeY", List.of("Y方向最大长度 -1:表示不限制"));
|
||||
_file.set("Limit.SizeZ", limits.get("default").getLimitSizeZ());
|
||||
_file.setInlineComments("Limit.SizeZ", List.of("Z方向最大长度 -1:表示不限制"));
|
||||
_file.set("Limit.Amount", limits.get("default").getLimitAmount());
|
||||
_file.setInlineComments("Limit.Amount", List.of("最大领地数量 -1:表示不限制"));
|
||||
_file.set("Limit.Depth", limits.get("default").getLimitDepth());
|
||||
_file.setInlineComments("Limit.Depth", List.of("子领地深度 0:不允许子领地 -1:不限制"));
|
||||
_file.set("Limit.Vert", limits.get("default").getLimitVert());
|
||||
_file.setInlineComments("Limit.Vert", List.of("是否自动延伸到 MaxY 和 MinY"));
|
||||
_file.set("Limit.WorldBlackList", limits.get("default").getWorldBlackList());
|
||||
_file.setInlineComments("Limit.WorldBlackList", List.of("不允许圈地的世界列表"));
|
||||
_file.set("Limit.OpByPass", _limit_op_bypass);
|
||||
_file.setInlineComments("Limit.OpByPass", List.of("是否允许OP无视领地限制"));
|
||||
|
||||
_file.set("Teleport.Enable", _tp_enable);
|
||||
_file.set("Teleport.Delay", _tp_delay);
|
||||
_file.setInlineComments("Teleport.Delay", List.of("传送延迟 秒"));
|
||||
_file.set("Teleport.CoolDown", _tp_cool_down);
|
||||
_file.setInlineComments("Teleport.CoolDown", List.of("传送冷却 秒"));
|
||||
|
||||
_file.set("AutoCleanAfterDays", _auto_clean_after_days);
|
||||
_file.setComments("AutoCleanAfterDays", Arrays.asList("自动清理长时间未上线玩家的领地(天)", "-1 表示不开启"));
|
||||
|
||||
_file.set("Tool", _tool);
|
||||
_file.setComments("Tool", List.of("圈地工具名称"));
|
||||
|
||||
_file.setComments("Economy", Arrays.asList("经济设置", "需要安装 Vault 前置及插件"));
|
||||
_file.set("Economy.Enable", _economy_enable);
|
||||
_file.set("Economy.Price", limits.get("default").getPrice());
|
||||
_file.setInlineComments("Economy.Price", List.of("圈地价格 单位每方块"));
|
||||
_file.set("Economy.OnlyXZ", limits.get("default").getPriceOnlyXZ());
|
||||
_file.setInlineComments("Economy.OnlyXZ", List.of("是否只计算xz平面积"));
|
||||
_file.set("Economy.Refund", limits.get("default").getRefundRatio());
|
||||
_file.setInlineComments("Economy.Refund", List.of("删除领地时的退款比例"));
|
||||
|
||||
_file.set("FlyPermissionNodes", _fly_permission_nodes);
|
||||
_file.setComments("FlyPermissionNodes", List.of("飞行权限节点 - 拥有以下任意一个权限节点的玩家不会被本插件拦截飞行"));
|
||||
|
||||
_file.set("ResidenceMigration", _residence_migration);
|
||||
_file.setComments("ResidenceMigration", List.of("是否允许玩家从 Residence 迁移领地数据"));
|
||||
|
||||
_file.setComments("GroupTitle", Arrays.asList("权限组称号 - 使用权限组当作称号(需要PlaceholderAPI插件)", "变量: %dominion_group_title%", "前后缀如需要加颜色请使用这种格式 &#ffffff"));
|
||||
_file.set("GroupTitle.Enable", _group_title_enable);
|
||||
_file.set("GroupTitle.Prefix", _group_title_prefix);
|
||||
_file.set("GroupTitle.Suffix", _group_title_suffix);
|
||||
@ -184,6 +215,7 @@ public class ConfigManager {
|
||||
|
||||
_file.set("Debug", _debug);
|
||||
_file.set("Timer", _timer);
|
||||
_file.setInlineComments("Timer", List.of("性能测试计时器"));
|
||||
|
||||
_plugin.saveConfig();
|
||||
}
|
||||
@ -526,6 +558,8 @@ public class ConfigManager {
|
||||
private String _db_pass;
|
||||
private String _db_name;
|
||||
|
||||
private String _language;
|
||||
|
||||
private Integer _auto_create_radius;
|
||||
|
||||
private Boolean _limit_op_bypass;
|
||||
|
@ -0,0 +1,104 @@
|
||||
package cn.lunadeer.dominion.managers;
|
||||
|
||||
|
||||
import cn.lunadeer.minecraftpluginutils.i18n.Localization;
|
||||
import cn.lunadeer.minecraftpluginutils.i18n.i18n;
|
||||
import cn.lunadeer.minecraftpluginutils.i18n.i18nField;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Translation extends Localization {
|
||||
@i18nField(defaultValue = "用法: /dominion set <权限名称> <true/false> [领地名称]")
|
||||
public static i18n Commands_SetDominionFlagUsage;
|
||||
|
||||
@i18nField(defaultValue = "用法: /dominion create <领地名称>")
|
||||
public static i18n Commands_CreateDominionUsage;
|
||||
@i18nField(defaultValue = "请先使用工具选择领地的对角线两点,或使用 /dominion auto_create <领地名称> 创建自动领地")
|
||||
public static i18n Commands_CreateSelectPointsFirst;
|
||||
@i18nField(defaultValue = "用法: /dominion create_sub <子领地名称> [父领地名称]")
|
||||
public static i18n Commands_CreateSubDominionUsage;
|
||||
@i18nField(defaultValue = "请先使用工具选择子领地的对角线两点,或使用 /dominion auto_create_sub <子领地名称> [父领地名称] 创建自动子领地")
|
||||
public static i18n Commands_CreateSubSelectPointsFirst;
|
||||
@i18nField(defaultValue = "用法: /dominion auto_create <领地名称>")
|
||||
public static i18n Commands_AutoCreateDominionUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion auto_create_sub <子领地名称> [父领地名称]")
|
||||
public static i18n Commands_AutoCreateSubDominionUsage;
|
||||
@i18nField(defaultValue = "自动创建领地功能已关闭")
|
||||
public static i18n Commands_AutoCreateDominionDisabled;
|
||||
@i18nField(defaultValue = "用法: /dominion expand [大小] [领地名称]")
|
||||
public static i18n Commands_ExpandDominionUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion contract [大小] [领地名称]")
|
||||
public static i18n Commands_ContractDominionUsage;
|
||||
@i18nField(defaultValue = "大小应当为整数")
|
||||
public static i18n Commands_SizeShouldBeInteger;
|
||||
@i18nField(defaultValue = "大小应当大于0")
|
||||
public static i18n Commands_SizeShouldBePositive;
|
||||
@i18nField(defaultValue = "用法: /dominion delete <领地名称>")
|
||||
public static i18n Commands_DeleteDominionUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion set_enter_msg <提示语> [领地名称]")
|
||||
public static i18n Commands_SetEnterMessageUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion set_leave_msg <提示语> [领地名称]")
|
||||
public static i18n Commands_SetLeaveMessageUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion set_tp_location [领地名称]")
|
||||
public static i18n Commands_SetTpLocationUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion rename <原领地名称> <新领地名称>")
|
||||
public static i18n Commands_RenameDominionUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion give <领地名称> <玩家名称>")
|
||||
public static i18n Commands_GiveDominionUsage;
|
||||
@i18nField(defaultValue = "用法: /dominion tp <领地名称>")
|
||||
public static i18n Commands_TpDominionUsage;
|
||||
@i18nField(defaultValue = "领地不存在")
|
||||
public static i18n Commands_DominionNotExist;
|
||||
@i18nField(defaultValue = "你是OP,将忽略领地传送限制")
|
||||
public static i18n Commands_OpBypassTpLimit;
|
||||
@i18nField(defaultValue = "领地所在世界不存在")
|
||||
public static i18n Commands_WorldNotExist;
|
||||
@i18nField(defaultValue = "领地 %s 没有设置传送点,将尝试传送到中心点")
|
||||
public static i18n Commands_DominionNoTpLocation;
|
||||
@i18nField(defaultValue = "领地 %s 传送点不在领地内,将尝试传送到中心点")
|
||||
public static i18n Commands_DominionTpLocationNotInDominion;
|
||||
@i18nField(defaultValue = "已将你传送到 %s")
|
||||
public static i18n Commands_TpToDominion;
|
||||
@i18nField(defaultValue = "管理员没有开启领地传送功能")
|
||||
public static i18n Commands_TpDisabled;
|
||||
@i18nField(defaultValue = "此领地禁止传送")
|
||||
public static i18n Commands_DominionNoTp;
|
||||
@i18nField(defaultValue = "你所在的权限组组不被允许传送到这个领地")
|
||||
public static i18n Commands_GroupNoTp;
|
||||
@i18nField(defaultValue = "你不被允许传送到这个领地")
|
||||
public static i18n Commands_PrivilegeNoTp;
|
||||
@i18nField(defaultValue = "请等待 %d 秒后再传送")
|
||||
public static i18n Commands_TpCoolDown;
|
||||
@i18nField(defaultValue = "传送将在 %d 秒后执行")
|
||||
public static i18n Commands_TpDelay;
|
||||
@i18nField(defaultValue = "传送倒计时 %d 秒")
|
||||
public static i18n Commands_TpCountDown;
|
||||
@i18nField(defaultValue = "传送失败,请重试")
|
||||
public static i18n Commands_TpFailed;
|
||||
@i18nField(defaultValue = "用法: /dominion set_map_color <颜色> [领地名称]")
|
||||
public static i18n Commands_SetMapColorUsage;
|
||||
|
||||
@i18nField(defaultValue = "AutoCreateRadius 不能等于 0,已重置为 10")
|
||||
public static i18n Config_AutoCreateRadiusError;
|
||||
@i18nField(defaultValue = "AutoCleanAfterDays 不能等于 0,已重置为 180")
|
||||
public static i18n Config_AutoCleanAfterDaysError;
|
||||
@i18nField(defaultValue = "工具名称设置错误,已重置为 ARROW")
|
||||
public static i18n Config_ToolNameError;
|
||||
@i18nField(defaultValue = "Limit.SizeX 尺寸不能小于 4,已重置为 128")
|
||||
public static i18n Config_LimitSizeXError;
|
||||
@i18nField(defaultValue = "Limit.SizeY 尺寸不能小于 4,已重置为 64")
|
||||
public static i18n Config_LimitSizeYError;
|
||||
@i18nField(defaultValue = "Limit.SizeZ 尺寸不能小于 4,已重置为 128")
|
||||
public static i18n Config_LimitSizeZError;
|
||||
@i18nField(defaultValue = "Limit.MinY 不能大于或等于 Limit.MaxY,已重置为 -64 320")
|
||||
public static i18n Config_LimitMinYError;
|
||||
@i18nField(defaultValue = "Economy.Refund 设置不合法,已重置为 0.85")
|
||||
public static i18n Config_RefundError;
|
||||
@i18nField(defaultValue = "Economy.Price 设置不合法,已重置为 10.0")
|
||||
public static i18n Config_PriceError;
|
||||
@i18nField(defaultValue = "启用 Limit.Vert 时 Limit.SizeY 不能小于 Limit.MaxY - Limit.MinY,已自动调整为 %d")
|
||||
public static i18n Config_LimitSizeYAutoAdjust;
|
||||
|
||||
public Translation(JavaPlugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package cn.lunadeer.dominion.utils.i18n;
|
||||
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Localization {
|
||||
|
||||
public static Localization instance;
|
||||
private static final Map<String, List<i18n>> nodeMap = new HashMap<>();
|
||||
|
||||
private YamlConfiguration localeFile;
|
||||
|
||||
private final File languageFolder;
|
||||
|
||||
private String locale = "chinese-simplified";
|
||||
|
||||
public Localization(JavaPlugin plugin) {
|
||||
this.languageFolder = new File(plugin.getDataFolder(), "languages");
|
||||
if (!this.languageFolder.exists()) {
|
||||
this.languageFolder.mkdirs();
|
||||
plugin.saveResource("languages", true);
|
||||
}
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public static void registerNode(i18n i18n) {
|
||||
if (!nodeMap.containsKey(i18n.getSourceName())) {
|
||||
nodeMap.put(i18n.getSourceName(), new ArrayList<>());
|
||||
}
|
||||
nodeMap.get(i18n.getSourceName()).add(i18n);
|
||||
}
|
||||
|
||||
public void loadLocale(String locale) {
|
||||
this.locale = locale;
|
||||
File file = new File(languageFolder, this.locale + ".yml");
|
||||
if (!file.exists()) {
|
||||
XLogger.err("Locale file %s not found, using default locale.", locale);
|
||||
this.locale = "chinese-simplified";
|
||||
file = new File(languageFolder, this.locale + ".yml");
|
||||
}
|
||||
this.localeFile = YamlConfiguration.loadConfiguration(file);
|
||||
for (String name : nodeMap.keySet()) {
|
||||
if (!this.localeFile.contains(name)) {
|
||||
this.localeFile.createSection(name);
|
||||
}
|
||||
for (i18n i18n : nodeMap.get(name)) {
|
||||
String key = name + "." + i18n.getKey();
|
||||
if (!this.localeFile.contains(key)) {
|
||||
this.localeFile.set(key, i18n.trans());
|
||||
} else {
|
||||
i18n.trans(this.localeFile.getString(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.localeFile.save(file);
|
||||
} catch (Exception e) {
|
||||
XLogger.err("Failed to save locale file: %s", file.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package cn.lunadeer.dominion.utils.i18n;
|
||||
|
||||
import cn.lunadeer.minecraftpluginutils.XLogger;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class i18n {
|
||||
|
||||
private String translate;
|
||||
|
||||
private final String sourceName;
|
||||
private final String key;
|
||||
|
||||
public String trans() {
|
||||
return translate;
|
||||
}
|
||||
|
||||
public void trans(String translate) {
|
||||
this.translate = translate;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
private i18n(Class<?> source, String key, String defaultValue) {
|
||||
this.sourceName = source.getName().replace("cn.lunadeer.dominion.", "").replace(".", "-");
|
||||
this.key = key;
|
||||
this.translate = defaultValue;
|
||||
}
|
||||
|
||||
public static i18n create(Class<?> source, String key, String defaultValue) {
|
||||
i18n i18n = new i18n(source, key, defaultValue);
|
||||
Localization.registerNode(i18n);
|
||||
return i18n;
|
||||
}
|
||||
|
||||
public static void initializeI18nFields(Object obj) {
|
||||
Class<?> clazz = obj.getClass();
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
if (field.isAnnotationPresent(i18nField.class)) {
|
||||
i18nField annotation = field.getAnnotation(i18nField.class);
|
||||
String key = field.getName();
|
||||
i18n i18nValue = i18n.create(clazz, key, annotation.defaultValue());
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
field.set(obj, i18nValue);
|
||||
} catch (IllegalAccessException e) {
|
||||
XLogger.err("Failed to set i18n field %s", field.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package cn.lunadeer.dominion.utils.i18n;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface i18nField {
|
||||
String defaultValue();
|
||||
}
|
@ -6,56 +6,44 @@ Database:
|
||||
User: dominion
|
||||
Pass: dominion
|
||||
|
||||
# 自动圈地大小
|
||||
AutoCreateRadius: 10 #-1 表示不开启
|
||||
Language: zh-cn
|
||||
|
||||
AutoCreateRadius: 10
|
||||
|
||||
Limit:
|
||||
SpawnProtection: 10 # 出生点保护半径 出生点此范围内不允许圈地 -1 表示不开启
|
||||
MinY: -64 # 最小Y坐标
|
||||
MaxY: 320 # 最大Y坐标
|
||||
SizeX: 128 # X方向最大长度 -1:表示不限制
|
||||
SizeY: 64 # Y方向最大长度 -1:表示不限制
|
||||
SizeZ: 128 # Z方向最大长度 -1:表示不限制
|
||||
Amount: 10 # 最大领地数量 -1:表示不限制
|
||||
Depth: 3 # 子领地深度 0:不允许子领地 -1:不限制
|
||||
Vert: false # 是否自动延伸到 MaxY 和 MinY
|
||||
WorldBlackList: [ ] # 不允许领地的世界
|
||||
OpByPass: true # 是否允许OP无视领地限制
|
||||
SpawnProtection: 10
|
||||
MinY: -64
|
||||
MaxY: 320
|
||||
SizeX: 128
|
||||
SizeY: 64
|
||||
SizeZ: 128
|
||||
Amount: 10
|
||||
Depth: 3
|
||||
Vert: false
|
||||
WorldBlackList: [ ]
|
||||
OpByPass: true
|
||||
|
||||
Teleport:
|
||||
Enable: true
|
||||
# 传送延迟 秒
|
||||
Delay: 0
|
||||
# 冷却时间 秒
|
||||
CoolDown: 0
|
||||
|
||||
# 自动清理长时间未上线玩家的领地
|
||||
AutoCleanAfterDays: 180 # -1 表示不开启
|
||||
AutoCleanAfterDays: 180
|
||||
|
||||
# 圈地工具
|
||||
Tool: ARROW
|
||||
|
||||
# 经济系统 - 需要安装Vault插件
|
||||
Economy:
|
||||
Enable: false
|
||||
# 单价 - 每方块
|
||||
Price: 10.0
|
||||
# 是否只计算xz平面积
|
||||
OnlyXZ: false
|
||||
# 删除领地退还比例
|
||||
Refund: 0.85
|
||||
|
||||
# 飞行权限节点 - 拥有以下任意一个权限节点的玩家不会被本插件拦截飞行
|
||||
FlyPermissionNodes:
|
||||
- essentials.fly
|
||||
- cmi.command.fly
|
||||
|
||||
# 是否允许玩家从 Residence 迁移领地数据
|
||||
ResidenceMigration: false
|
||||
|
||||
# 权限组称号 - 使用权限组当作称号(需要PlaceholderAPI插件)
|
||||
# Papi: %dominion_group_title%
|
||||
# 前后缀如需要加颜色请使用这种格式 &#ffffff
|
||||
GroupTitle:
|
||||
Enable: false
|
||||
Prefix: "["
|
||||
@ -68,4 +56,4 @@ CheckUpdate: true
|
||||
|
||||
Debug: false
|
||||
|
||||
Timer: false # 性能测试计时器
|
||||
Timer: false
|
Loading…
x
Reference in New Issue
Block a user