mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2025-02-04 22:49:41 +08:00
领地提示语新增支持占位符
This commit is contained in:
parent
a8e36f4759
commit
c30e5d9d66
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>Dominion</artifactId>
|
||||
<version>1.30.10-beta</version>
|
||||
<version>1.30.11-beta</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dominion</name>
|
||||
|
@ -141,14 +141,18 @@ public class Cache {
|
||||
// Notification.info(player, "您已离开领地:%s", last_dominion.getName());
|
||||
// else
|
||||
// Notification.info(player, "您已离开子领地:%s", last_dominion.getName());
|
||||
player.sendActionBar(Component.text(last_dominion.getLeaveMessage()));
|
||||
String msg = last_dominion.getLeaveMessage();
|
||||
msg = msg.replace("${DOM_NAME}", last_dominion.getName());
|
||||
player.sendActionBar(Component.text(msg));
|
||||
}
|
||||
if (current_dom_id != -1) {
|
||||
// if (current_dominion.getParentDomId() == -1)
|
||||
// Notification.info(player, "您正在进入领地:%s", current_dominion.getName());
|
||||
// else
|
||||
// Notification.info(player, "您正在进入子领地:%s", current_dominion.getName());
|
||||
player.sendActionBar(Component.text(current_dominion.getJoinMessage()));
|
||||
String msg = current_dominion.getJoinMessage();
|
||||
msg = msg.replace("${DOM_NAME}", current_dominion.getName());
|
||||
player.sendActionBar(Component.text(msg));
|
||||
}
|
||||
|
||||
lightOrNot(player, current_dominion); // 发光检查
|
||||
|
@ -111,12 +111,12 @@ public class DominionDTO {
|
||||
for (Flag f : Flag.getAllDominionFlags()) {
|
||||
sql += f.getFlagName() + ", ";
|
||||
}
|
||||
sql += "tp_location";
|
||||
sql += "tp_location, join_message, leave_message";
|
||||
sql += ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ";
|
||||
for (Flag f : Flag.getAllDominionFlags()) {
|
||||
sql += f.getDefaultValue() + ", ";
|
||||
}
|
||||
sql += "'default'";
|
||||
sql += "'default', ?, ?)";
|
||||
sql += ") RETURNING *;";
|
||||
List<DominionDTO> dominions = query(sql,
|
||||
dominion.getOwner(),
|
||||
@ -127,7 +127,10 @@ public class DominionDTO {
|
||||
dominion.getZ1(),
|
||||
dominion.getX2(),
|
||||
dominion.getY2(),
|
||||
dominion.getZ2());
|
||||
dominion.getZ2(),
|
||||
"欢迎来到 ${DOM_NAME}!",
|
||||
"你正在离开 ${DOM_NAME},欢迎下次光临~"
|
||||
);
|
||||
if (dominions.size() == 0) return null;
|
||||
return dominions.get(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user