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


Java World.setTime方法代码示例

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


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

示例1: onGameStart

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Set always night
 * @param game Game instance
 */
@Override
public void onGameStart(SurvivalGame game)
{
    World world = this.plugin.getServer().getWorlds().get(0);
    world.setGameRuleValue("doDaylightCycle", "false");
    world.setTime(15000);

    for (GamePlayer player : (Collection<GamePlayer>) game.getInGamePlayers().values())
    {
        Player p = player.getPlayerIfOnline();

        if (p == null)
            continue;

        p.playSound(p.getLocation(), Sound.WITHER_SPAWN, 0.9F, 1F);
    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:22,代码来源:NightmareModule.java

示例2: loadWorlds

import org.bukkit.World; //导入方法依赖的package包/类
private void loadWorlds() {
    for (World w : getServer().getWorlds()) {
        EnvironmentManager.despawnEntities(w.getEntities().toArray(new Entity[w.getEntities().size()]));
        w.setThunderDuration(0);
        w.setWeatherDuration(0);
        w.setStorm(false);
        w.setThundering(false);
        if (!w.getName().equals(BOSS_WORLD))
            w.setTime(0);
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:12,代码来源:SakiRPG.java

示例3: setTime

import org.bukkit.World; //导入方法依赖的package包/类
private void setTime() {
	String time = getTime();
	World world = SkyWarsReloaded.get().getServer().getWorld(mapName + "_" + gameNumber);
	if (time.equalsIgnoreCase("dawn")) {
		world.setTime(0);
	} else if (time.equalsIgnoreCase("noon")) {
		world.setTime(6000);
	} else if (time.equalsIgnoreCase("dusk")) {
		world.setTime(12000);
	} else if (time.equalsIgnoreCase("midnight")) {
		world.setTime(18000);
	}
}
 
开发者ID:smessie,项目名称:SkyWarsReloaded,代码行数:14,代码来源:Game.java

示例4: KillToToggleTimeModule

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param plugin Parent plugin
 * @param api API instance
 * @param moduleConfiguration Module configuration
 */
public KillToToggleTimeModule(SurvivalPlugin plugin, SurvivalAPI api, Map<String, Object> moduleConfiguration)
{
    super(plugin, api, moduleConfiguration);

    for (World world : plugin.getServer().getWorlds())
    {
        world.setTime(DAY);
        world.setGameRuleValue("doDaylightCycle", "false");
    }

    this.isDay = true;
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:20,代码来源:KillToToggleTimeModule.java

示例5: onPlayerDeath

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Toggle worlds times when a player die
 *
 * @param event Event
 */
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event)
{
    for (World world : this.plugin.getServer().getWorlds())
        world.setTime(this.isDay ? NIGHT : DAY);

    this.isDay = !this.isDay;
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:14,代码来源:KillToToggleTimeModule.java

示例6: skipNight

import org.bukkit.World; //导入方法依赖的package包/类
public static void skipNight() {
    if (getSleepCount() < getNeededPlayers())
        return; // We don't have enough players sleeping.

    World world = Core.getMainWorld();
    world.setTime(0);
    world.setStorm(false);
    Bukkit.broadcastMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + " * The night has been vanquished by the wonders of sleep. *");
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:10,代码来源:SleepMechanics.java

示例7: prepareWorld

import org.bukkit.World; //导入方法依赖的package包/类
public void prepareWorld(World w) {
    w.setPVP(true);
    w.setGameRuleValue("doDaylightCycle", "false");
    w.setStorm(false);
    w.setDifficulty(Difficulty.PEACEFUL);
    w.setTime(14000);
    w.getLivingEntities().stream().filter(e -> !e.getType().equals(EntityType.PLAYER)).forEach(Entity::remove);
    initArena();
    w.setAutoSave(false);
}
 
开发者ID:cadox8,项目名称:PA,代码行数:11,代码来源:ArenaManager.java

示例8: start

import org.bukkit.World; //导入方法依赖的package包/类
@Override
public void start() {
    World world = getPhase().getFeature(MapFeature.class).getWorld();
    world.setGameRuleValue("doDaylightCycle", shouldChange + "");
    world.setTime(time);
}
 
开发者ID:VoxelGamesLib,项目名称:VoxelGamesLibv2,代码行数:7,代码来源:TimeFeature.java


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