mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2024-10-19 04:46:40 +08:00
修复了部分领地tp点报错未捕获异常问题
This commit is contained in:
parent
150939dc45
commit
ba495d9bd7
@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "cn.lunadeer"
|
group = "cn.lunadeer"
|
||||||
version = "2.2.2-beta"
|
version = "2.2.3-beta"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
|
@ -392,6 +392,10 @@ public class DominionOperate {
|
|||||||
int x = (dominionDTO.getX1() + dominionDTO.getX2()) / 2;
|
int x = (dominionDTO.getX1() + dominionDTO.getX2()) / 2;
|
||||||
int z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
int z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
||||||
World world = Dominion.instance.getServer().getWorld(dominionDTO.getWorld());
|
World world = Dominion.instance.getServer().getWorld(dominionDTO.getWorld());
|
||||||
|
if (world == null) {
|
||||||
|
Notification.error(sender, "领地所在世界 %s 不存在", dominionDTO.getWorld());
|
||||||
|
return;
|
||||||
|
}
|
||||||
location = new Location(world, x, player.getLocation().getY(), z);
|
location = new Location(world, x, player.getLocation().getY(), z);
|
||||||
XLogger.warn("领地 %s 没有设置传送点,将尝试传送到中心点", dominionDTO.getName());
|
XLogger.warn("领地 %s 没有设置传送点,将尝试传送到中心点", dominionDTO.getName());
|
||||||
}
|
}
|
||||||
@ -460,6 +464,10 @@ public class DominionOperate {
|
|||||||
int center_x = (dominionDTO.getX1() + dominionDTO.getX2()) / 2;
|
int center_x = (dominionDTO.getX1() + dominionDTO.getX2()) / 2;
|
||||||
int center_z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
int center_z = (dominionDTO.getZ1() + dominionDTO.getZ2()) / 2;
|
||||||
World world = Dominion.instance.getServer().getWorld(dominionDTO.getWorld());
|
World world = Dominion.instance.getServer().getWorld(dominionDTO.getWorld());
|
||||||
|
if (world == null) {
|
||||||
|
Notification.error(player, "领地所在世界 %s 不存在", dominionDTO.getWorld());
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
location = new Location(world, center_x, player.getLocation().getY(), center_z);
|
location = new Location(world, center_x, player.getLocation().getY(), center_z);
|
||||||
Notification.warn(player, "领地 %s 没有设置传送点,将尝试传送到中心点", dominionDTO.getName());
|
Notification.warn(player, "领地 %s 没有设置传送点,将尝试传送到中心点", dominionDTO.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user