当前位置: 首页>>代码示例>>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;未经允许,请勿转载。