Java 类cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent 实例源码

项目:LibraCraft    文件:RenderTickHandler.java   
@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;
    }
}
项目:projectzulu1.7.10    文件:BossHealthDisplayTicker.java   
@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");
        }

    }
}
项目:AgeCraft-Old    文件:ACTickHandlerClient.java   
@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();
    }
}
项目:AdvancedHUD    文件:TickHandler.java   
@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);
        // }
    }
}
项目:bit-client    文件:TickEventDispatcher.java   
@Override
public void invoke(Event event) {
    if (event instanceof RenderTickEvent)
        new sl.steeldood.bit.client.event.impl.RenderTickEvent().call();
    else
        new ClientTickEvent().call();

}
项目:LambdaLib    文件:LIFMLGameEventDispatcher.java   
@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);
    }
}
项目:ComponentEquipment    文件:HarnessFuelRenderer.java   
@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();
    }
}
项目:MagicalRings    文件:TickHandlerClient.java   
@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);
                }
            }
        }
    }
}
项目:projectzulu1.7.10-pre-1.3a    文件:BossHealthDisplayTicker.java   
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
    if (event.phase == Phase.END) {
        if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
            renderBossHealthBar(targetBoss, "Pharaoh Health");
        }
    }
}
项目:Emotes    文件:ClientProxy.java   
@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();
    }
}
项目:RandomAdditions    文件:EventHandlerRandom.java   
@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);
        }
    }
}
项目:TheMinersFriend    文件:MiningHelmetRenderTickHandler.java   
@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);
        }
    }
}
项目:TheMinersFriend    文件:MotionSensorTickHandler.java   
@SubscribeEvent
public void onSensorRenderTick(RenderTickEvent event) {
    EntityPlayer entityplayer = mc.thePlayer;
    World world = mc.theWorld;

    GuiScreen guiScreen = this.mc.currentScreen;
    if (guiScreen == null) onRenderTick(entityplayer);
}
项目:bit-client    文件:TickEventDispatcher.java   
@Override
public void nullify() {
    unregister(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
    unregister(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}
项目:bit-client    文件:TickEventDispatcher.java   
public TickEventDispatcher() {
    register(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
    register(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}
项目:Laminate    文件:LaminateModOneSeven.java   
@SubscribeEvent
public void onFrame(RenderTickEvent e) {
    if (e.phase == Phase.START) {
        core.frame();
    }
}
项目:HandCraft    文件:ClientTick.java   
@SubscribeEvent
public void onRenderTick(RenderTickEvent event)
{
    if(event.phase == Phase.END)
    {
        if(mc.thePlayer != null)
        {
            if(!mc.isGamePaused())
            {
                if(mc.inGameHasFocus && mc.thePlayer.openContainer == mc.thePlayer.inventoryContainer && GameSettings.isKeyDown(inventory))
                    GuiHandler.openGui(HandCraft.guiID, new NBTTagCompound());

                if(chains.size() > 0)
                {

                    double timeLeft = (System.currentTimeMillis() - lastTick);

                    progress += timeLeft/10;

                    int rendered = 0;
                    int chainIndex = 0;
                    int entryIndex = 0;
                    for (int i = 0; rendered < 20; i++) {
                        if(chains.size() > chainIndex)
                        {
                            if(chains.get(chainIndex).size() > entryIndex)
                            {
                                ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                                renderRecipe(5+rendered*20, resolution.getScaledHeight()-44, chains.get(chainIndex).getRecipe(entryIndex), i == 0 ? progress : 0, chains.get(chainIndex).isResult(chains.get(chainIndex).getRecipe(entryIndex)));
                                rendered++;
                                entryIndex++;
                            }else{
                                chainIndex++;
                                entryIndex = 0;
                            }
                        }else
                            break;
                    }



                    if(progress >= chains.get(0).getCurrentRecipe().time)
                    {
                        chains.get(0).processRecipe();
                        progress = 0;
                    }
                }

                lastTick = System.currentTimeMillis();
            }
        }else
            if(chains.size() > 0)
                chains.clear();
    }
}
项目:SimplyJetpacks    文件:HUDTickHandler.java   
@SubscribeEvent
public void onRenderTick(RenderTickEvent evt) {
    if (evt.phase == Phase.END && (Config.enableFuelHUD || Config.enableStateHUD)) {
        tickEnd();
    }
}
项目:ShadowsOfPhysis    文件:ClientTickHandler.java   
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
    if(Minecraft.getMinecraft().theWorld != null && articlePopup != null) {
        articlePopup.update();
    }
}
项目:Fluxed-Trinkets    文件:HudHandler.java   
@SubscribeEvent
public void onRenderTick(RenderTickEvent evt) {
    tickEnd();
}
项目:CodeLyokoMod    文件:ClientTickHandler.java   
@SubscribeEvent
public void renderTick(RenderTickEvent event)
{
    this.advanceAnimatorInstances(event);
}