Java 类cpw.mods.fml.common.gameevent.TickEvent 实例源码

项目:PAYDAY    文件:MEventHandler.java   
@SubscribeEvent
public void onTickEvent(TickEvent.PlayerTickEvent evt) {
    if (tick >= 15) {
        for (TileEntity t : (List<TileEntity>) evt.player.worldObj.loadedTileEntityList) {
            if (t instanceof LobbyTileEntity) {
                tile = (LobbyTileEntity) t;

                if (tile.players.size() != tile.blockMetadata)
                    tile.check();
            }
        }

        tick = 0;
    }
}
项目:connor41-etfuturum2    文件:ServerEventHandler.java   
@SubscribeEvent
@SuppressWarnings("unchecked")
public void onWorldTick(TickEvent.ServerTickEvent event) {
    if (event.phase != TickEvent.Phase.END || event.side != Side.SERVER)
        return;

    if (EtFuturum.enablePlayerSkinOverlay)
        if (playerLoggedInCooldown != null)
            if (--playerLoggedInCooldown <= 0) {
                for (World world : MinecraftServer.getServer().worldServers)
                    for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) {
                        NBTTagCompound nbt = player.getEntityData();
                        if (nbt.hasKey(SetPlayerModelCommand.MODEL_KEY, Constants.NBT.TAG_BYTE)) {
                            boolean isAlex = nbt.getBoolean(SetPlayerModelCommand.MODEL_KEY);
                            EtFuturum.networkWrapper.sendToAll(new SetPlayerModelMessage(player, isAlex));
                        }
                    }
                playerLoggedInCooldown = null;
            }
}
项目:HazardsLib    文件:ClientEventHandler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event)
{
    Minecraft mc = FMLClientHandler.instance().getClient();
    World world = mc.theWorld;

    if (event.phase != TickEvent.Phase.START) {
        if ((Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer)) {
            EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;

            if ((player != null) && (mc.inGameHasFocus) && (Minecraft.isGuiEnabled())) {
                // If player have radiation detector on hotbar.
                if (isPlayerHasItemOnHotbar(player.inventory, ItemsHZDS.radiation_detector)) {
                    PlayerTracker tracker = TrackerManager.lookupTrackerFromUsername(mc.thePlayer.getCommandSenderName());

                    if (tracker != null) {
                        renderRadiation(tracker);
                    }
                }

            }
        }
    }
}
项目:ExtraUtilities    文件:CommandTPSTimer.java   
@SubscribeEvent
public void onServerTick(final TickEvent.ServerTickEvent event) {
    if (event.phase != TickEvent.Phase.END || CommandTPSTimer.playerSet.isEmpty()) {
        return;
    }
    final MinecraftServer server = MinecraftServer.getServer();
    final int counter = server.getTickCounter() % 100;
    final long[] longs = server.tickTimeArray;
    if (longs == null) {
        return;
    }
    for (final Object o : server.getConfigurationManager().playerEntityList) {
        final EntityPlayer player = (EntityPlayer)o;
        if (CommandTPSTimer.playerSet.contains(player.getCommandSenderName())) {
            NetworkHandler.sendPacketToPlayer(new PacketTime(longs[counter], counter), player);
        }
    }
}
项目:ExtraUtilities    文件:CommandTPSTimer.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onDraw(final TickEvent.RenderTickEvent event) {
    if (event.phase != TickEvent.Phase.END || !this.display || CommandTPSTimer.displayString.length() == 0) {
        return;
    }
    final Minecraft minecraft = Minecraft.getMinecraft();
    if (minecraft.theWorld == null) {
        CommandTPSTimer.displayString = "";
        return;
    }
    final FontRenderer fontrenderer = minecraft.fontRenderer;
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(3042);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glBlendFunc(770, 771);
    RenderHelper.disableStandardItemLighting();
    fontrenderer.drawString(CommandTPSTimer.displayString, 0, 0, -1, true);
}
项目:ExtraUtilities    文件:SpecialEventCoordinator.java   
@SubscribeEvent
public void playerTick(final TickEvent.PlayerTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        return;
    }
    final EntityPlayer player = event.player;
    if (player.worldObj.isRemote) {
        return;
    }
    if (LogHelper.isDeObf) {}
    if ((player.worldObj.getTotalWorldTime() & 0x1FL) > 0L) {
        return;
    }
    final int i = this.chunkmap.adjustOrPutValue(new ChunkLocation(event.player), 1, 1);
    if (i > 2250) {}
}
项目:4Space-5    文件:AsteroidsTickHandlerServer.java   
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
    MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
    //Prevent issues when clients switch to LAN servers
    if (server == null) return;

    if (event.phase == TickEvent.Phase.START)
    {
        if (AsteroidsTickHandlerServer.spaceRaceData == null)
        {
            World world = server.worldServerForDimension(0);
            AsteroidsTickHandlerServer.spaceRaceData = (ShortRangeTelepadHandler) world.mapStorage.loadData(ShortRangeTelepadHandler.class, ShortRangeTelepadHandler.saveDataID);

            if (AsteroidsTickHandlerServer.spaceRaceData == null)
            {
                AsteroidsTickHandlerServer.spaceRaceData = new ShortRangeTelepadHandler(ShortRangeTelepadHandler.saveDataID);
                world.mapStorage.setData(ShortRangeTelepadHandler.saveDataID, AsteroidsTickHandlerServer.spaceRaceData);
            }
        }
    }
}
项目:OpenTechnology    文件:SimpleComponentTickHandler.java   
@SubscribeEvent
public void onTick(TickEvent.ServerTickEvent e) {
    if (e.phase == TickEvent.Phase.START) {
        final Runnable[] adds;
        synchronized (pending) {
            adds = pending.toArray(new Runnable[pending.size()]);
            pending.clear();
        }
        for (Runnable runnable : adds) {
            try {
                runnable.run();
            } catch (Throwable t) {
                log.warn("Error in scheduled tick action.", t);
            }
        }
    }
}
项目:LookingGlass    文件:LookingGlassEventHandler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
    // If no client world we're not playing. Abort.
    if (Minecraft.getMinecraft().theWorld == null) return;
    if (event.phase == TickEvent.Phase.START) {
        // Anything we need to render for the current frame should happen either during or before the main world render
        // Here we call the renderer for "live portal" renders.
        PerspectiveRenderManager.onRenderTick(printstream);
        return;
    }
    if (event.phase == TickEvent.Phase.END) {
        // We render the world views at the end of the render tick.  
        WorldViewRenderManager.onRenderTick(printstream);
        return;
    }
}
项目:Elite-Armageddon    文件:Handler.java   
@SubscribeEvent
public void onWorldTickLoad(TickEvent.WorldTickEvent event)
{
    EAWorldData eaWD = EAWorldData.forWorld((WorldServer)event.world);
    eaWD.markDirty();

    if(event.phase == TickEvent.Phase.START)
    {
        EAPlugin.internalTick();
        for(EAPluginContainer plugin : EALoader.instance().loadedPlugins)
        {   
            try
            {
                plugin.plugin.onTick(event.world);
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
        }
    }
}
项目:ProjectU    文件:ServerTickEventHandler.java   
@SubscribeEvent
public void onEvent(TickEvent.ServerTickEvent event)
{
    // Only need once a tick
    if(event.phase == TickEvent.Phase.START)
    {
        return;
    }

    // This is useless :p
    if(tickCount < TICK_DELAY)
    {
        tickCount++;
    }

    if(tickCount == TICK_DELAY)
    {
        InventoryPlayerUnificationHandler.unifyAll();
        tickCount = 0;
    }
}
项目:EventMod    文件:SoundHandler.java   
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
    if (Minecraft.getMinecraft().theWorld == null && !nowPlaying.isEmpty()) {
        stop();
        return;
    }

    boolean currentState = false;
    if (Minecraft.getMinecraft().isGamePaused()) {
        currentState = true;
    }

    if (currentState && !gamePause) {
        pause();
        gamePause = true;
    } else if (!currentState && gamePause) {
        resume();
        gamePause = false;
    }
}
项目:OpenBlocks-Elevator-Indicator    文件:IndicatorOverlay.java   
@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();
}
项目:ComponentEquipment    文件:ArcaneBoreSlotChanger.java   
public void tickEnd( PlayerTickEvent event )
{
    if ( !event.phase.equals( TickEvent.Phase.END ) )
    {
        return;
    }
    EntityPlayer player = ( EntityPlayer ) event.player;

    if ( !player.openContainer.getClass().getName().equals( "thaumcraft.common.container.ContainerArcaneBore" ) )
    {
        return;
    }

    Slot oldSlot = player.openContainer.getSlot( 1 );
    if ( oldSlot instanceof PickaxeSlot )
    {
        return;
    }

    PickaxeSlot newSlot = new PickaxeSlot( oldSlot.inventory, 1, oldSlot.xDisplayPosition, oldSlot.yDisplayPosition );
    newSlot.slotNumber = oldSlot.slotNumber;
    player.openContainer.inventorySlots.set( 1, newSlot );
}
项目:Et-Futurum    文件:ServerEventHandler.java   
@SubscribeEvent
@SuppressWarnings("unchecked")
public void onWorldTick(TickEvent.ServerTickEvent event) {
    if (event.phase != TickEvent.Phase.END || event.side != Side.SERVER)
        return;

    if (EtFuturum.enablePlayerSkinOverlay)
        if (playerLoggedInCooldown != null)
            if (--playerLoggedInCooldown <= 0) {
                for (World world : MinecraftServer.getServer().worldServers)
                    for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) {
                        NBTTagCompound nbt = player.getEntityData();
                        if (nbt.hasKey(SetPlayerModelCommand.MODEL_KEY, Constants.NBT.TAG_BYTE)) {
                            boolean isAlex = nbt.getBoolean(SetPlayerModelCommand.MODEL_KEY);
                            EtFuturum.networkWrapper.sendToAll(new SetPlayerModelMessage(player, isAlex));
                        }
                    }
                playerLoggedInCooldown = null;
            }
}
项目:AdvancedRocketry    文件:PlanetEventHandler.java   
@SubscribeEvent
public void tick(TickEvent.ServerTickEvent event) {
    //Tick satellites
    if(event.phase == event.phase.END) {
        DimensionManager.getInstance().tickDimensions();
        time++;

        if(!transitionMap.isEmpty()) {
            Iterator<Entry<Long, TransitionEntity>> itr = transitionMap.entrySet().iterator();

            while(itr.hasNext()) {
                Entry<Long, TransitionEntity> entry = itr.next();
                TransitionEntity ent = entry.getValue();
                if(ent.entity.worldObj.getTotalWorldTime() >= entry.getKey()) {
                    ent.entity.setLocationAndAngles(ent.location.x, ent.location.y, ent.location.z, ent.entity.rotationYaw, ent.entity.rotationPitch);

                    MinecraftServer.getServer().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)ent.entity, ent.dimId, new TeleporterNoPortal(MinecraftServer.getServer().worldServerForDimension(ent.dimId)));

                    ent.entity.mountEntity(ent.entity2);
                    itr.remove();
                }
            }
        }
    }
}
项目:AdvancedRocketry    文件:PlanetEventHandler.java   
@SubscribeEvent
public void serverTickEvent(TickEvent.WorldTickEvent event) {
    if(zmaster587.advancedRocketry.api.Configuration.allowTerraforming && event.world.provider.getClass() == WorldProviderPlanet.class) {

        if(DimensionManager.getInstance().getDimensionProperties(event.world.provider.dimensionId).isTerraformed()) {
            List<Chunk> list = ((WorldServer)event.world).theChunkProviderServer.loadedChunks;
            if(list.size() > 0) {
                for(int i = 0; i < Configuration.terraformingBlockSpeed; i++) {
                    Chunk chunk = list.get(event.world.rand.nextInt(list.size()));
                    int coord = event.world.rand.nextInt(256);
                    int x = (coord & 0xF) + chunk.xPosition*16;
                    int z = (coord >> 4) + chunk.zPosition*16;

                    BiomeHandler.changeBiome(event.world, ((WorldProviderPlanet)event.world.provider).chunkMgrTerraformed.getBiomeGenAt(x,z).biomeID, x, z);
                }
            }
        }
    }
}
项目:AdvancedRocketry    文件:SpaceObjectManager.java   
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {

    if(DimensionManager.getWorld(Configuration.spaceDimId) == null)
        return;

    long worldTime = DimensionManager.getWorld(Configuration.spaceDimId).getTotalWorldTime();
    //Assuming server
    //If no dim undergoing transition then nextTransitionTick = -1
    if((nextStationTransitionTick != -1 && worldTime >= nextStationTransitionTick && spaceStationOrbitMap.get(WARPDIMID) != null) || (nextStationTransitionTick == -1 && spaceStationOrbitMap.get(WARPDIMID) != null && !spaceStationOrbitMap.get(WARPDIMID).isEmpty())) {
        long newNextTransitionTick = -1;
        for(ISpaceObject obj : spaceStationOrbitMap.get(WARPDIMID)) {
            if(obj.getTransitionTime() <= worldTime) {
                moveStationToBody(obj, obj.getDestOrbitingBody());
                spaceStationOrbitMap.get(WARPDIMID).remove(obj);
            }
            else if(newNextTransitionTick == -1 || obj.getTransitionTime() < newNextTransitionTick)
                newNextTransitionTick = obj.getTransitionTime();
        }

        nextStationTransitionTick = newNextTransitionTick;
    }

}
项目:ModJam4    文件:HarkenEvents.java   
@SubscribeEvent
@SuppressWarnings("unused")
public void onClientTickEvent(TickEvent.ClientTickEvent clientTickEvent)
{
    if(clientTickEvent.phase != TickEvent.Phase.END) return;

    if ((++tickCount % 100) == 0)
    {
        // stuff to do once every second
        MCInformation.gatherInformation();
    }

    if (tickCount == Integer.MAX_VALUE || tickCount < 0) tickCount = 0;

    SoundHandler.soundTick();

    MCInformation.gatherTick();

    //other stuff
}
项目:RecallResurrection    文件:ClientErrorMessageHandler.java   
@SubscribeEvent
public void tickStart(TickEvent.PlayerTickEvent event){
    if (event.player.worldObj.isRemote){
        //System.out.println("tick");
        IChatComponent message = ClientErrorMessageStorage.getMessage();
        if (message != null && ticksElapsed == 0){
            ClientErrorMessageStorage.getPlayer().addChatComponentMessage(message);
            ClientErrorMessageStorage.sent();
            ticksElapsed++; 
        } else if (ticksElapsed > 0 && ticksElapsed < minDelay){
            ticksElapsed++;
        } else if (ticksElapsed >= minDelay){
            ticksElapsed = 0;
        }
    } else {
        //System.out.println("server");
    }

}
项目:fortressmod    文件:StuckCommand.java   
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
    if (event.phase == TickEvent.Phase.END) {
        this.ticksCounter++;
        if (this.ticksCounter > this.ticksPerCheck) {
            this.ticksCounter = 0;
            //check if any stuck players need message or teleport

            List<StuckPlayer> stuckListCopy = new ArrayList<StuckPlayer>(stuckList);
            for (StuckPlayer player : stuckListCopy) {
                if (player.isDoneWaiting()) {
                    player.stuckTeleport();
                    stuckList.remove(player);
                } else {
                    boolean cancelled = player.considerCancelling();
                    if (cancelled) {
                        stuckList.remove(player);
                    } else {
                        player.considerSendingMessage();
                    }
                }
            }
        }
    }
}
项目:mcpvp-mod    文件:AllTick.java   
public static void onTick(TickEvent event) {

    if (System.currentTimeMillis() % 10 == 0) {
        Main.start("mcpvp", "vars");
        AllVars.putVars();
        Main.end(2);
    }

    if (event.type == TickEvent.Type.RENDER && event.phase == event.phase.END) {
        if (Main.mc.currentScreen == null || Main.mc.currentScreen instanceof GuiChat) {
            Main.start("mcpvp", "alerts");
            Alerts.alert.showAlerts();
            Medal.showAll();
            Main.end(2);
        }
    }

    for (BoardTracker tracker : BoardTracker.boardTrackers) {
        Main.start("mcpvp", "trackers");
        tracker.update();
        Main.end(2);
    }

}
项目:MagicalRings    文件:GameEventHandler.java   
@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent tick) {
    if (tick.side == Side.SERVER) {
        EntityPlayer player = tick.player;
        if (tick.phase == TickEvent.Phase.END) {
            if (Rings.proxy.manaHandler.playerHasSession(player)) {
                IPlayerSession playerSession = Rings.proxy.manaHandler.getPlayerSession(player);
                if (++this.tick >= ModLibs.RECHARGE_WAIT_TIME) {
                    if (!player.capabilities.isCreativeMode) {
                        if (player.getFoodStats().getFoodLevel() > 4)
                            playerSession.adjustMana(((player.getFoodStats().getFoodLevel() / 4)), false);
                    } else
                        playerSession.setMana(playerSession.getMaxMana());
                    Rings.proxy.manaHandler.updatePlayerSession(playerSession, player.getEntityWorld().provider.dimensionId);
                    this.tick = 0;
                }
            }
        }
    }
}
项目:YetAnotherBackupMod    文件:BackupTickHandler.java   
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
    Time current_time = new Time(System.currentTimeMillis());
    long timestamp = System.currentTimeMillis();

    if (event.phase == TickEvent.Phase.START
            || !ConfigHandler.backupEnabled
            || current_time.compareTo(nextSchedule) != 0
            || YABM.backupManager.isRunning()
            || timestamp < (lastRun + 60000))
    {
        return;
    }

    YABM.backupManager.startBackup();
    updateScheduleTime();
    lastRun = System.currentTimeMillis();
}
项目:SchematicMetaBlocks    文件:JobProcessor.java   
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent tickEvent)
{
    /*for (IJob job : unscheduledBackgroundJobs)
    {
        scheduleBackgroundJob(job);
    }
    unscheduledBackgroundJobs.clear();*/

    int jobQuota = 32;
    while (!scheduledTickJobs.isEmpty() && --jobQuota > 0)
    {
        IJob job = scheduledTickJobs.poll();
        job.start();
    }
}
项目:Quantum-Anomalies    文件:GlowRenderHandler.java   
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        brightness += brightnessStep;
        if (brightness >= brightnessMaximum)
            brightnessStep = -0.01F;
        else if (brightness <= brightnessMinimum)
            brightnessStep = 0.01F;

        scaler += brightnessStep;
        if (scaler >= 1F)
            brightnessStep = -0.01F;
        else if (scaler <= 0F)
            brightnessStep = 0.01F;
    }
}
项目:projectzulu1.7.10    文件:RetroactiveWorldGenerator.java   
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event)
{
    if (genQueue.isEmpty())
        return;

    if (event.phase == TickEvent.Phase.START)
        return;

    int count = 0;
    ArrayList<RetroGenEntry> removeQueue = Lists.newArrayList();
    ArrayList<RetroGenEntry> iterationQueue = (ArrayList<RetroGenEntry>) genQueue.clone();

    for (RetroGenEntry entry : iterationQueue)
    {
        entry.gen.generate(entry.world.rand, entry.world, entry.coord.chunkX, entry.coord.chunkZ);
        removeQueue.add(entry);
        count++;

        if (count >= 32)
            break;
    }

    genQueue.removeAll(removeQueue);
}
项目:Pumpkin-Carvier    文件:TickHandlerPumpkin.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onTick(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        if (!zoomComplete) {
            zoomTimer++;
        }
        boolean prevZoom = zoom;
        zoom = mc.theWorld != null && mc.thePlayer != null && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectType.BLOCK && mc.theWorld.getBlock(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ) instanceof BlockPumpkin && mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == Items.shears;
        if (zoom != prevZoom) {
            if (zoom && zoomComplete) {
                defaultSens = mc.gameSettings.mouseSensitivity;
            }
            zoomComplete = false;
            if (zoomTimer > 0) {
                zoomTimer = 10 - zoomTimer;
            }
        }
    }
}
项目:EnderAmmunition    文件:EAClientProxy.java   
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent clientTickEvent) {
    if (clientTickEvent.phase == TickEvent.Phase.END) {
        boolean isSpacePressed = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
        boolean isFirePressed = fireBinding.getIsKeyPressed();
        boolean isCtrlPressed = accelerationBinding.getIsKeyPressed();
        if (lastSpace != isSpacePressed || lastCtrl != isCtrlPressed
                || lastFire != isFirePressed) {
            lastSpace = isSpacePressed;
            lastCtrl = isCtrlPressed;
            lastFire = isFirePressed;
            //EAPacketHandler_old.sendKeyUpdatePacket(isCtrlPressed,
            //        isSpacePressed, isFirePressed);
            PacketKeyUpdate.issue(isCtrlPressed, isSpacePressed, isFirePressed);
        }
        TickUtil.CLIENT_TICKER++;
    }
}
项目:Blockbender    文件:BendingTickHandler.java   
@SubscribeEvent
public void tickEnd(TickEvent event) {
    if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){
        if(System.currentTimeMillis() - lastTime > 50L){
            lastTime = System.currentTimeMillis();
            Ability.updateTempClientFix();          
        }
    }
    else{
        Ability.updateAll();            
    }

    if(event.side.isClient()){
        return;
    }

    AirTickHandler.update();

    for (Object o : MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
        EntityPlayer player = (EntityPlayer) o;
    }

}
项目:LoreExpansion_old    文件:SoundHandler.java   
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
    if (Minecraft.getMinecraft().theWorld == null && !nowPlaying.isEmpty()) {
        stop();
        return;
    }

    boolean currentState = false;
    if (Minecraft.getMinecraft().isGamePaused()) {
        currentState = true;
    }

    if (currentState && !gamePause) {
        pause();
        gamePause = true;
    } else if (!currentState && gamePause) {
        resume();
        gamePause = false;
    }
}
项目:LoreExpansion_old    文件:CommandDelayHandler.java   
@SubscribeEvent
public void tick(TickEvent.ServerTickEvent event) {
    if (event.phase == TickEvent.Phase.START)
        return;

    Iterator<DelayedCommand> delayedIterator = delayedCommands.iterator();
    while (delayedIterator.hasNext()) {
        DelayedCommand delayedCommand = delayedIterator.next();

        delayedCommand.timer--;
        if (delayedCommand.timer <= 0) {
            CommandHandler ch = (CommandHandler) MinecraftServer.getServer().getCommandManager();
            LoreCommandSender commandSender = new LoreCommandSender(delayedCommand.getPlayer());

            for (String command : delayedCommand.commands) {
                ch.executeCommand(commandSender, command);
            }

            delayedIterator.remove();
        }
    }
}
项目:DBLibOld    文件:VersionChecker.java   
@SubscribeEvent
@SideOnly(CLIENT)
public void onClientTick(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null) {
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        if (this.needsUpdate) {
            if (!this.version.isEmpty() && this.doneTelling) {
                player.addChatComponentMessage(new ChatComponentText(String.format(translate("message.lomlib.updateMessage"), this.modname, this.downloadURL)));
                player.addChatComponentMessage(new ChatComponentText(translate("message.lomlib.updateChangeLog")));
                for (String change : changeList)
                    player.addChatComponentMessage(new ChatComponentText("- " + change));
                if (!Loader.isModLoaded("VersionChecker")) {
                    player.addChatComponentMessage(new ChatComponentText(String.format(translate("message.lomlib.updateDownloadP1"), this.modid)));
                    player.addChatComponentMessage(new ChatComponentText(translate("message.lomlib.updateDownloadP2")));
                }
                this.doneTelling = true;
            }
        }
    }
}
项目:CreeperHostGui    文件:EventHandler.java   
@SubscribeEvent
public void tickEvent(TickEvent.ClientTickEvent event)
{
    if (!Config.getInstance().isSivIntegration())
        return;
    guiServerInfo.doTick();
    if (!((Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) && Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getIsKeyPressed()) || Minecraft.getMinecraft().isIntegratedServerRunning() || !guiServerInfo.getIsPlayerOpped())
    {
        return;
    }

    try
    {

        if (ticks == 0)
        {
            ticks = 40;
            //Update
            if (CreeperHost.instance.getQueryGetter() != null)
            {
                CreeperHost.instance.getQueryGetter().run();
            }
        }
        ticks--;
    }
    catch (Throwable t)
    {
        // Catch _ALL_ errors. We should _NEVER_ crash.
    }
}
项目:CreeperHostGui    文件:EventHandler.java   
@SubscribeEvent
public void guiRendered(TickEvent.RenderTickEvent evt)
{
    if (CreeperHost.instance.toastText != null)
    {
        long curTime = System.currentTimeMillis();
        if (CreeperHost.instance.fadeTime > curTime)
        {
            long fadeDiff = CreeperHost.instance.fadeTime - CreeperHost.instance.endTime;
            long curFade = Math.min(CreeperHost.instance.fadeTime - curTime, fadeDiff);
            float alpha = (float) curFade / (float) fadeDiff;

            RenderHelper.disableStandardItemLighting();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, alpha);
            mc.renderEngine.bindTexture(getToastResourceLocation());
            ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
            drawTexturedModalRect(res.getScaledWidth() - 160, 0, u, v, 160, 32);
            GL11.glEnable(GL11.GL_BLEND);
            OpenGlHelper.glBlendFunc(770, 771, 1, 0);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            int textColour = (0xFFFFFF << 32) | ((int) (alpha * 255) << 24);
            mc.fontRenderer.drawSplitString(CreeperHost.instance.toastText, res.getScaledWidth() - 160 + 5, 6, 160, textColour);
        }
        else
        {
            CreeperHost.instance.toastText = null;
        }
    }
}
项目:ExtraUtilities    文件:ThreadSafeExecution.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void client(final TickEvent.ClientTickEvent server) {
    synchronized (ThreadSafeExecution.clientCallable) {
        for (final IDelayCallable iDelayCallable : ThreadSafeExecution.clientCallable) {
            try {
                iDelayCallable.call();
            }
            catch (Exception e) {
                new RuntimeException("Network code failed on Client: " + e.toString(), e).printStackTrace();
            }
        }
        ThreadSafeExecution.clientCallable.clear();
    }
}
项目:4Space-5    文件:WorldExtensionManager.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void clientTick(TickEvent.ClientTickEvent event)
{
    World world = Minecraft.getMinecraft().theWorld;
    if (worldMap.containsKey(world))
        if (event.phase == TickEvent.Phase.START)
            preTick(world);
        else
            postTick(world);
}
项目:4Space-5    文件:WorldExtensionManager.java   
@SubscribeEvent
public void clientTick(TickEvent.WorldTickEvent event)
{
    if(event.phase == TickEvent.Phase.START)
        preTick(event.world);
    else
        postTick(event.world);
}
项目:4Space-5    文件:ClientHandler.java   
@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;
}
项目:4Space-5    文件:CCCEventHandler.java   
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
    if(event.phase == Phase.END) {
        CCUpdateChecker.tick();
        renderTime++;
    }
}