fix get world error
All checks were successful
Java CI-CD with Maven / build (push) Successful in 37m45s
All checks were successful
Java CI-CD with Maven / build (push) Successful in 37m45s
This commit is contained in:
parent
7b591f4ccf
commit
9d7d564457
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>site.deercloud</groupId>
|
||||
<artifactId>LiteWorldEdit</artifactId>
|
||||
<version>2.2.0.0</version>
|
||||
<version>2.2.1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>LiteWorldEdit</name>
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import site.deercloud.liteworldedit.Notification;
|
||||
|
||||
public class Job {
|
||||
protected World _world;
|
||||
@ -27,11 +28,11 @@ public class Job {
|
||||
}
|
||||
|
||||
static public Boolean in_range(Player player, Location location) {
|
||||
if (player.getWorld() != location.getWorld()) {
|
||||
if (!player.getWorld().getName().equals(location.getWorld().getName())) {
|
||||
return false;
|
||||
}
|
||||
if (player.getLocation().distance(location) > 128) {
|
||||
player.sendMessage(ChatColor.RED + "不允许超过128格操作!");
|
||||
Notification.error(player, "不允许超过128格操作!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user