当前位置: 首页>>代码示例>>Java>>正文


Java TickType类代码示例

本文整理汇总了Java中cpw.mods.fml.common.TickType的典型用法代码示例。如果您正苦于以下问题:Java TickType类的具体用法?Java TickType怎么用?Java TickType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TickType类属于cpw.mods.fml.common包,在下文中一共展示了TickType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyDown

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
public void keyDown( EnumSet< TickType > types, KeyBinding kb, boolean tickEnd, boolean isRepeat )
{
	if ( tickEnd )
	{
		return;
	}
	
	if ( kb.keyDescription.equals( ToggleSpawners.toggleKey.keyDescription ) )
	{
		ToggleSpawners.spawnersActive = !ToggleSpawners.spawnersActive;
	}
	else if ( kb.keyDescription.equals( ToggleSpawners.renderKey.keyDescription ) )
	{
		ToggleSpawners.shouldRender = !ToggleSpawners.shouldRender;
	}
}
 
开发者ID:spacechase0,项目名称:OldMods,代码行数:17,代码来源:KeyHandler.java

示例2: keyDown

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> type, KeyBinding kb, boolean end, boolean repeats)
{
    if (!end)
    {
        return;
    }
    int idx = helper.indexOf(kb);
    if (type.contains(TickType.CLIENT))
    {
        armed[idx] = true;
    }
    if (armed[idx] && type.contains(TickType.RENDER) && (!active[idx] || mlRepeats[idx]))
    {
        fireKeyEvent(kb);
        active[idx] = true;
        armed[idx] = false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:20,代码来源:ModLoaderKeyBindingHandler.java

示例3: keyTick

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void keyTick(EnumSet<TickType> type, boolean tickEnd)
{
    for (int i = 0; i < keyBindings.length; i++)
    {
        KeyBinding keyBinding = keyBindings[i];
        int keyCode = keyBinding.field_74512_d;
        boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
        if (state != keyDown[i] || (state && repeatings[i]))
        {
            if (state)
            {
                keyDown(type, keyBinding, tickEnd, state!=keyDown[i]);
            }
            else
            {
                keyUp(type, keyBinding, tickEnd);
            }
            if (tickEnd)
            {
                keyDown[i] = state;
            }
        }

    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:26,代码来源:KeyBindingRegistry.java

示例4: tickEnd

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
	if (!type.contains(TickType.PLAYER)) return;
       
       EntityLivingBase user = (EntityLivingBase) tickData[0];
       
       if (cfg.burnPlayer && user != null && user.ticksExisted % 20 == 0)
       {
       	if(user instanceof EntityPlayer)
       	{
       		burnInv((EntityPlayer)user);
       	}
       	else if(isHotItem(user.getHeldItem()))
       	{
       		user.attackEntityFrom(DamageSource.inFire, 1);
       		user.playSound("random.fizz", 1.0F, 1.0F);
       	}
       		
       }
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:21,代码来源:HotItemTickHandler.java

示例5: tickStart

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	if(type.equals(EnumSet.of(TickType.RENDER))){
		ShoulderRenderBin.skipPlayerRender = false;
		
		//attempt to ray trace
		RayTracer.traceFromEyes(1.0F);
		
		if(ShoulderRenderBin.rayTraceHit != null){
			if(ShoulderSurfing.mc.thePlayer != null){
				//calculate the difference
				ShoulderRenderBin.rayTraceHit.xCoord -= ShoulderSurfing.mc.thePlayer.posX;
				ShoulderRenderBin.rayTraceHit.yCoord -= ShoulderSurfing.mc.thePlayer.posY;
				ShoulderRenderBin.rayTraceHit.zCoord -= ShoulderSurfing.mc.thePlayer.posZ;
			}
		}
		
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:20,代码来源:ShoulderTickHandler.java

示例6: keyDown

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
	/* minecraft ought to be running and with no gui up */
	if(ShoulderSurfing.mc != null && ShoulderSurfing.mc.currentScreen == null){
		if (ShoulderSurfing.mc.gameSettings.thirdPersonView == 1){
			if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
				ShoulderCamera.adjustCameraLeft();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
				ShoulderCamera.adjustCameraRight();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
				ShoulderCamera.adjustCameraIn();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
				ShoulderCamera.adjustCameraOut();
			}
			
			ShoulderSurfing.writeConfig();
		}
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:23,代码来源:ShoulderKeyHandler.java

示例7: tickStart

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	if(type.equals(EnumSet.of(TickType.RENDER))){
		//attempt to ray trace
		RayTraceHelper.traceFromEyes(1.0F);
		
		if(ShoulderHelper.rayTraceHit != null){
			if(ShoulderSurfing.mc.thePlayer != null){
				ShoulderHelper.rayTraceHit.xCoord -= ShoulderSurfing.mc.thePlayer.posX;
				ShoulderHelper.rayTraceHit.yCoord -= ShoulderSurfing.mc.thePlayer.posY;
				ShoulderHelper.rayTraceHit.zCoord -= ShoulderSurfing.mc.thePlayer.posZ;
			}
		}
		
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:17,代码来源:ShoulderTickHandler.java

示例8: sendTick

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void sendTick(EnumSet<TickType> types, boolean end, Object... tickData)
{
    for (TickType type : types)
    {
        if (!ticks.contains(type))
        {
            continue;
        }

        boolean keepTicking=true;
        if (sendGuiTicks)
        {
            keepTicking = mod.doTickInGUI(type, end, tickData);
        }
        else
        {
            keepTicking = mod.doTickInGame(type, end, tickData);
        }
        if (!keepTicking) {
            ticks.remove(type);
            ticks.removeAll(type.partnerTicks());
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:BaseModTicker.java

示例9: tickStart

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	if(type.equals(EnumSet.of(TickType.RENDER))){
		ShoulderRenderBin.skipPlayerRender = false;
		
		//attempt to ray trace
		RayTracer.traceFromEyes(1.0F);
		
		if(ShoulderRenderBin.rayTraceHit != null){
			if(ShoulderLoader.mc.thePlayer != null){
				//calculate the difference
				ShoulderRenderBin.rayTraceHit.xCoord -= ShoulderLoader.mc.thePlayer.posX;
				ShoulderRenderBin.rayTraceHit.yCoord -= ShoulderLoader.mc.thePlayer.posY;
				ShoulderRenderBin.rayTraceHit.zCoord -= ShoulderLoader.mc.thePlayer.posZ;
			}
		}
		
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:20,代码来源:ShoulderTickHandler.java

示例10: keyDown

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
	/* minecraft ought to be running and with no gui up */
	if(ShoulderLoader.mc != null && ShoulderLoader.mc.currentScreen == null){
		if (ShoulderLoader.mc.gameSettings.thirdPersonView == 1){
			if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
				ShoulderCamera.adjustCameraLeft();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
				ShoulderCamera.adjustCameraRight();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
				ShoulderCamera.adjustCameraIn();
			}
			else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
				ShoulderCamera.adjustCameraOut();
			}
			
			ShoulderSurfing.writeConfig();
		}
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:23,代码来源:ShoulderKeyHandler.java

示例11: keyDown

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
	if (ShoulderSurfing.mc.gameSettings.thirdPersonView == 1 ){
		if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
			ShoulderHelper.adjustCameraLeft();
		}
		else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
			ShoulderHelper.adjustCameraRight();
		}
		else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
			ShoulderHelper.adjustCameraIn();
		}
		else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
			ShoulderHelper.adjustCameraOut();
		}
		
		ShoulderSurfing.writeConfig();
	}
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:20,代码来源:ShoulderKeyHandler.java

示例12: tickStart

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	long tick = System.nanoTime();
	
	//If one second has passed
	if (tick - lastTick > 1000000000) {
		lastTick = lastTick + 1000000000;
		secondsRemaining--;
		
		if (secondsRemaining == 0) {
			event.countdownOver();
			tickType = EnumSet.noneOf(TickType.class);
		}
		
		if (notifications.containsKey(secondsRemaining)) {
			Chat.sendToAllPlayers(notifications.get(secondsRemaining));
		}
		
	}
}
 
开发者ID:becelot,项目名称:TeamCore,代码行数:21,代码来源:Countdown.java

示例13: keyTick

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void keyTick(EnumSet<TickType> type, boolean tickEnd)
{
    for (int i = 0; i < keyBindings.length; i++)
    {
        KeyBinding keyBinding = keyBindings[i];
        int keyCode = keyBinding.keyCode;
        boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
        if (state != keyDown[i] || (state && repeatings[i]))
        {
            if (state)
            {
                keyDown(type, keyBinding, tickEnd, state!=keyDown[i]);
            }
            else
            {
                keyUp(type, keyBinding, tickEnd);
            }
            if (tickEnd)
            {
                keyDown[i] = state;
            }
        }

    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:26,代码来源:KeyBindingRegistry.java

示例14: tickEnd

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd( EnumSet< TickType > type, Object... tickData )
{
	Minecraft mc = FMLClientHandler.instance().getClient();
	if ( mc.currentScreen == null && ToggleSpawners.shouldRenderText() )
	{
		GL11.glColor3f( 1.f, 1.f, 1.f );
		String str = "Spawners " + ( ToggleSpawners.areSpawnersActive() ? "Active" : "Inactive" );
		mc.fontRenderer.drawStringWithShadow( str, 5, 5, 0xFFFFFFFF );
	}
}
 
开发者ID:spacechase0,项目名称:OldMods,代码行数:12,代码来源:StatusTextRenderer.java

示例15: tickEnd

import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd( EnumSet< TickType > type, Object... tickData )
{
	EntityPlayer player = ( EntityPlayer ) tickData[ 0 ];
	if ( player.worldObj.isRemote )
	{
		return;
	}
	
	Long time = lastTickTimes.get( player );
	if ( time == null )
	{
		lastTickTimes.put( player, new Long( System.currentTimeMillis() ) );
		time = lastTickTimes.get( player );
	}
	
	Long curr = System.currentTimeMillis();
	if ( Math.abs( time - curr ) >= 1000 )
	{
		lastTickTimes.put( player, curr );
		
		int resist = 1;
		InventoryPlayer inv = player.inventory;
		for ( ItemStack stack : inv.armorInventory )
		{
			resist += checkItem( stack ) * 5;
		}
		
		if ( resist == 1 || rand.nextInt( resist ) == 0 )
		{
			doToxicRain( player );
		}
	}
}
 
开发者ID:spacechase0,项目名称:OldMods,代码行数:35,代码来源:ToxicRainTickHandler.java


注:本文中的cpw.mods.fml.common.TickType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。