當前位置: 首頁>>代碼示例>>Java>>正文


Java TickEvent.ClientTickEvent方法代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TickEvent.ClientTickEvent方法的具體用法?Java TickEvent.ClientTickEvent怎麽用?Java TickEvent.ClientTickEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.fml.common.gameevent.TickEvent的用法示例。


在下文中一共展示了TickEvent.ClientTickEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: tickEnd

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void tickEnd(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.END) {
        if (Minecraft.getMinecraft().player == null) {
            for (IUpgradeRenderHandler handler : UpgradeRenderHandlerList.instance().upgradeRenderers) {
                handler.reset();
            }
        }
        TICKS++;
        ModuleRegulatorTube.hasTicked = false;
        ModuleRegulatorTube.inverted = false;
        ModuleRegulatorTube.inLine = true;
        for (int i = 0; i < updatedObjects.size(); i++) {
            INeedTickUpdate updatedObject = updatedObjects.get(i).get();
            if (updatedObject != null) {
                updatedObject.update();
            } else {
                updatedObjects.remove(i);
                i--;
            }
        }
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:24,代碼來源:ClientTickHandler.java

示例2: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
    if(event.phase == TickEvent.Phase.END)
    {
        Minecraft mc = Minecraft.getMinecraft();
        if(!mc.isGamePaused())
        {
            Iterator<Track> ite = tracksPlaying.iterator();
            while(ite.hasNext())
            {
                Track track = ite.next();
                if(!track.update())
                {
                    ite.remove();
                    continue;
                }
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:Clef,代碼行數:22,代碼來源:EventHandlerClient.java

示例3: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
    //check if the player is really riding a entity
    if (MC.player != null && MC.player.getRidingEntity() != null) {

        ForgeHaxHooks.isNoClampingActivated = noClamp.getAsBoolean();
        ForgeHaxHooks.isNoBoatGravityActivated = noGravity.getAsBoolean();
        ForgeHaxHooks.isBoatSetYawActivated = setYaw.getAsBoolean();

        if (MC.gameSettings.keyBindJump.isKeyDown()) {
            //trick the riding entity to think its onground
            MC.player.getRidingEntity().onGround = false;

            //teleport up
            MC.player.getRidingEntity().motionY = MC.gameSettings.keyBindSprint.isKeyDown() ? 5 : 1.5;
        }  else {
            MC.player.getRidingEntity().motionY = MC.gameSettings.keyBindSprint.isKeyDown() ? -1.0 : -speedY.getAsDouble();
        }

        /*if ((MC.player.posY <= maintainY.getAsDouble()-5D) && (MC.player.posY > maintainY.getAsDouble()-10D) && maintainY.getAsDouble() != 0D)
            MC.player.getRidingEntity().setPositionAndUpdate(MC.player.posX, maintainY.getAsDouble(), MC.player.posZ );*/

        setMoveSpeedEntity(speed.getAsDouble());

    }
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:27,代碼來源:BoatFly.java

示例4: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent ev)
{
	if (this.missionIsRunning)
	{
 	// Use the client tick to fire messages to the server to request up-to-date stats.
 	// We can then use those stats to fire back to the agent in writeObservationsToJSON.
		ObservationRequestMessage message = createObservationRequestMessage();
		// To make sure only the intended listener receives this message, set the id now:
		message.id = System.identityHashCode(this);
 	MalmoMod.network.sendToServer(message);
	}
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:14,代碼來源:ObservationFromServer.java

示例5: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event)
{
	if (Minecraft.getMinecraft().world != null && Minecraft.getMinecraft().world.provider != null && Minecraft.getMinecraft().world.provider.getDimension() == 0)
	{
	    if (SettingsClient.instance.enableCustomRain || SettingsClient.instance.enableCustomRain)
           {
               if (!(Minecraft.getMinecraft().world.provider.getSkyRenderer() instanceof WorldSkyRenderer))
               {
                   if (SettingsClient.instance.enableCustomSky)
                   {
                       Minecraft.getMinecraft().world.provider.setSkyRenderer(WorldSkyRenderer.getInstance());
                   }

                   if (SettingsClient.instance.enableCustomRain)
                   {
                       Minecraft.getMinecraft().world.provider.setWeatherRenderer(WorldWeatherRenderer.getInstance());
                   }
               }
           }
	}

       if (Minecraft.getMinecraft().world != null && event.phase == TickEvent.Phase.START)
       {
           ExPMisc.defaultParticleEngineImpl.tick();
       }
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:28,代碼來源:ExPHandlerClient.java

示例6: clientTicks

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void clientTicks(TickEvent.ClientTickEvent event) {
    if (event.phase != TickEvent.Phase.START) return;
    i++;
    if (watchDog != null) {
        // Pat Lagssie
        watchDog.ticks++;
    } else if (i == 40) {
        watchDog = new LagssieWatchDog("LAG-CLIENT", Thread.currentThread(), Lagssie.intervalClient);
        watchDog.start();
    }
}
 
開發者ID:asiekierka,項目名稱:LagssieMC,代碼行數:13,代碼來源:LagssieClient.java

示例7: onWorldTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldTick(TickEvent.ClientTickEvent event)
{
    Minecraft mc = Minecraft.getMinecraft();
    if(event.phase == TickEvent.Phase.END && mc.world != null)
    {
        if(firing > 0)
        {
            firing--;
        }
    }
}
 
開發者ID:iChun,項目名稱:Torched,代碼行數:13,代碼來源:EventHandlerClient.java

示例8: tickEvent

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@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.isKeyDown()) || 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.
    }
}
 
開發者ID:CreeperHost,項目名稱:CreeperHostGui,代碼行數:31,代碼來源:EventHandler.java

示例9: clientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void clientTick(final TickEvent.ClientTickEvent event)
{
	if (event.phase != TickEvent.Phase.END) return;

	boolean currentState = OPEN_ARMOR_STAND_GUI.isKeyDown();
	if (currentState != previousState)
	{
		VillagerInventoryMod.NETWORK.sendToServer(new EntityFlagMessage(Minecraft.getMinecraft().player, 2, currentState));
		previousState = currentState;
	}

}
 
開發者ID:crazysnailboy,項目名稱:VillagerInventory,代碼行數:14,代碼來源:ModKeyBindings.java

示例10: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@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);
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:38,代碼來源:ClientStateMachine.java

示例11: onTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onTick(TickEvent.ClientTickEvent event){
	if (event.side == Side.CLIENT && event.phase == TickEvent.Phase.START){
		ClientProxy.particleRenderer.updateParticles();
	}
}
 
開發者ID:TeamMelodium,項目名稱:Melodium,代碼行數:8,代碼來源:ParticleRenderer.java

示例12: renderTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void renderTick(TickEvent.ClientTickEvent event)
{
	if(gui != null && Minecraft.getMinecraft().world != null)
	{
		gui.update();
	}
}
 
開發者ID:Lemonszz,項目名稱:Anima-Mundi,代碼行數:9,代碼來源:GuiAnalyser.java

示例13: clientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.LOWEST)
public void clientTick(TickEvent.ClientTickEvent e) {
    Replace();
}
 
開發者ID:Maxwell-lt,項目名稱:TitleChanger,代碼行數:5,代碼來源:ReplaceTitle.java

示例14: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
    MinecraftForge.EVENT_BUS.unregister(this);
    Minecraft.getMinecraft().displayGuiScreen(this);
}
 
開發者ID:boomboompower,項目名稱:TextDisplayer,代碼行數:6,代碼來源:MainGui.java

示例15: onClientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
    if(event.phase == TickEvent.Phase.END)
    {
        Minecraft mc = Minecraft.getMinecraft();
        if(mc.world != null)
        {
            if(!clickedPos.equals(BlockPos.ORIGIN))
            {
                TileEntity te = mc.world.getTileEntity(clickedPos);
                if(te instanceof TileEntityGlassBase && ((TileEntityGlassBase)te).active && mc.playerController.getIsHittingBlock())
                {

                    TileEntityGlassBase base = (TileEntityGlassBase)te;
                    if(base.fadeoutTime < TileEntityGlassBase.FADEOUT_TIME - TileEntityGlassBase.PROPAGATE_TIME)
                    {
                        base.fadeoutTime = TileEntityGlassBase.FADEOUT_TIME;
                        base.fadePropagate = TileEntityGlassBase.PROPAGATE_TIME;
                        base.fadeDistance = 2;
                        base.fadePropagate();
                    }
                }
                else
                {
                    clickedPos = BlockPos.ORIGIN;
                }
            }
            Iterator<Map.Entry<String, Integer>> ite = terminalPlacementCreationTimeout.entrySet().iterator();
            while(ite.hasNext())
            {
                Map.Entry<String, Integer> e = ite.next();
                e.setValue(e.getValue() - 1);
                if(e.getValue() < 0)
                {
                    ite.remove();
                }
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:42,代碼來源:EventHandlerClient.java


注:本文中的net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。