Java 类net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent 实例源码

项目:BetterPlacement    文件:BetterPlacement.java   
@SubscribeEvent
public static void onClientTick(ClientTickEvent event) throws Throwable {
    if (event.phase == Phase.START && (!Configs.creativeOnly || Minecraft.getMinecraft().player.isCreative())) {
        int timer = (int) getDelayTimer.invoke(Minecraft.getMinecraft());
        RayTraceResult hover = Minecraft.getMinecraft().objectMouseOver;
        if (hover != null && hover.typeOfHit == Type.BLOCK) {
            BlockPos pos = hover.getBlockPos();
            if (timer > 0 && !pos.equals(lastTargetPos) && (lastTargetPos == null || !pos.equals(lastTargetPos.offset(lastTargetSide)))) {
                setDelayTimer.invoke(Minecraft.getMinecraft(), 0);
            } else if (Configs.forceNewLoc && timer == 0 && pos.equals(lastTargetPos) && hover.sideHit == lastTargetSide) {
                setDelayTimer.invoke(Minecraft.getMinecraft(), 4);
            }
            lastTargetPos = pos.toImmutable();
            lastTargetSide = hover.sideHit;
        }
    }
}
项目:harshencastle    文件:HarshenUtils.java   
public static EntityPlayer getPlayer(Event event)
{
    if(event instanceof LivingEvent && ((LivingEvent)event).getEntity() instanceof EntityPlayer)
        return (EntityPlayer)((LivingEvent)event).getEntity();
    if(event instanceof RenderGameOverlayEvent || event instanceof RenderWorldLastEvent || event instanceof ClientTickEvent)
        return HarshenCastle.proxy.getPlayer();
    if(event instanceof PlayerTickEvent)
        return ((PlayerTickEvent)event).player;
    if(event instanceof PlayerEvent)
        return ((PlayerEvent)event).player;
    if(event instanceof net.minecraftforge.event.entity.player.PlayerEvent)
        return ((net.minecraftforge.event.entity.player.PlayerEvent)event).getEntityPlayer();
    if(event instanceof PlayerPunchedEvent)
        return ((PlayerPunchedEvent)event).attacker;
    if(event instanceof LivingDropsEvent && isSourceFromPlayer(((LivingDropsEvent)event).getSource()))
        return getPlayerFromSource(((LivingDropsEvent)event).getSource());
    return null;
}
项目:harshencastle    文件:XrayPendant.java   
@HarshenEvent
public void clientTick(ClientTickEvent event)
{
    EntityPlayer player = HarshenUtils.getPlayer(event);
    if ( (event.phase == TickEvent.Phase.END) && (player != null) )
    {
        localPosX = MathHelper.floor(player.posX);
        localPosY = MathHelper.floor(player.posY);
        localPosZ = MathHelper.floor(player.posZ);
        prevLocalPosX = MathHelper.floor(player.prevPosX);
        prevLocalPosZ = MathHelper.floor(player.prevPosZ);

        if(((this.thread == null) || !this.thread.isAlive()) && (player.world != null) && (player != null))
        {
            this.thread = new Thread(this);
            this.thread.setDaemon(false);
            this.thread.setPriority(Thread.MAX_PRIORITY);
            this.thread.start();
        }
    }
}
项目:Autotip    文件:Tipper.java   
@SubscribeEvent
public void gameTick(ClientTickEvent event) {
    if (Autotip.onHypixel && Autotip.toggle && (unixTime
            != System.currentTimeMillis() / 1000L)) {
        if (waveCounter == waveLength) {
            Autotip.THREAD_POOL.submit(new FetchBoosters());
            waveCounter = 0;
        }

        if (!tipQueue.isEmpty()) {
            tipDelay++;
        } else {
            tipDelay = 4;
        }

        if (!tipQueue.isEmpty() && (tipDelay % 5 == 0)) {
            System.out.println("Attempting to tip: " + tipQueue.get(0));
            Autotip.mc.thePlayer.sendChatMessage("/tip " + tipQueue.get(0));
            tipQueue.remove(0);
            tipDelay = 0;
        }
        waveCounter++;
    }
    unixTime = System.currentTimeMillis() / 1000L;
}
项目:MC-Prefab    文件:ClientEventHandler.java   
/**
 * This is used to increment the ticks in game value.
 * @param event The event object.
 */
@SubscribeEvent
public static void ClientTickEnd(ClientTickEvent event)
{
    if (event.phase == Phase.END)
    {
        GuiScreen gui = Minecraft.getMinecraft().currentScreen;

        if (gui == null || !gui.doesGuiPauseGame()) 
        {
            // Reset the ticks in game if we are getting close to the maximum value of an integer.
            if (Integer.MAX_VALUE - 100 == ClientEventHandler.ticksInGame)
            {
                ClientEventHandler.ticksInGame = 1;
            }

            ClientEventHandler.ticksInGame++;
        }
    }
}
项目:Factorization    文件:ClickHandler.java   
@SubscribeEvent
public void tick(ClientTickEvent event) {
    // NORELEASE: Just move everything to the proxy?
    // NORELEASE: Can't this be done in DseRayTarget?
    if (event.phase != Phase.START) return;
    if (current_attacking_target == null) {
        resetProgress();
        return;
    }
    if (current_attacking_target.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
        resetProgress();
        return;
    }
    MovingObjectPosition hit = Hammer.proxy.getShadowHit();
    if (!current_attacking_target.getBlockPos().equals(hit.getBlockPos())
            || current_attacking_target.subHit != hit.subHit) {
        resetClick();
        resetProgress();
        return;
    }
    tickClickBlock(hit);
}
项目:BauerCam    文件:EventListener.java   
@SubscribeEvent
public void onTick(final ClientTickEvent e) {
    if (PathHandler.isTravelling()) {
        return;
    }

    if (Main.cameraClock.isKeyDown()) {
        CameraRoll.rotateClockWise();
    }

    if (Main.cameraCounterClock.isKeyDown()) {
        CameraRoll.rotateCounterClockWise();
    }

    if (Main.fovHigh.isKeyDown()) {
        DynamicFOV.increase();
    }

    if (Main.fovLow.isKeyDown()) {
        DynamicFOV.decrease();
    }
}
项目:TaleCraft    文件:ClientProxy.java   
@Override
public void tick(TickEvent event) {
    super.tick(event);

    if(event instanceof ClientTickEvent) {
        while(!clientTickQeue.isEmpty())
            clientTickQeue.poll().run();
    }
    if(event instanceof RenderTickEvent) {
        RenderTickEvent revt = (RenderTickEvent) event;

        // Pre-Scene Render
        if(revt.phase == Phase.START) {
            clientRenderer.on_render_world_terrain_pre(revt);
        } else
            // Post-World >> Pre-HUD Render
            if(revt.phase == Phase.END) {
                clientRenderer.on_render_world_terrain_post(revt);
            }
    }
}
项目:CivRadar    文件:CivRadar.java   
@SubscribeEvent
public void onTick(ClientTickEvent event) {
    if(mc.theWorld != null) {
        if(mc.isSingleplayer()) {
            String worldName = mc.getIntegratedServer().getWorldName();
            if(worldName == null) {
                return;
            }
            if(!currentServer.equals(worldName)) {
                currentServer = worldName;
                loadWaypoints(new File(waypointDir, worldName + ".points"));
            }
        } else if (mc.getCurrentServerData() != null) {
            if(!currentServer.equals(mc.getCurrentServerData().serverIP)) {
                currentServer = mc.getCurrentServerData().serverIP;
                loadWaypoints(new File(waypointDir, currentServer + ".points"));
            }
        }
    }
}
项目:CivRadar    文件:RenderHandler.java   
@SubscribeEvent
public void onTick(ClientTickEvent event) {
    if(event.phase == TickEvent.Phase.START && mc.theWorld != null) {
        if(pingDelay <= -10.0D) {
            pingDelay = 63.0D;
        }
        pingDelay -= 1.0D;
        entityList = mc.theWorld.loadedEntityList;
        ArrayList<String> newInRangePlayers = new ArrayList();
        for(Object o : entityList) {
            if(o instanceof EntityOtherPlayerMP) {
                newInRangePlayers.add(((EntityOtherPlayerMP)o).getName());
            }
        }
        ArrayList<String> temp = (ArrayList)newInRangePlayers.clone();
        newInRangePlayers.removeAll(inRangePlayers);
        for(String name : newInRangePlayers) {  
            mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, "minecraft:note.pling", config.getPingVolume(), 1.0F, false);
        }
        inRangePlayers = temp;
    }
}
项目:AutoJoin    文件:AutoJoin.java   
@SubscribeEvent
public void onTick(ClientTickEvent event) {
    if(mc.currentScreen instanceof GuiDisconnected) {
        GuiDisconnected current = (GuiDisconnected) mc.currentScreen;
        current.drawCenteredString(mc.fontRendererObj, time + " seconds", current.width / 2, 30, Color.WHITE.getRGB());
        if(System.currentTimeMillis() - last >= 1000l) {
            time--;
            last = System.currentTimeMillis();
        }
        if(time == 0) {
            connectToServer();
        }
    }
    if(mc.getCurrentServerData() != null) {
        data = mc.getCurrentServerData();
    }
}
项目:minema    文件:TickSynchronizer.java   
@SubscribeEvent
public void onClientTick(ClientTickEvent evt) {
    if (!isEnabled() || evt.phase != Phase.START) {
        return;
    }

    // client is ready now
    if (!clientReady.get()) {
        L.info("Client tick sync ready");
        clientReady.set(true);
        clientTick.set(0);
    }

    // wait for server side
    if (!serverReady.get()) {
        return;
    }

    // don't wait for the server while the game is paused!
    if (MC.isGamePaused()) {
        return;
    }

    // now sync with the server
    waitFor(evt.side, clientTick, serverTick, clientAhead, serverAhead);
}
项目:Snitch-Visualizer    文件:SVPlayerHandler.java   
@SubscribeEvent
public void onPlayerEvent(ClientTickEvent event) {
    if (!SV.settings.updateDetection) return;
    if (lastExecute != 0l && ((System.currentTimeMillis() - lastExecute) < SVPlayerHandler.delay)) {
        skips++;
        return;
    }
    try {
        lastExecute = System.currentTimeMillis();
        EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
        if (player != null) {
            if (Math.floor(player.prevPosX) != Math.floor(player.posX)
                    || Math.floor(player.prevPosY) != Math.floor(player.posY)
                    || Math.floor(player.prevPosZ) != Math.floor(player.posZ)) {
                player.prevPosX = player.posX;
                player.prevPosY = player.posY;
                player.prevPosZ = player.posZ;
                onPlayerMove(player);
                skips = 0l;
            }
        };
    } catch (Exception e) {
        logger.error("Unexpected error during client tick event handler for player movement.", e);
    }
}
项目:WirelessRedstone    文件:WREventHandler.java   
@SubscribeEvent
public void clientTick(ClientTickEvent event) {
    if (event.phase == Phase.START) {
        WirelessBolt.update(WirelessBolt.clientboltlist);
    }

    if (ClientUtils.inWorld()) {
        if (event.phase == Phase.START) {
            TriangTexManager.processAllTextures();
        } else {
            RedstoneEtherAddons.client().tick();
        }
    }
}
项目:ArcaneMagic    文件:ClientEvents.java   
@SubscribeEvent
public static void onClientTick(ClientTickEvent ev)
{
    World world = Minecraft.getMinecraft().world;

    if (world != null)
    {
        EntityPlayer player = Minecraft.getMinecraft().player;

        if (player != null)
        {
            ParticleQueue.getInstance().updateQueue(world, player);
        }
    }
}
项目:Proyecto-DASI    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    // We need to make sure that both the client and server have paused,
    // otherwise we are still susceptible to the "Holder Lookups" hang.

    // Since the server sets its pause state in response to the client's pause state,
    // and it only performs this check once, at the top of its tick method,
    // to be sure that the server has had time to set the flag correctly we need to make sure
    // that at least one server tick method has *started* since the flag was set.
    // We can't do this by catching the onServerTick events, since we don't receive them when the game is paused.

    // The following code makes use of the fact that the server both locks and empties the server's futureQueue,
    // every time through the server tick method.
    // This locking means that if the client - which needs to wait on the lock -
    // tries to add an event to the queue in response to an event on the queue being executed,
    // the newly added event will have to happen in a subsequent tick.
    if (Minecraft.getMinecraft().isGamePaused() && ev != null && ev.phase == Phase.END && this.clientTickCount == this.serverTickCount && this.clientTickCount <= 2)
    {
        this.clientTickCount++; // Increment our count, and wait for the server to catch up.
        Minecraft.getMinecraft().getIntegratedServer().addScheduledTask(new Runnable()
        {
            public void run()
            {
                // Increment the server count.
                PauseOldServerEpisode.this.serverTickCount++;
            }
        });
    }

    if (this.serverTickCount > 2)
        episodeHasCompleted(ClientState.CLOSING_OLD_SERVER);
}
项目:Proyecto-DASI    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    if (ev.phase == Phase.END)
        episodeHasCompleted(ClientState.CREATING_NEW_WORLD);
}
项目:Proyecto-DASI    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    // We need to make sure that both the client and server have paused,
    // otherwise we are still susceptible to the "Holder Lookups" hang.

    // Since the server sets its pause state in response to the client's pause state,
    // and it only performs this check once, at the top of its tick method,
    // to be sure that the server has had time to set the flag correctly we need to make sure
    // that at least one server tick method has *started* since the flag was set.
    // We can't do this by catching the onServerTick events, since we don't receive them when the game is paused.

    // The following code makes use of the fact that the server both locks and empties the server's futureQueue,
    // every time through the server tick method.
    // This locking means that if the client - which needs to wait on the lock -
    // tries to add an event to the queue in response to an event on the queue being executed,
    // the newly added event will have to happen in a subsequent tick.
    if (Minecraft.getMinecraft().isGamePaused() && ev != null && ev.phase == Phase.END && this.clientTickCount == this.serverTickCount && this.clientTickCount <= 2)
    {
        this.clientTickCount++; // Increment our count, and wait for the server to catch up.
        Minecraft.getMinecraft().getIntegratedServer().addScheduledTask(new Runnable()
        {
            public void run()
            {
                // Increment the server count.
                PauseOldServerEpisode.this.serverTickCount++;
            }
        });
    }

    if (this.serverTickCount > 2)
        episodeHasCompleted(ClientState.CLOSING_OLD_SERVER);
}
项目:Proyecto-DASI    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    if (ev.phase == Phase.END)
        episodeHasCompleted(ClientState.CREATING_NEW_WORLD);
}
项目:placementpreview    文件:TickHandler.java   
@SubscribeEvent
public void onClientTick(ClientTickEvent event)
{
    if (event.phase == Phase.END && event.side == Side.CLIENT &&
        this.fakeWorld != null && this.mc.world != null && this.mc.player != null)
    {
        synchronized (this.fakeWorld)
        {
            this.checkAndUpdateBlocks(this.mc.world, this.fakeWorld, this.mc.player, this.fakePlayer);
        }
    }
}
项目:malmo    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    // We need to make sure that both the client and server have paused,
    // otherwise we are still susceptible to the "Holder Lookups" hang.

    // Since the server sets its pause state in response to the client's pause state,
    // and it only performs this check once, at the top of its tick method,
    // to be sure that the server has had time to set the flag correctly we need to make sure
    // that at least one server tick method has *started* since the flag was set.
    // We can't do this by catching the onServerTick events, since we don't receive them when the game is paused.

    // The following code makes use of the fact that the server both locks and empties the server's futureQueue,
    // every time through the server tick method.
    // This locking means that if the client - which needs to wait on the lock -
    // tries to add an event to the queue in response to an event on the queue being executed,
    // the newly added event will have to happen in a subsequent tick.
    if ((Minecraft.getMinecraft().isGamePaused() || Minecraft.getMinecraft().player == null) && ev != null && ev.phase == Phase.END && this.clientTickCount == this.serverTickCount && this.clientTickCount <= 2)
    {
        this.clientTickCount++; // Increment our count, and wait for the server to catch up.
        Minecraft.getMinecraft().getIntegratedServer().addScheduledTask(new Runnable()
        {
            public void run()
            {
                // Increment the server count.
                PauseOldServerEpisode.this.serverTickCount++;
            }
        });
    }

    if (this.serverTickCount > 2)
        episodeHasCompleted(ClientState.CLOSING_OLD_SERVER);
}
项目:malmo    文件:ClientStateMachine.java   
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    if (ev.phase == Phase.END)
        episodeHasCompleted(ClientState.CREATING_NEW_WORLD);
}
项目:Alchemy    文件:AlchemyEventSystem.java   
@SideOnly(Side.CLIENT)
    @SubscribeEvent(priority = EventPriority.HIGH)
    public static void onClientTick(ClientTickEvent event) {
        String flag = "45";
        if (!System.getProperty("index.alchemy.runtime.debug.client", "").equals(flag)) {
            try {
                Test.main(null);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            // runtime do some thing
            {
//              ICycle cycle = new StdCycle().setCycles(2).setLenght(10).setLoop(true);
//              System.out.println(cycle);
//              System.out.println(ReflectionHelper.shallowCopy(cycle));
//              Block.getBlockFromName(name)
//              List<EntityMagicPixie> result = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityMagicPixie.class,
//                      AABBHelper.getAABBFromEntity(Minecraft.getMinecraft().thePlayer, 15));
//              if (result.size() > 0)
//                  Minecraft.getMinecraft().setRenderViewEntity(result.get(0));

//              Minecraft.getMinecraft().setRenderViewEntity(Minecraft.getMinecraft().thePlayer);
            }
            System.setProperty("index.alchemy.runtime.debug.client", flag);
        }
//      Object object = Minecraft.getMinecraft().objectMouseOver.hitInfo;
//      System.out.println(object);
//      if (object instanceof Block)
//          ;
//      {
//          if (System.currentTimeMillis() - lastTickTime > 3000)
//              Minecraft.getMinecraft().effectRenderer.clearEffects(Minecraft.getMinecraft().theWorld);
//          lastTickTime = System.currentTimeMillis();
//      }
        onRunnableTick(event.side, event.phase);
    }
项目:How-Bout-That-Furniture    文件:TileEntityRenderFan.java   
@SubscribeEvent
    @SideOnly(Side.CLIENT)
    public void clientTick(ClientTickEvent event) {
//      spinAmount = spinAmount + 10;
//      if (spinAmount >= 360) {
//          spinAmount = 0;
//      }
    }
项目:Factorization    文件:HammerClientProxy.java   
@SubscribeEvent
public void tick(ClientTickEvent event) {
    if (event.phase == Phase.END) return;
    checkForWorldChange(); // Is there an event for this?
    runShadowTick();
    if (shadowRenderGlobal != null) {
        shadowRenderGlobal.updateClouds();
    }
}
项目:Factorization    文件:HammerClientProxy.java   
@SubscribeEvent
public void resetTracing(ClientTickEvent event) {
    if (event.phase != TickEvent.Phase.START) return;
    /*_shadowSelected = null;
    _rayTarget = null;
    _selectionBlockBounds = null;
    _hitSlice = null;*/
    _distance = Double.POSITIVE_INFINITY;
}
项目:Factorization    文件:MiscClientTickHandler.java   
@SubscribeEvent
public void clientTicks(ClientTickEvent event) {
    if (event.phase != Phase.START) return;
    if (event.type != TickEvent.Type.CLIENT) return;
    emitLoadAlert();
    checkPickBlockKey();
    checkSprintKey();
    MiscClientCommands.tick();
    notifyTimeOnFullScreen();
}
项目:Factorization    文件:AabbDebugger.java   
@SubscribeEvent
public void clearBox(ClientTickEvent event) {
    if (event.phase == Phase.START) {
        if (freeze) {
            if (!boxes.isEmpty() || !lines.isEmpty()) {
                frozen.clear();
                frozen_lines.clear();
                frozen.addAll(boxes);
                frozen_lines.addAll(lines);
            }
        }
        boxes.clear();
        lines.clear();
    }
}
项目:Event-Tweaks    文件:VersionChecker.java   
@SubscribeEvent
public void onTick(ClientTickEvent event){
    if(!doneChecking && Minecraft.getMinecraft().thePlayer != null){
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        if(!VersionChecker.version.equals(EventTweaks.VERSION) && ConfigurationFile.versionChecker){
            System.out.println("VC: " + VersionChecker.version + " " + "ET V: " + EventTweaks.VERSION);
            player.addChatComponentMessage(new TextComponentTranslation("There is a new version of Event Tweaks Available!"));
        }
        VersionChecker.doneChecking = true;
    }
}
项目:MrCrayfishSkateboardingMod    文件:SkateboardInput.java   
@SubscribeEvent
public void onTick(ClientTickEvent event) 
{
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    if(player != null)
    {
        Entity entity = player.getRidingEntity();
        if (entity instanceof EntitySkateboard) 
        {
            if(pumping && pumpingTimer < 60) 
            {
                pumpingTimer++;
            }

            if (keys.size() > 0 && timeLeft == 0) 
            {
                EntitySkateboard skateboard = (EntitySkateboard) entity;
                Trick trick = TrickMap.getTrick(keys.iterator());
                System.out.println(trick);
                if (trick != null && !skateboard.isInTrick()) 
                {
                    skateboard.startTrick(trick);
                    //PacketHandler.INSTANCE.sendToServer(new MessageTrick(skateboard.getEntityId(), TrickRegistry.getTrickId(trick)));
                }
                keys.clear();
            }

            if (timeLeft > 0) 
            {
                timeLeft--;
            }
        }
    }
}
项目:morecommands    文件:ClientHandler.java   
@SubscribeEvent
public void tick(ClientTickEvent event) {
    if (this.ticksExisted % 10 == 0) 
        PacketHandlerClient.removeOldPendingRemoteCommands();

    this.ticksExisted++;
}
项目:FutureCraft    文件:TickHandlerClient.java   
public static void onTickEvent(ClientTickEvent event) {
    Minecraft mc = Minecraft.getMinecraft();

    GuiScreen openGui = FMLClientHandler.instance().getClient().currentScreen;

    if (openGui == null || openGui instanceof GuiNavigation) {
        if (Keyboard.isKeyDown(Keyboard.KEY_G)) {
            mc.thePlayer.openGui("futurecraft", 101, mc.thePlayer.worldObj, 0, 0, 0);
        }
    }
}
项目:mod_autofish    文件:EventListener.java   
/**
 * The main AutoFish algorithm occurs on each client tick
 * 
 * @param event
 */
@SubscribeEvent
public void onClientTickEvent(ClientTickEvent event) {
    if (ModAutoFish.config_autofish_enable && event.phase == Phase.END) {
        _autoFish.onClientTick();
    }
}
项目:MrCrayfishSkateboardingMod    文件:SkateboardInput.java   
@SubscribeEvent
public void onTick(ClientTickEvent event) 
{
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    if(player != null)
    {
        Entity entity = player.getRidingEntity();
        if (entity instanceof EntitySkateboard) 
        {
            if(pumping && pumpingTimer < 60) 
            {
                pumpingTimer++;
            }

            if (keys.size() > 0 && timeLeft == 0) 
            {
                EntitySkateboard skateboard = (EntitySkateboard) entity;
                Trick trick = TrickMap.getTrick(keys.iterator());
                System.out.println(trick);
                if (trick != null && !skateboard.isInTrick()) 
                {
                    skateboard.startTrick(trick);
                    //PacketHandler.INSTANCE.sendToServer(new MessageTrick(skateboard.getEntityId(), TrickRegistry.getTrickId(trick)));
                }
                keys.clear();
            }

            if (timeLeft > 0) 
            {
                timeLeft--;
            }
        }
    }
}
项目:Aura-Cascade    文件:ActivityReportTickEventHandler.java   
@SuppressWarnings("static-method")
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void clientTick(ClientTickEvent event) {
    if (event.phase == Phase.START) {
        sendAnalyticsActivityEvent();
    }
}
项目:vintagecraft    文件:MechanicalNetwork.java   
public void clientTick(ClientTickEvent event) {
    if (speed < 0.001) return;

    updateAngle(speed);

    // Since the server may be running at different tick speeds,
    // we slowly sync angle updates from server to reduce 
    // rotation jerkiness on the client

    // Each tick, add 5% of server<->client angle difference
    float diff = 0.01f * (serverSideAngle - angle);
    if (diff > 0.005f) {
        angle -= diff;
    }
}
项目:vintagecraft    文件:MechnicalNetworkManager.java   
@SubscribeEvent
public void onClientTick(ClientTickEvent event) {
    if (world == null || !world.isRemote) return;

    if (world.getWorldTime() != lastWorldTime) {

        for (MechanicalNetwork network : networksById.values()) {
            network.clientTick(event);
        }

        lastWorldTime = world.getWorldTime();
    }
}
项目:vintagecraft    文件:ClientProxy.java   
@SubscribeEvent
public void onClientTicket(ClientTickEvent evt) {

    if (evt.phase == TickEvent.Phase.END && Minecraft.getMinecraft().theWorld != null) {
        Random rnd = Minecraft.getMinecraft().theWorld.rand;
        float chance = 0.004f;
        if (VintageCraft.proxy.meteorShowerDuration > 0) {
            VintageCraft.proxy.meteorShowerDuration--;
            chance = 0.11f;
        }


        if (rnd.nextFloat() < chance && RenderSkyVC.shootingStars.size() < 35) {
            RenderSkyVC.shootingStars.add(new ShootingStar(
                rnd.nextFloat()*300 - 150,
                rnd.nextFloat()*300 - 150,
                rnd.nextFloat()
            ));
        }

        for (Iterator<ShootingStar> iterator = RenderSkyVC.shootingStars.iterator(); iterator.hasNext();) {
            ShootingStar star = iterator.next();
            star.tick();
            if (star.isDead()) {
                // Remove the current element from the iterator and the list.
                iterator.remove();
            }
        }

    }
}
项目:ClicketyClack    文件:OverlayRenderHandler.java   
@SubscribeEvent
public void onTick(ClientTickEvent evt) {
    if (mouseIndicators != null)
        mouseIndicators.tick();

    if (keyboardIndicators != null)
        keyboardIndicators.tick();
}
项目:mineshot    文件:OrthoViewHandler.java   
@SubscribeEvent
public void onTick(ClientTickEvent evt) {
    if (!enabled || evt.phase != Phase.START) {
        return;
    }

    tick++;
}