mirror of
https://github.com/CarmJos/MoeTeleport.git
synced 2026-06-04 16:46:10 +08:00
[F] 修复玩家可以给自己发送传送请求的问题
This commit is contained in:
@@ -23,6 +23,12 @@ public class TpaCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player == target) {
|
||||||
|
// fix #5 - 玩家给自己发送传送请求
|
||||||
|
PluginMessages.SELF_REQUEST.sendWithPlaceholders(player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
TeleportRequest request = Main.getUserManager().getData(target).getReceivedRequests().get(player.getUniqueId());
|
TeleportRequest request = Main.getUserManager().getData(target).getReceivedRequests().get(player.getUniqueId());
|
||||||
if (request != null) {
|
if (request != null) {
|
||||||
PluginMessages.Request.DUPLICATE.sendWithPlaceholders(sender,
|
PluginMessages.Request.DUPLICATE.sendWithPlaceholders(sender,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public class PluginMessages {
|
|||||||
public static final ConfigMessageList NO_LAST_LOCATION = new ConfigMessageList("no-last-location");
|
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 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 = new ConfigMessageList("tpa");
|
||||||
public static final ConfigMessageList TPA_HERE = new ConfigMessageList("tpahere");
|
public static final ConfigMessageList TPA_HERE = new ConfigMessageList("tpahere");
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ death-back:
|
|||||||
|
|
||||||
not-online:
|
not-online:
|
||||||
- "&f目标玩家并不在线,无法发送请求。"
|
- "&f目标玩家并不在线,无法发送请求。"
|
||||||
|
|
||||||
|
self-request:
|
||||||
|
- "&f您不能向自己发送请求。"
|
||||||
|
|
||||||
tpa:
|
tpa:
|
||||||
- "&d%(player) &f请求传送到您身边,您有 &5%(expire)秒 &f的时间回应。"
|
- "&d%(player) &f请求传送到您身边,您有 &5%(expire)秒 &f的时间回应。"
|
||||||
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
|
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
|
||||||
|
|||||||
Reference in New Issue
Block a user