修复了操作领地时自动选择领地失败问题

This commit is contained in:
zhangyuheng 2024-05-31 21:03:00 +08:00
parent a34cc43cbf
commit 5d614d4760
2 changed files with 5 additions and 7 deletions

View File

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

View File

@ -3,12 +3,7 @@ package cn.lunadeer.dominion.controllers;
import cn.lunadeer.dominion.Cache;
import cn.lunadeer.dominion.dtos.DominionDTO;
import cn.lunadeer.dominion.dtos.PlayerPrivilegeDTO;
import cn.lunadeer.minecraftpluginutils.Notification;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import java.util.List;
public class Apis {
@ -43,7 +38,10 @@ public class Apis {
return null;
}
DominionDTO dominion = Cache.instance.getDominion(location);
if (dominion == null || dominion.getParentDomId() != -1) {
if (dominion == null) {
return null;
}
if (dominion.getParentDomId() == -1) {
return dominion;
} else {
player.setResponse(new AbstractOperator.Result(AbstractOperator.Result.FAILURE, "你当前在子领地内,请指定要操作的领地名称"));