rtp强制传送到主世界
This commit is contained in:
parent
cbf9718fb0
commit
e50f0d035c
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>EssentialsD</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>EssentialsD</name>
|
||||
|
@ -199,7 +199,18 @@ public class TeleportManager {
|
||||
}
|
||||
if (CoolingDown(player)) return;
|
||||
int radius = EssentialsD.config.getTpRtpRadius();
|
||||
World world = player.getWorld();
|
||||
// get main world
|
||||
World world = null;
|
||||
for (World w : EssentialsD.instance.getServer().getWorlds()) {
|
||||
if (w.getEnvironment() == World.Environment.NORMAL) {
|
||||
world = w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (world == null) {
|
||||
Notification.error(player, "未找到主世界");
|
||||
return;
|
||||
}
|
||||
int x = (int) (Math.random() * radius * 2) - radius + (int) player.getLocation().getX();
|
||||
int z = (int) (Math.random() * radius * 2) - radius + (int) player.getLocation().getZ();
|
||||
XLogger.debug("RTP: " + x + " " + z);
|
||||
|
Loading…
Reference in New Issue
Block a user