SpawnCommand.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:vanillacraft 作者:
@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");
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号