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


Java RenderTickEvent类代码示例

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


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

示例1: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
	b = b + 0.01F;
	e = e + 0.07F;
	a = a + 0.01F;
//	System.out.println(b + " / " + e + " / " + a);
	if (b >= 180F) {
		b = -180F;
	}
	if (e >= 180F) {
		e = -180F;
	}
	if (a >= 180F) {
		a = -180F;
	}
}
 
开发者ID:eliteznightmare,项目名称:LibraCraft,代码行数:17,代码来源:RenderTickHandler.java

示例2: TickEvent

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
	
	config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory
            + DefaultProps.defaultConfigFile));
    config.load();                
    displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth);
    config.save();
   
    if (event.phase == Phase.END && displayBossHealth) {
        if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
            renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health");
        }
        
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10,代码行数:17,代码来源:BossHealthDisplayTicker.java

示例3: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
	if(event.phase == Phase.END) {
		Minecraft mc = Minecraft.getMinecraft();
		if(mc.currentScreen instanceof net.minecraft.client.gui.GuiMainMenu && !(mc.currentScreen instanceof GuiMainMenu)) {
			mc.displayGuiScreen(new GuiMainMenu());
		}
		if(!(mc.ingameGUI instanceof GuiInGame)) {
			mc.ingameGUI = new GuiInGame(mc);
		}
		if(GuiTechTreeComponent.instance == null) {
			GuiTechTreeComponent.instance = new GuiTechTreeComponent();
		}
		GuiTechTreeComponent.instance.updateTechTreeWindow();
	}
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:17,代码来源:ACTickHandlerClient.java

示例4: RenderTickEvent

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void RenderTickEvent(RenderTickEvent event) {
    if ((event.type == Type.RENDER || event.type == Type.CLIENT) && event.phase == Phase.END) {
        Minecraft mc = Minecraft.getMinecraft();
        if (!ticked && mc.ingameGUI != null) {
            mc.ingameGUI = new GuiAdvancedHUD(mc);
            ticked = true;
        }
        if (firstload && mc != null) {
            if (!SaveController.loadConfig("config")) {
                HUDRegistry.checkForResize();
                HUDRegistry.resetAllDefaults();
                SaveController.saveConfig("config");
            }
            firstload = false;
        }
        // TODO Add notification on main menu when an update for advancedhud is available :)
        // if (mc.currentScreen instanceof GuiMainMenu) {
        // int mouseX = Mouse.getX() * mc.currentScreen.width / mc.displayWidth;
        // int mouseY = mc.currentScreen.height - Mouse.getY() * mc.currentScreen.height / mc.displayHeight - 1;
        // RenderAssist.drawCircle(mouseX, mouseY, 3, 24, 0xFFFFFFFF);
        // RenderAssist.drawRect(1, 1, 70, 11, 0x608f3eff);
        // mc.currentScreen.drawString(mc.fontRenderer, "AdvancedHUD!", 2, 2, 0x48dce9);
        // }
    }
}
 
开发者ID:maxpowa,项目名称:AdvancedHUD,代码行数:27,代码来源:TickHandler.java

示例5: invoke

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public void invoke(Event event) {
    if (event instanceof RenderTickEvent)
        new sl.steeldood.bit.client.event.impl.RenderTickEvent().call();
    else
        new ClientTickEvent().call();

}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:9,代码来源:TickEventDispatcher.java

示例6: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
    if (!addRenderTick.isEmpty()) {
        hRenderTick.addAll(addRenderTick);
        addRenderTick.clear();
    }
    for (Iterator<LIHandler> it = hRenderTick.iterator(); it.hasNext(); ) {
        LIHandler handler = it.next();
        if (handler.isDead())
            it.remove();
        else
            handler.trigger(event);
    }
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:15,代码来源:LIFMLGameEventDispatcher.java

示例7: tickEnd

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tickEnd( RenderTickEvent event )
{
	if ( !event.phase.equals( TickEvent.Phase.END ) )
	{
		return;
	}
	Minecraft mc = FMLClientHandler.instance().getClient();
	
	if ( mc.currentScreen != null || renderObj == null || renderMethod == null )
	{
		return;
	}
	
	EntityPlayer player = mc.thePlayer;
	
	ItemStack chestplate = player.getCurrentArmor( 2 );
	if ( chestplate == null || chestplate.getItem() != ComponentEquipment.items.chestplate )
	{
		return;
	}
	ArmorItem armor = ( ArmorItem ) chestplate.getItem();
	
	if ( armor.armor.getModifierLevel( chestplate, "hoverHarness" ) <= 0 )
	{
		return;
	}
	
	ItemStack harnessStack = ItemApi.getItem( "itemHoverHarness", 0 );
	harnessStack.setTagCompound( chestplate.getTagCompound() );
	
	try
	{
		renderMethod.invoke( renderObj, ( Float ) event.renderTickTime, player, System.currentTimeMillis(), harnessStack );
	}
	catch ( Exception exception )
	{
		exception.printStackTrace();
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:41,代码来源:HarnessFuelRenderer.java

示例8: renderTick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void renderTick(RenderTickEvent tick) {
    if (tick.phase == TickEvent.Phase.END) {
        Minecraft mc = Minecraft.getMinecraft();
        if (mc.inGameHasFocus) {
            boolean renderMana = false;
            ItemStack hand = mc.thePlayer.getCurrentEquippedItem();
            IPlayerSession session;
            if (Rings.proxy.manaHandler.playerHasSession(mc.thePlayer)) {
                session = Rings.proxy.manaHandler.getPlayerSession(mc.thePlayer);
                if (SimpleUtil.displayHud(mc.thePlayer))
                    renderMana = SimpleUtil.displayHud(mc.thePlayer);
                if (hand != null && !renderMana) {
                    if (hand.getItem() instanceof ItemMagicRing) {
                        if (hand.getTagCompound() != null) {
                            NBTTagCompound handtag = hand.getTagCompound().hasKey(ModLibs.RING_TAG) ? hand.getTagCompound().getCompoundTag(ModLibs.RING_TAG) : null;
                            if (handtag != null && handtag.hasKey(ModLibs.SPELL_ID))
                                renderMana = true;
                        }
                    }
                }
                if (renderMana) {
                    String mpInfo = StatCollector.translateToLocal(ModLibs.MANA) + ": " + session.getMana() + " / " + session.getMaxMana();
                    mc.fontRenderer.drawString(mpInfo, ModLibs.DISPLAY_X + 1, ModLibs.DISPLAY_Y + 1, 0x000000);
                    mc.fontRenderer.drawString(mpInfo, ModLibs.DISPLAY_X, ModLibs.DISPLAY_Y, 0x00C4C4);
                }
            }
        }
    }
}
 
开发者ID:Lomeli12,项目名称:MagicalRings,代码行数:31,代码来源:TickHandlerClient.java

示例9: TickEvent

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
    if (event.phase == Phase.END) {
        if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
            renderBossHealthBar(targetBoss, "Pharaoh Health");
        }
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:9,代码来源:BossHealthDisplayTicker.java

示例10: onRenderStart

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderStart(RenderTickEvent event) {
	if(event.phase == Phase.START) {
		float ctime = (float) Math.floor(time) + event.renderTickTime;
		delta = (ctime - time) * 50;
		time = ctime;
		EmoteHandler.clearPlayerList();
	}
}
 
开发者ID:Vazkii,项目名称:Emotes,代码行数:10,代码来源:ClientProxy.java

示例11: tick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void tick(RenderTickEvent event)
{
	Minecraft mc = Minecraft.getMinecraft();
	if(event.phase == Phase.END && mc.thePlayer != null && mc.inGameHasFocus)
	{
		boolean hasBattery = false;
		int maxpower = 0;
		int power = 0;
		RandomItemBattery heighest = null;
		for (int i = 0; i < mc.thePlayer.inventory.mainInventory.length; i++) {
			RandomItem item = RandomItem.getRandomItem(mc.thePlayer.inventory.mainInventory[i]);
			if(item instanceof RandomItemBattery)
			{
				maxpower += ((RandomItemBattery) item).maxDamage;
				if(heighest == null || ((RandomItemBattery) item).maxDamage > heighest.maxDamage)
					heighest = (RandomItemBattery) item;
				power += ((RandomItemBattery) item).getPower(mc.thePlayer.inventory.mainInventory[i]);
				hasBattery = true;
			}
		}
		if(hasBattery)
		{
			//RenderHelper2D.renderIcon(Blocks.iron_block.getBlockTextureFromSide(0), 3, 3, 1, true, 0, 100, 20);
			GL11.glDisable(GL11.GL_LIGHTING);
			mc.fontRenderer.drawString(power + "/" + maxpower + " RA", 23, 10, 16777215);
			RenderHelper2D.renderItem(heighest.getItemStack(), 5, 5);
		}
	}
}
 
开发者ID:CreativeMD,项目名称:RandomAdditions,代码行数:32,代码来源:EventHandlerRandom.java

示例12: onRenderEvent

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderEvent(RenderTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        EntityPlayer entityplayer = mc.thePlayer;
        World world = mc.theWorld;
        if (entityplayer != null && world != null) {
            this.onRenderTick(entityplayer,
                              world);
        }
    }
}
 
开发者ID:SlimeVoid,项目名称:TheMinersFriend,代码行数:12,代码来源:MiningHelmetRenderTickHandler.java

示例13: onSensorRenderTick

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onSensorRenderTick(RenderTickEvent event) {
    EntityPlayer entityplayer = mc.thePlayer;
    World world = mc.theWorld;

    GuiScreen guiScreen = this.mc.currentScreen;
    if (guiScreen == null) onRenderTick(entityplayer);
}
 
开发者ID:SlimeVoid,项目名称:TheMinersFriend,代码行数:9,代码来源:MotionSensorTickHandler.java

示例14: nullify

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public void nullify() {
    unregister(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
    unregister(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:6,代码来源:TickEventDispatcher.java

示例15: TickEventDispatcher

import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
public TickEventDispatcher() {
    register(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
    register(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:5,代码来源:TickEventDispatcher.java


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