1
mirror of https://github.com/CarmJos/MoeTeleport.git synced 2024-09-19 21:35:56 +00:00

[F] 修复玩家可以给自己发送传送请求的问题

This commit is contained in:
Carm Jos 2022-02-24 16:00:24 +08:00
parent b5f6794a85
commit 948b4f1915
3 changed files with 11 additions and 0 deletions

View File

@ -23,6 +23,12 @@ public class TpaCommand implements CommandExecutor {
return true;
}
if (player == target) {
// fix #5 - 玩家给自己发送传送请求
PluginMessages.SELF_REQUEST.sendWithPlaceholders(player);
return true;
}
TeleportRequest request = Main.getUserManager().getData(target).getReceivedRequests().get(player.getUniqueId());
if (request != null) {
PluginMessages.Request.DUPLICATE.sendWithPlaceholders(sender,

View File

@ -8,6 +8,7 @@ public class PluginMessages {
public static final ConfigMessageList NO_LAST_LOCATION = new ConfigMessageList("no-last-location");
public static final ConfigMessageList NOT_ONLINE = new ConfigMessageList("not-online");
public static final ConfigMessageList SELF_REQUEST = new ConfigMessageList("self-request");
public static final ConfigMessageList TPA = new ConfigMessageList("tpa");
public static final ConfigMessageList TPA_HERE = new ConfigMessageList("tpahere");

View File

@ -6,6 +6,10 @@ death-back:
not-online:
- "&f目标玩家并不在线无法发送请求。"
self-request:
- "&f您不能向自己发送请求。"
tpa:
- "&d%(player) &f请求传送到您身边您有 &5%(expire)秒 &f的时间回应。"
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"