1
mirror of https://github.com/CarmJos/cn2b2t-project.git synced 2024-09-19 22:05:45 +00:00

重生随机传送

This commit is contained in:
carm 2020-05-27 13:39:28 +08:00
parent ba292d57c1
commit 445bec9bf5

View File

@ -23,11 +23,10 @@ public class RespawnListener implements Listener {
p.setFoodLevel(30);
if (ProfileData.getProfileData(p).isBedThere()) {
p.teleport(ProfileData.getProfileData(p).bedLocation);
e.setRespawnLocation(ProfileData.getProfileData(p).bedLocation);
} else {
p.sendMessage("§7由于您之前的床已被破坏或遮挡无法将您传送到您的床边。");
p.teleport(randomLocation(Bukkit.getWorld("world")));
e.setRespawnLocation(randomLocation(Bukkit.getWorld("world")));
}
}
@ -52,7 +51,6 @@ public class RespawnListener implements Listener {
int x = -3000 + r.nextInt(6001);
int z = -3000 + r.nextInt(6001);
int y = w.getHighestBlockYAt(x, z);
System.out.println("new random location is " + x + " " + y + " " + z);
return new Location(w, x, y, z);
}