Skip to content

Commit

Permalink
修复了当关闭领地传送时拥有者也无法传送的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Jun 12, 2024
1 parent d492663 commit 78095df
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main/java/cn/lunadeer/dominion/commands/DominionOperate.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,17 @@ public static void teleportToDominion(CommandSender sender, String[] args) {
}

PlayerPrivilegeDTO privilegeDTO = PlayerPrivilegeDTO.select(player.getUniqueId(), dominionDTO.getId());
if (privilegeDTO == null) {
if (!dominionDTO.getFlagValue(Flag.TELEPORT)) {
Notification.error(sender, "此领地禁止传送");
return;
}
} else {
if (!privilegeDTO.getFlagValue(Flag.TELEPORT)) {
Notification.error(sender, "你不被允许传送到这个领地");
return;
if (!player.getUniqueId().equals(dominionDTO.getOwner())) { // 领地所有人可以传送到自己的领地
if (privilegeDTO == null) {
if (!dominionDTO.getFlagValue(Flag.TELEPORT)) {
Notification.error(sender, "此领地禁止传送");
return;
}
} else {
if (!privilegeDTO.getFlagValue(Flag.TELEPORT)) {
Notification.error(sender, "你不被允许传送到这个领地");
return;
}
}
}

Expand Down

0 comments on commit 78095df

Please sign in to comment.