@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
{
if (!event.isCancelled())
{
Player player = event.getPlayer();
String command[] = event.getMessage().split(" ");
if (command[0].equalsIgnoreCase("/spawn"))
{
if (player.getLocation().getWorld() == plugin.getCoreData().getSpawnLocation().getWorld())
{
plugin.getCoreMethods().teleport(player, plugin.getCoreData().getSpawnLocation());
}
else
{
plugin.getCoreErrors().mustBeInWorld(player, "main world");
}
}
}
}
SpawnCommand.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:vanillacraft
作者:
评论列表
文章目录