@SubscribeEvent public void update(ServerTickEvent evt) { long curTime = world.getTotalWorldTime(); if(curTime % checkPeriod != 0) { return; } if(preCondition != null && !preCondition.isConditionMet(world, structure, worldPos)) { return; } int curNum = getNumResidentsInHomeBounds(); if(curNum >= numSpawned) { //TODO: Optional to wait for all to be dead? lastTimePresent = world.getTotalWorldTime(); } else if(curTime - lastTimePresent >= respawnRate) { spawnResidents(numSpawned - curNum); } }
@SubscribeEvent(priority=EventPriority.LOWEST) public void tickEventEnd(ServerTickEvent event) { if(event.phase == Phase.END) { getTimedGroup("other").endTimer(); root.endTick(true); if(debugTimer) System.out.println("Tick time used: " + (root.getTimeUsed()/root.timeMilisecond) + "ms"); //After every world is done ticking, re-balance the time slices according //to the data gathered during the tick. root.balanceTime(); //Calculate TPS updateTPS(); if(saveConfig) { saveConfig = false; config.save(); } } }
@SubscribeEvent public void onTick(ServerTickEvent e) { if (e.phase == Phase.END) { if (!chunksToGen.isEmpty()) { GenData data = chunksToGen.pop(); Chunk chunk = data.chunk; if (data.level == 0) { yttrGen.generate(chunk.worldObj.rand, chunk.xPosition, chunk.zPosition, chunk.worldObj, null, null); } else if (data.level == 1) { xenoGen.generate(chunk.worldObj.rand, chunk.xPosition, chunk.zPosition, chunk.worldObj, null, null); } chunk.setChunkModified(); log.info("Retrogenerating "+chunk.xPosition+", "+chunk.zPosition); } } }
@SubscribeEvent public void onTick(ServerTickEvent event) { if(event.phase == Phase.END && event.side == Side.SERVER) { tickEnd(); } }
@SubscribeEvent public void onServerTick(ServerTickEvent event) { if (event.phase == Phase.START) { for (Iterator<Map.Entry<EntityPlayer, VRPlayerData>> it = ProxyServer.vrPlayers.entrySet().iterator(); it.hasNext(); ) { Map.Entry<EntityPlayer, VRPlayerData> entry = it.next(); EntityPlayer player = entry.getKey(); if (player.isDead) { it.remove(); continue; } VRPlayerData data = entry.getValue(); if (data.entities.size() != (data.seated ? 1 : 3)) { createEntities(player, data); } else { for (EntityVRObject entity : data.entities) { //System.out.println(entity.getClass().getSimpleName() + " " + entity.posX + " " + entity.posY + " " + entity.posZ); if (!entity.isSpawned()) { if (entity.worldObj.spawnEntityInWorld(entity)) entity.setSpawned(); } if (entity.isDead || entity.worldObj != player.worldObj) { createEntities(player, data); break; } } } } } }
@SubscribeEvent public void onServerTick(final ServerTickEvent event) { try { for (final IQuake quake : this.quakes) { final Queue<IQuakeNode> nodes = quake.getQuakeUpdate(); IQuakeNode line; while ((line = nodes.poll())!=null) EEWReciever2.EVENT_BUS.post(line.getEvent()); } } catch (final QuakeException e) { Reference.logger.error(e.getMessage(), e); } }
@SubscribeEvent public void onServerTick(ServerTickEvent event) { if (!addServerTick.isEmpty()) { hServerTick.addAll(addServerTick); addServerTick.clear(); } for (Iterator<LIHandler> it = hServerTick.iterator(); it.hasNext(); ) { LIHandler handler = it.next(); if (handler.isDead()) it.remove(); else handler.trigger(event); } }
@SubscribeEvent public void update(ServerTickEvent evt) { long curTime = world.getTotalWorldTime(); if(executionInterval > 0 && curTime % executionInterval != 0) { return; } if(condition != null && !condition.isConditionMet(world, structure, worldPosition)) { return; } if(action != null) { action.doAction(world, structure, worldPosition); } }
@SubscribeEvent public void update(ServerTickEvent evt) { ListIterator<TimedAction> iter = deferedActions.listIterator(); while(iter.hasNext()) { TimedAction action = iter.next(); if(action.performThisTick()) { iter.remove(); } } }
@SuppressWarnings("static-method") @SideOnly(Side.SERVER) @SubscribeEvent public void serverTick(ServerTickEvent event) { if (event.phase == Phase.START) { sendAnalyticsActivityEvent(); } }
/** * For internal use only. Do not call. */ @SubscribeEvent public void onServerTick(ServerTickEvent event) { if (event.phase == Phase.END) { runTasks(serverQueue); } }
@SubscribeEvent public void onTick(ServerTickEvent evt) { if (evt.phase == Phase.END) { for (Entry<INetworkUpdatable, Integer> entry : networkUpdatables.entrySet()) { final INetworkUpdatable te = entry.getKey(); if (te != null) { int i = entry.getValue(); if (i-- <= 0) { int[] data = networkUpdatableData.get(te); boolean needUpdate = false; for (int j = 0; j < data.length; j++) { int value = te.getNetworkUpdate(j); if (value != data[j]) { data[j] = value; needUpdate = true; } } if (needUpdate) { PacketHandler.sendToAllAround(new PacketNetworkUpdate((TileEntity) te, data), (TileEntity) te); } entry.setValue(te.getNetworkUpdateCheckInterval()); } else { entry.setValue(i); } } } } }
@SubscribeEvent public void onTick(ServerTickEvent evt) { if (evt.phase == Phase.END && !queue.isEmpty()) { Runnable task = queue.poll(); if (task != null) { task.run(); } } }
@SubscribeEvent private void tickStartChecker(ServerTickEvent event) { if (event.phase == Phase.START) { tickStart(); } }
@SubscribeEvent public void onServerTick(ServerTickEvent event) { if (Framez.proxy.isGamePaused()) return; for (World w : MinecraftServer.getServer().worldServers) tick(w, event.phase); }
@SubscribeEvent public void onServerTick(ServerTickEvent ev) { /* * Manage cooldown mapused for spawning minions */ for (Entry<String, Integer> entry : rpgPluscooldownMap.entrySet()) { if (entry.getValue() > 0) { entry.setValue(entry.getValue() - 1); } } }
@SubscribeEvent public void tickEnd(ServerTickEvent evt) { if (evt.phase == Phase.END) { Iterator<CellphoneSessionBase> itr = sessions.iterator(); while (itr.hasNext()) { CellphoneSessionBase session = itr.next(); session.tick(); if (!session.isValid()) { itr.remove(); } } } }
@SuppressWarnings("unchecked") @SubscribeEvent public void tickEnd(ServerTickEvent event) { if (event.phase == Phase.START) { if (lastThread != Thread.currentThread()) { lastThread = Thread.currentThread(); ScriptingMod.instance.clearSelections(); core = new ServerCore(loadDir, props, abbreviations); } core.tick(); List<EntityPlayerMP> players = (List<EntityPlayerMP>) MinecraftServer.getServer().getConfigurationManager().playerEntityList; ScriptingMod.instance.updateSelections(players); } }
@SubscribeEvent(priority=EventPriority.HIGHEST) public void tickEventStart(ServerTickEvent event) { if(event.phase == Phase.START) { if(!versionCheckDone) { VersionChecker.VersionData versionData = versionChecker.getVersionData(); if(versionData != null) { versionCheckDone = true; if(versionData.checkOk) { //TODO: Parse versions, split at ',', then split version numbers at '.' System.out.println("TickDynamic version check: Latest version = " + versionData.modVersion + ". Download URL: http://" + versionData.updateUrl); } else System.out.println("TickDynamic version check: Error while checking latest version!"); } } TimedGroup externalGroup = getTimedGroup("external"); externalGroup.endTimer(); //Set the correct externalGroup time long msPerTick = 50; long overTime = externalGroup.getTimeUsed() - (msPerTick*externalGroup.timeMilisecond); //overTime = time used above given tick time long overTimeTick = (msPerTick*externalGroup.timeMilisecond) - (root.getTimeUsed() - externalGroup.getTimeUsed()); if(overTimeTick < 0) overTime += overTimeTick; /*System.out.println("TickTime: " + ((root.getTimeUsed()-externalGroup.getTimeUsed())/(double)externalGroup.timeMilisecond) + " Full Tick time: " + (externalGroup.getTimeUsed()/(double)externalGroup.timeMilisecond) + " External time used: " + (overTime/(double)externalGroup.timeMilisecond)+"ms");*/ if(overTime < 0) externalGroup.setTimeUsed(0); else externalGroup.setTimeUsed(overTime); externalGroup.startTimer(); //Clear any values from the previous tick for all worlds. root.newTick(true); getTimedGroup("other").startTimer(); } }
@SubscribeEvent public void tickServer(ServerTickEvent tick) { if (tick.phase == Phase.END) { syncServer(); } }
@SubscribeEvent public void onServerTick(ServerTickEvent event) { ticker.tick(); }
@SubscribeEvent public void onServerTick(ServerTickEvent ev) { this.updateGlobalCooldownMap(); this.sendInventoryToAllAround(); this.updateDiamondJewelryEffect(); this.updateLapisJewelryEffect(); }