修复了错误的放置检测逻辑

This commit is contained in:
zhangyuheng 2024-02-26 20:22:53 +08:00
parent 606d7b8a3b
commit 4af0ba761d
3 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.11.2-beta</version>
<version>1.11.3-beta</version>
<packaging>jar</packaging>
<name>Dominion</name>

View File

@ -98,9 +98,11 @@ public class DominionController {
return null;
}
// 是否是父领地的拥有者
if (notOwner(owner, parent_dominion) && parent_dominion.getId() != -1) {
if (parent_dominion.getId() != -1) {
if (notOwner(owner, parent_dominion)) {
return null;
}
}
// 如果parent_dominion不为-1 检查是否在同一世界
if (parent_dominion.getId() != -1 && !parent_dominion.getWorld().equals(dominion.getWorld())) {
Notification.error(owner, "禁止跨世界操作");

View File

@ -887,7 +887,7 @@ public class PlayerEvents implements Listener {
public static boolean onPlace(Player player) {
DominionDTO dom = Cache.instance.getPlayerCurrentDominion(player);
if (dom == null) {
return false;
return true;
}
if (Apis.hasPermission(player, dom)) {
return true;