@SubscribeEvent public void onTick(ClientTickEvent event) { if (event.side == Side.CLIENT) { if (event.phase == Phase.START) { this.keyTick(event.type, false); } else if (event.phase == Phase.END) { this.keyTick(event.type, true); } } }
@SubscribeEvent public void tickStart(PlayerTickEvent evt) { if (evt.phase != Phase.START) { return; } if (ticksToPoll > 0) { ticksToPoll--; return; } ticksToPoll = TICK_POLL_INTERVAL; if (versionInfo.versionCheckComplete) { unsubscribeFromBus(); if (updateNotificationsEnabledOrCriticalUpdate()) { sendNotificationToPlayer(evt.player); } } }
@SubscribeEvent public void onClientTick(ClientTickEvent event) { if (event.phase == Phase.END && ++ticker == UPDATE_RATE) { ticker = 0; Iterator<Particle> iter = alive.iterator(); while (iter.hasNext()) { Particle p = iter.next(); if (p.isDead) { iter.remove(); if (dead.size() < MAX_POOL_SIZE) { dead.add(p); } } } // System.out.println("GC: " + alive.size() + " / " + // dead.size()); } }
/** ʵ��Skill331-������֮����Ч���� */ @SubscribeEvent public void Point_CuringFog(PlayerTickEvent event) { if (event.phase == Phase.END) { return; } EntityPlayer player = event.player; if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ����� && RewriteHelper.hasSkill(player, RewriteHelper.CuringFog.id) && new Random().nextInt(1200) == 600 ) { List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D)); for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) { EntityLivingBase entity = (EntityLivingBase)iterator.next(); if (entity.isPotionActive(Potion.blindness)) entity.removePotionEffect(Potion.blindness.id); if (entity.isPotionActive(Potion.confusion)) entity.removePotionEffect(Potion.confusion.id); if (entity.isPotionActive(Potion.digSlowdown)) entity.removePotionEffect(Potion.digSlowdown.id); if (entity.isPotionActive(Potion.hunger)) entity.removePotionEffect(Potion.hunger.id); if (entity.isPotionActive(Potion.poison)) entity.removePotionEffect(Potion.poison.id); if (entity.isPotionActive(Potion.weakness)) entity.removePotionEffect(Potion.weakness.id); if (entity.isPotionActive(Potion.wither)) entity.removePotionEffect(Potion.wither.id); } player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.cure"))); } }
/** ʵ��Skill332-������֮����Ч���� */ @SubscribeEvent public void Point_HealingFog(PlayerTickEvent event) { if (event.phase == Phase.END) { return; } EntityPlayer player = event.player; if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ����� && RewriteHelper.hasSkill(player, RewriteHelper.HealingFog.id) && new Random().nextInt(2400) == 800 ) { List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D)); for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) { EntityLivingBase entity = (EntityLivingBase)iterator.next(); entity.addPotionEffect(new PotionEffect(Potion.heal.id, 1, 0)); } player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.heal"))); } }
/** ʵ��Skill333-���˺�֮����Ч���� */ @SubscribeEvent public void Point_HurtingFog(PlayerTickEvent event) { if (event.phase == Phase.END) { return; } EntityPlayer player = event.player; if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ����� && RewriteHelper.hasSkill(player, RewriteHelper.HurtingFog.id) && new Random().nextInt(2400) == 1600 ) { List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D)); for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) { EntityLivingBase entity = (EntityLivingBase)iterator.next(); if (!entity.equals(player)) entity.attackEntityFrom(DamageSource.causePlayerDamage(player), 10.0F); } player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.hurt"))); } }
/** �������Skill343-��ŷ������������ŷ�������� */ @SubscribeEvent public void Point_AuroraAutoRecover(PlayerTickEvent event) { if (event.phase == Phase.END) { return; } EntityPlayer player = event.player; if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ����� && RewriteHelper.hasSkill(player, RewriteHelper.AuroraRegeneration.id) && new Random().nextInt(6000) == 3000 ) { RewriteHelper.modifyAuroraPoint(player, 1); player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.aurorarecovery"))); } }
@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 onServerWorldTick(WorldTickEvent e) { if (e.phase == Phase.START) { if (e.world.provider.dimensionId == 0 && !ModRecipes.ScriptsReloaded) { //ModRecipes.initialiseAnvil(); } } else if(e.phase == Phase.END) { } }
@SubscribeEvent public void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.phase != Phase.START) return; updatePosition(); if (!moved) return; Block b = getBlockUnderPlayer(); onElevator = (b == IndicatorMod.instance.elevatorBlock); if (onElevator) findElevators(); }
@Override public void handleClientSide(EntityPlayer player) { TileEntity tile = player.worldObj.getTileEntity(x, y, z); if (tile == null || !(tile instanceof TileMotor)) return; TileMotor te = (TileMotor) tile; structure = new MovingStructure(te, te.getMovement(), speed); for (Vec3i b : blocks) structure.addBlock(new MovingBlock(b.setWorld(player.worldObj), structure, null).snapshot()); MovingStructure s = te.getStructure(); if (s != null) { while (s.getProgress() < 1) { s.tick(Phase.START); s.tick(Phase.END); } } te.setStructure(structure); MovementScheduler.instance().addStructure(structure); }
public void tick(Phase phase) { FakeWorld.getFakeWorld(this); if (progress >= 1) return; if (phase == Phase.END) { if (progress == 0) { if (!getWorld().isRemote) NetworkHandler.instance().sendToAllAround(new PacketStartMoving(motor, this), getWorld(), 128); startMoving(); if (!getWorld().isRemote) NetworkHandler.instance().sendToAllAround(new PacketBlockSync(motor, this), getWorld(), 128); } progress += speed; moveEntities(); if (progress >= 1) finishMoving(); } }
@SubscribeEvent public void onWorldTick(WorldTickEvent event) { if(event.side == Side.SERVER && event.phase == Phase.END) { World world = event.world; if (world.provider.dimensionId == 0) { // only operate on overworld (for now) Long thisTick = world.getWorldTime(); if (instantTickDelay == 0) { if (WorldTickEvents.eventPendingInstant) { if (eventPendingInstantUsers.size() > 0) { // player instants doPlayerInstants(); } } instantTickDelay = instantTickDelayReset; } instantTickDelay--; if (thisTick % ticksPerQuartHour == 0) { // check for stuff every in-game quarter-hour globalTicker(event); } } } }
@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 onClientTick(ClientTickEvent event) { if(event.phase == Phase.END) { for(EQMod mod : EQMod.mods.values()) { if(mod.config.displayVersionResult && !mod.versionMessage && mod.versionResult == EQVersion.OUTDATED) { if(FMLClientHandler.instance().getClient().currentScreen == null) { if(mod.versionResult != EQVersion.UNINITIALIZED || mod.versionResult != EQVersion.FINAL_ERROR) { mod.versionMessage = true; if(mod.versionResult == EQVersion.OUTDATED) { ChatComponentText chatComponent = new ChatComponentText(EQVersion.getResultMessageForClient(mod)); chatComponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(LanguageManager.getLocalization("elconqore.version.chat_hover")))); chatComponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, mod.remoteUpdateLocation)); Minecraft.getMinecraft().thePlayer.addChatMessage(chatComponent); } } } } } } }
@SubscribeEvent public void TickEvent(RenderTickEvent event) { config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); config.load(); displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); config.save(); if (event.phase == Phase.END && displayBossHealth) { if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health"); } } }
@SubscribeEvent public void onRenderTick(RenderTickEvent event) { if(event.phase == Phase.END) { Minecraft mc = Minecraft.getMinecraft(); if(mc.currentScreen instanceof net.minecraft.client.gui.GuiMainMenu && !(mc.currentScreen instanceof GuiMainMenu)) { mc.displayGuiScreen(new GuiMainMenu()); } if(!(mc.ingameGUI instanceof GuiInGame)) { mc.ingameGUI = new GuiInGame(mc); } if(GuiTechTreeComponent.instance == null) { GuiTechTreeComponent.instance = new GuiTechTreeComponent(); } GuiTechTreeComponent.instance.updateTechTreeWindow(); } }
@SubscribeEvent public void RenderTickEvent(RenderTickEvent event) { if ((event.type == Type.RENDER || event.type == Type.CLIENT) && event.phase == Phase.END) { Minecraft mc = Minecraft.getMinecraft(); if (!ticked && mc.ingameGUI != null) { mc.ingameGUI = new GuiAdvancedHUD(mc); ticked = true; } if (firstload && mc != null) { if (!SaveController.loadConfig("config")) { HUDRegistry.checkForResize(); HUDRegistry.resetAllDefaults(); SaveController.saveConfig("config"); } firstload = false; } // TODO Add notification on main menu when an update for advancedhud is available :) // if (mc.currentScreen instanceof GuiMainMenu) { // int mouseX = Mouse.getX() * mc.currentScreen.width / mc.displayWidth; // int mouseY = mc.currentScreen.height - Mouse.getY() * mc.currentScreen.height / mc.displayHeight - 1; // RenderAssist.drawCircle(mouseX, mouseY, 3, 24, 0xFFFFFFFF); // RenderAssist.drawRect(1, 1, 70, 11, 0x608f3eff); // mc.currentScreen.drawString(mc.fontRenderer, "AdvancedHUD!", 2, 2, 0x48dce9); // } } }
@SubscribeEvent public void onServerWorldTick(WorldTickEvent e) { if (e.phase == Phase.START) { if (e.world.provider.dimensionId == 0) ModRecipes.initialiseAnvil(); } else if(e.phase == Phase.END) { } }
@SubscribeEvent public void onTick(ServerTickEvent event) { if(event.phase == Phase.END && event.side == Side.SERVER) { tickEnd(); } }
@SubscribeEvent public void tickEvent(TickEvent.ClientTickEvent event) { if(event.phase == Phase.END) return; Minecraft mc = Minecraft.getMinecraft(); if(mc.theWorld != null) { loadWorld(mc.theWorld, false); if (!NEIClientConfig.isEnabled()) return; KeyManager.tickKeyStates(); NEIController.updateUnlimitedItems(mc.thePlayer.inventory); if (mc.currentScreen == null) NEIController.processCreativeCycling(mc.thePlayer.inventory); updateMagnetMode(mc.theWorld, mc.thePlayer); } GuiScreen gui = mc.currentScreen; if (gui != lastGui) { if (gui instanceof GuiMainMenu) lastworld = null; else if (gui instanceof GuiSelectWorld) NEIClientConfig.reloadSaves(); } lastGui = gui; }
@SubscribeEvent public void clientTick(TickEvent.ClientTickEvent event) { if(event.phase == Phase.END) { CCUpdateChecker.tick(); renderTime++; } }
@SubscribeEvent public void onClientTick(ClientTickEvent event) { Minecraft minecraft = FMLClientHandler.instance().getClient(); WorldClient world = minecraft.theWorld; EntityClientPlayerMP player = minecraft.thePlayer; // Starts a version check. if (event.phase == Phase.START) { if (world != null && TickHandlerClient.checkedVersion) { SpaceVersionCheck.startCheck(); TickHandlerClient.checkedVersion = false; } } // Sets up the atmosphere for the world. if (world != null) { for (ICoreModule module : SpaceCore.modulesList) { if (module instanceof ICoreCelestial) { ICoreCelestial celestial = (ICoreCelestial) module; if (celestial.instanceOfProvider(world.provider)) { if (world.provider.getSkyRenderer() == null) { world.provider.setSkyRenderer(celestial.createSkyProvider((IGalacticraftWorldProvider) world.provider)); } if (world.provider.getCloudRenderer() == null) { world.provider.setCloudRenderer(new CloudRenderer()); } break; } } } } }
@SubscribeEvent public void onTick(final @Nonnull ClientTickEvent event) { if (event.phase==Phase.END) { Client.startSection("signpic_load"); debugKey(); // this.keyHandler.onTick(); this.signEntryManager.onTick(); this.signHandler.onTick(); this.contentManager.onTick(); this.overlayHandler.onTick(event); this.informationHandler.onTick(event); EntrySlot.Tick(); Client.endSection(); } }
@SubscribeEvent public void updateRound(TickEvent event) { if (roundstarted && winCountdown > 0 && event.phase.equals(Phase.END)) { if (event.type == TickEvent.Type.SERVER) updateServer(); if (event.type == TickEvent.Type.CLIENT) updateClient(); } if (event.type == TickEvent.Type.CLIENT && event.phase.equals(Phase.END)) updateInvisible(); }
@SubscribeEvent public void onServerTick(WorldTickEvent event) { if(event.phase == Phase.START) { if(event.world.provider.dimensionId == 0 && AnvilRecipeHandler.world == null) { AnvilRecipeHandler.world = event.world; AnvilRecipeHandler.getInstance().registerRecipes(); } } }
@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 onServerWorldTick(WorldTickEvent e) { if (e.phase == Phase.START) { if (e.world.provider.dimensionId == 0 && e.world.getWorldInfo().getSeed() != wSeed) { ModRecipes.initialiseAnvil(e.world); wSeed = e.world.getWorldInfo().getSeed(); } } }
@SubscribeEvent public void onServerWorldTick(WorldTickEvent e) { if (e.phase == Phase.START) { if (e.world.provider.dimensionId == 0) TFCPPRecipes.initialiseAnvil(); } else if(e.phase == Phase.END) { } }
@SuppressWarnings("static-method") @SideOnly(Side.CLIENT) @SubscribeEvent public void clientTick(ClientTickEvent event) { if (event.phase == Phase.START) { sendAnalyticsActivityEvent(); } }
@SuppressWarnings("static-method") @SideOnly(Side.SERVER) @SubscribeEvent public void serverTick(ServerTickEvent event) { if (event.phase == Phase.START) { sendAnalyticsActivityEvent(); } }
@SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { EntityPlayer player = event.player; if (!player.worldObj.isRemote && event.phase == Phase.END) { if (player.worldObj.getTotalWorldTime() % 100 == 0) { Calendar cal = Calendar.getInstance(); if (cal.get(DAY_OF_MONTH) == 1 && cal.get(MONTH) == JANUARY && !player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG).getBoolean("celebrated")) { player.getEntityData().setInteger("fireworksLeft", 15); player.getEntityData().setBoolean("fireworkDelay", false); NBTTagCompound tag = player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); tag.setBoolean("celebrated", true); player.getEntityData().setTag(EntityPlayer.PERSISTED_NBT_TAG, tag); player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + EnderCore.lang.localize("celebrate"))); } } int fireworksLeft = player.getEntityData().getInteger("fireworksLeft"); if (fireworksLeft > 0 && (!player.getEntityData().getBoolean("fireworkDelay") || player.worldObj.getTotalWorldTime() % 20 == 0)) { BlockCoord pos = getBlockCoord(player); pos = pos.withY(pos.y + 2); EntityUtil.spawnFirework(pos, player.worldObj.provider.dimensionId, 12); player.getEntityData().setInteger("fireworksLeft", fireworksLeft - 1); if (fireworksLeft > 5) { player.getEntityData().setBoolean("fireworkDelay", true); } else { player.getEntityData().setBoolean("fireworkDelay", false); } } } }
/** * For internal use only. Do not call. */ @SubscribeEvent public void onServerTick(ServerTickEvent event) { if (event.phase == Phase.END) { runTasks(serverQueue); } }
/** * For internal use only. Do not call. */ @SideOnly(Side.CLIENT) @SubscribeEvent public void onClientTick(ClientTickEvent event) { if (event.phase == Phase.END) { runTasks(clientQueue); if (!serverQueue.isEmpty() && !Minecraft.getMinecraft().isIntegratedServerRunning()) { serverQueue.clear(); } } }
@SubscribeEvent public void onTick(WorldTickEvent evt) { if(evt.phase == Phase.END) { LogisticStorage.network.get().updateFields(evt.world); } else { handleTicks(evt.world); } }
@SubscribeEvent public void worldTickEvent(WorldTickEvent event) { Profiler profiler = event.world.theProfiler; if(!(profiler instanceof CustomProfiler)) return; CustomProfiler customProfiler = (CustomProfiler)profiler; if(event.phase == Phase.START) { customProfiler.setStage(CustomProfiler.Stage.BeforeLoop); } else { customProfiler.setStage(CustomProfiler.Stage.None); } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { if(playerGravityState > 0 && event.phase == Phase.END) { playerGravityState--; } /*if(event.phase == Phase.START) { playerWasOnGround = event.player.onGround; }*/ }
@SubscribeEvent public void onTick(ClientTickEvent event) { if(event.phase == Phase.START) { tickStart(); } }
@SubscribeEvent public void onTick(PlayerTickEvent event) { if(event.phase == Phase.END && event.side == Side.SERVER) { tickEnd(event.player); } }