当前位置: 首页>>代码示例>>Java>>正文


Java Player.resetPlayerTime方法代码示例

本文整理汇总了Java中org.bukkit.entity.Player.resetPlayerTime方法的典型用法代码示例。如果您正苦于以下问题:Java Player.resetPlayerTime方法的具体用法?Java Player.resetPlayerTime怎么用?Java Player.resetPlayerTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.entity.Player的用法示例。


在下文中一共展示了Player.resetPlayerTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stop

import org.bukkit.entity.Player; //导入方法依赖的package包/类
/**
 * Stops the tutorial for the given player.
 *
 * @param id The UUID of the player.
 * @param interrupted {@code true} if the tutorial is stopped because it was interrupted
 *                    using {@link #stopForAll(String)}, {@link #stop(UUID)} or if the
 *                    user disconnected.
 */
void stop(UUID id, final Boolean interrupted) // package-private
{
    if (!isWatchingTutorial(id)) return;

    Player player = p.getServer().getPlayer(id);

    if (player != null)
    {
        // The player can now move.
        player.setFlySpeed(0.1f);
        player.setFlying(false);
        player.setAllowFlight(false);

        // All other players are displayed
        for (Player other : p.getServer().getOnlinePlayers())
        {
            player.showPlayer(other);
            other.showPlayer(player);
        }

        player.resetPlayerTime();
    }

    try
    {
        viewers.get(id).cancel();
    }
    catch (IllegalStateException ignored) {}

    viewers.remove(id);

    onTutorialEnds(player, interrupted);
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:42,代码来源:Tutorial.java

示例2: onCommand

import org.bukkit.entity.Player; //导入方法依赖的package包/类
@Override
protected void onCommand(CommandSender sender, String[] args) {
    Player p = (Player) sender;

    for (Time t : Time.values()) {
        if (t.name().equalsIgnoreCase(args[0])) {
            p.setPlayerTime(t.getTime(), false);
            p.sendMessage(ChatColor.GOLD + "Time set to " + t.name().toLowerCase() + ".");
            return;
        }
    }

    if(args[0].equalsIgnoreCase("reset")) {
        p.resetPlayerTime();
        sender.sendMessage(ChatColor.GOLD + "Clock synced.");
    } else {
        p.setPlayerTime(Integer.parseInt(args[0]), false);
        sender.sendMessage(ChatColor.GOLD + "Time set to " + ChatColor.RED + args[0]);
    }
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:21,代码来源:CommandPTime.java

示例3: apply

import org.bukkit.entity.Player; //导入方法依赖的package包/类
protected CommandResult apply(VPSender receiver, String label, List<String> args, boolean other, VPSender sender) {
    if(!(receiver instanceof VPPlayer))return CommandResult.FAIL;
    Player player = ((VPPlayer) receiver).getPlayer(); 
    if(value<0 && ! relative){
        if(!player.isPlayerTimeRelative())
            player.resetPlayerTime();
        else
            return CommandResult.CANCELED;
    }else{
        if(!relative && player.getPlayerTimeOffset() == value)
            return CommandResult.CANCELED;
        else
            player.setPlayerTime(value, relative);
    }
    return CommandResult.SUCCESS;
}
 
开发者ID:dracnis,项目名称:VanillaPlus,代码行数:17,代码来源:CPTOD.java


注:本文中的org.bukkit.entity.Player.resetPlayerTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。