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


Java World.setWorldTime方法代码示例

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


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

示例1: onFinish

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void onFinish(EntityPlayer player, IRitualHandler tile, World world, BlockPos pos, NBTTagCompound tag) {
	if (!world.isRemote) world.setWorldTime(17600);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:5,代码来源:RitualHighMoon.java

示例2: onUpdate

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void onUpdate(EntityPlayer player, IRitualHandler tile, World world, BlockPos pos, NBTTagCompound data, int ticks) {
	world.setWorldTime(world.getWorldTime() + 5);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:5,代码来源:RitualSandsTime.java

示例3: execute

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
protected void execute()
{
    // Set up some initial conditions:
    ServerSection ss = currentMissionInit().getMission().getServerSection();
    ServerInitialConditions sic = (ss != null) ? ss.getServerInitialConditions() : null;
    if (sic != null && sic.getTime() != null)
    {
        boolean allowTimeToPass = (sic.getTime().isAllowPassageOfTime() != Boolean.FALSE);  // Defaults to true if unspecified.
        MinecraftServer server = MinecraftServer.getServer();
        if (server.worldServers != null && server.worldServers.length != 0)
        {
            for (int i = 0; i < MinecraftServer.getServer().worldServers.length; ++i)
            {
                World world = MinecraftServer.getServer().worldServers[i];
                world.getGameRules().setOrCreateGameRule("doDaylightCycle", allowTimeToPass ? "true" : "false");
                if (sic.getTime().getStartTime() != null)
                    world.setWorldTime(sic.getTime().getStartTime());
            }
        }
    }
    ModSettings modsettings = currentMissionInit().getMission().getModSettings();
    if (modsettings != null && modsettings.getMsPerTick() != null)
        TimeHelper.serverTickLength = (long)(modsettings.getMsPerTick());
        
    if (getHandlers().quitProducer != null)
        getHandlers().quitProducer.prepare(currentMissionInit());

    if (getHandlers().worldDecorator != null)
        getHandlers().worldDecorator.prepare(currentMissionInit());

    // Fire the starting pistol:
    MalmoMod.safeSendToAll(MalmoMessageType.SERVER_GO);
    // And start the turn schedule turning, if there is one:
    if (!ServerStateMachine.this.userTurnSchedule.isEmpty())
    {
        String agentName = ServerStateMachine.this.userTurnSchedule.get(0);
        ServerConfigurationManager scoman = MinecraftServer.getServer().getConfigurationManager();
        EntityPlayerMP player = scoman.getPlayerByUsername(agentName);
        if (player != null)
        {
            MalmoMod.network.sendTo(new MalmoMod.MalmoMessage(MalmoMessageType.SERVER_YOUR_TURN, ""), player);
        }
        else if (getHandlers().worldDecorator != null)
        {
            // Not a player - is it a world decorator?
            getHandlers().worldDecorator.targetedUpdate(agentName);
        }
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:51,代码来源:ServerStateMachine.java

示例4: setTime

import net.minecraft.world.World; //导入方法依赖的package包/类
public static void setTime(World world, long val) { world.setWorldTime(val); } 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:2,代码来源:ZWrapper.java


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