本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例4: setTime
import net.minecraft.world.World; //导入方法依赖的package包/类
public static void setTime(World world, long val) { world.setWorldTime(val); }