當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。