卫星地图展示新增所有人名称 #12

This commit is contained in:
zhangyuheng 2024-09-06 17:25:49 +08:00
parent 04c3036f2c
commit 18632f9094
5 changed files with 17 additions and 2 deletions

View File

@ -4,7 +4,7 @@ plugins {
}
group = "cn.lunadeer"
version = "2.6.1-beta"
version = "2.6.2-beta"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))

View File

@ -504,6 +504,8 @@ public class Translation extends Localization {
public static i18n Messages_PlaceholderAPIRegisterSuccess;
@i18nField(defaultValue = "共加载了 %d 个领地组")
public static i18n Messages_LoadedGroupAmount;
@i18nField(defaultValue = "<div>%s</div><div>所有人:%s</div>")
public static i18n Messages_MapInfoDetail;
@i18nField(defaultValue = "开始自动清理长时间未登录玩家领地数据")
public static i18n Messages_AutoCleanStart;

View File

@ -2,6 +2,7 @@ package cn.lunadeer.dominion.utils.map;
import cn.lunadeer.dominion.Cache;
import cn.lunadeer.dominion.dtos.DominionDTO;
import cn.lunadeer.dominion.dtos.PlayerDTO;
import cn.lunadeer.dominion.managers.Translation;
import cn.lunadeer.minecraftpluginutils.Scheduler;
import cn.lunadeer.minecraftpluginutils.XLogger;
@ -37,6 +38,11 @@ public class BlueMapConnect {
.build();
for (DominionDTO dominion : d.getValue()) {
PlayerDTO p = PlayerDTO.select(dominion.getOwner());
if (p == null) {
continue;
}
Collection<Vector2d> vectors = new ArrayList<>();
vectors.add(new Vector2d(dominion.getX1() + 0.001, dominion.getZ1() + 0.001));
vectors.add(new Vector2d(dominion.getX2() - 0.001, dominion.getZ1() + 0.001));
@ -55,6 +61,7 @@ public class BlueMapConnect {
Color fill = new Color(r, g, b, 0.2F);
ExtrudeMarker marker = ExtrudeMarker.builder()
.label(dominion.getName())
.detail(String.format(Translation.Messages_MapInfoDetail.trans(), dominion.getName(), p.getLastKnownName()))
.position(x, y, z)
.shape(shape, dominion.getY1() + 0.001f, dominion.getY2() - 0.001f)
.lineColor(line)

View File

@ -1,6 +1,7 @@
package cn.lunadeer.dominion.utils.map;
import cn.lunadeer.dominion.dtos.DominionDTO;
import cn.lunadeer.dominion.dtos.PlayerDTO;
import cn.lunadeer.dominion.managers.Translation;
import cn.lunadeer.minecraftpluginutils.Scheduler;
import cn.lunadeer.minecraftpluginutils.XLogger;
@ -40,7 +41,11 @@ public class DynmapConnect extends DynmapCommonAPIListener {
}
private void setDominionMarker(DominionDTO dominion) {
String nameLabel = "<div>" + dominion.getName() + "</div>";
PlayerDTO p = PlayerDTO.select(dominion.getOwner());
if (p == null) {
return;
}
String nameLabel = String.format(Translation.Messages_MapInfoDetail.trans(), dominion.getName(), p.getLastKnownName());
double[] xx = {dominion.getX1(), dominion.getX2()};
double[] zz = {dominion.getZ1(), dominion.getZ2()};
if (dominion.getWorld() == null) {

View File

@ -250,6 +250,7 @@ Messages:
AutoCleanStart: 开始自动清理长时间未登录玩家领地数据
AutoCleanPlayer: 已清理玩家 %s 的领地数据
AutoCleanEnd: 自动清理完成
MapInfoDetail: <div>%s</div><div>所有人:%s</div>
TUI:
NotDominionOwnerOrAdminForPage: 你不是领地 %s 的拥有者或管理员,无权访问此页面
CommandHelp: