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


Java TickEvent.RenderTickEvent方法代码示例

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


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

示例1: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event)
{
	Minecraft mc = FMLClientHandler.instance().getClient();
	World world = mc.theWorld;
	
	if (event.phase != TickEvent.Phase.START) {
	    if ((Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer)) {
	    	EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;

	        if ((player != null) && (mc.inGameHasFocus) && (Minecraft.isGuiEnabled())) {
	        	// If player have radiation detector on hotbar.
	        	if (isPlayerHasItemOnHotbar(player.inventory, ItemsHZDS.radiation_detector)) {
        			PlayerTracker tracker = TrackerManager.lookupTrackerFromUsername(mc.thePlayer.getCommandSenderName());
        			
        			if (tracker != null) {
        				renderRadiation(tracker);
        			}
        		}

	        }
	    }
	}
}
 
开发者ID:TwilightWingsStudio,项目名称:HazardsLib,代码行数:26,代码来源:ClientEventHandler.java

示例2: onDraw

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onDraw(final TickEvent.RenderTickEvent event) {
    if (event.phase != TickEvent.Phase.END || !this.display || CommandTPSTimer.displayString.length() == 0) {
        return;
    }
    final Minecraft minecraft = Minecraft.getMinecraft();
    if (minecraft.theWorld == null) {
        CommandTPSTimer.displayString = "";
        return;
    }
    final FontRenderer fontrenderer = minecraft.fontRenderer;
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(3042);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glBlendFunc(770, 771);
    RenderHelper.disableStandardItemLighting();
    fontrenderer.drawString(CommandTPSTimer.displayString, 0, 0, -1, true);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:20,代码来源:CommandTPSTimer.java

示例3: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
	// If no client world we're not playing. Abort.
	if (Minecraft.getMinecraft().theWorld == null) return;
	if (event.phase == TickEvent.Phase.START) {
		// Anything we need to render for the current frame should happen either during or before the main world render
		// Here we call the renderer for "live portal" renders.
		PerspectiveRenderManager.onRenderTick(printstream);
		return;
	}
	if (event.phase == TickEvent.Phase.END) {
		// We render the world views at the end of the render tick.  
		WorldViewRenderManager.onRenderTick(printstream);
		return;
	}
}
 
开发者ID:XCompWiz,项目名称:LookingGlass,代码行数:18,代码来源:LookingGlassEventHandler.java

示例4: guiRendered

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void guiRendered(TickEvent.RenderTickEvent evt)
{
    if (CreeperHost.instance.toastText != null)
    {
        long curTime = System.currentTimeMillis();
        if (CreeperHost.instance.fadeTime > curTime)
        {
            long fadeDiff = CreeperHost.instance.fadeTime - CreeperHost.instance.endTime;
            long curFade = Math.min(CreeperHost.instance.fadeTime - curTime, fadeDiff);
            float alpha = (float) curFade / (float) fadeDiff;

            RenderHelper.disableStandardItemLighting();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, alpha);
            mc.renderEngine.bindTexture(getToastResourceLocation());
            ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
            drawTexturedModalRect(res.getScaledWidth() - 160, 0, u, v, 160, 32);
            GL11.glEnable(GL11.GL_BLEND);
            OpenGlHelper.glBlendFunc(770, 771, 1, 0);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            int textColour = (0xFFFFFF << 32) | ((int) (alpha * 255) << 24);
            mc.fontRenderer.drawSplitString(CreeperHost.instance.toastText, res.getScaledWidth() - 160 + 5, 6, 160, textColour);
        }
        else
        {
            CreeperHost.instance.toastText = null;
        }
    }
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:30,代码来源:EventHandler.java

示例5: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
    if (event.phase == TickEvent.Phase.START)
        return;

    if (currentlyPlaying != null) {
        currentlyPlaying.tick(event.renderTickTime);
    }
}
 
开发者ID:dmillerw,项目名称:EventMod,代码行数:10,代码来源:ClientTickHandler.java

示例6: tickFixAnnoyingOverlay

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void tickFixAnnoyingOverlay(TickEvent.RenderTickEvent event) {

	if(Minecraft.getMinecraft().thePlayer != null) {
		GCPlayerStatsClient stats = GCPlayerStatsClient.get((EntityPlayerSP)Minecraft.getMinecraft().thePlayer);
		if(stats != null)
			stats.oxygenSetupValid = true;
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:11,代码来源:GalacticCraftHandler.java

示例7: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderTick( TickEvent.RenderTickEvent event )
{
  Minecraft mc = Minecraft.getMinecraft();

  if( mc.theWorld != null )
  {
    if( guiNotification == null )
      guiNotification = new GuiNotification( mc );
    guiNotification.update();
  }
}
 
开发者ID:GTNewHorizons,项目名称:Yamcl,代码行数:13,代码来源:NotificationTickHandler.java

示例8: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event) {
    Minecraft mc = Minecraft.getMinecraft();
    if (mc.theWorld == null) return;

    if (event.phase == TickEvent.Phase.END) {
        unlocked.updateGui();
    }
}
 
开发者ID:MSourceCoded,项目名称:Quantum-Anomalies,代码行数:10,代码来源:GuiHandler.java

示例9: tick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
	public void tick(TickEvent.RenderTickEvent event) {
		if (event.phase == TickEvent.Phase.START
				&& Minecraft.getMinecraft().theWorld != null) {
			for (Object o : Util.getClientsMovements()) {
				EntityPlayerCustom player = ((EntityPlayerCustom)Minecraft.getMinecraft().thePlayer.getExtendedProperties("Cube's Edge Player"));
//				if (!((IMovementClient) o).isMovementDisabled()) {
					((MovementClient) o).renderTick(player);
//				}
			}
		}
	}
 
开发者ID:ZakCreeper,项目名称:CubesEdge,代码行数:13,代码来源:RenderTickHandler.java

示例10: onClientRenderWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onClientRenderWorldTick(TickEvent.RenderTickEvent event) {
    // End of tick and in-game
    if (event.phase == TickEvent.Phase.END && RenderUtil.MINECRAFT.currentScreen == null) {
        final ScaledResolution scaledResolution = new ScaledResolution(RenderUtil.MINECRAFT, RenderUtil.MINECRAFT.displayWidth, RenderUtil.MINECRAFT.displayHeight);
        final int scaledWidth = scaledResolution.getScaledWidth();
        final int scaledHeight = scaledResolution.getScaledHeight();

        // Draw Game logo
        GL11.glPushMatrix();
        RenderUtil.MINECRAFT.getTextureManager().bindTexture(alphaResource);
        GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
        GL11.glTranslatef(scaledWidth - 47, scaledHeight - 45, 0);
        GL11.glScalef(0.50f, 0.50f, 1.0f);
        GL11.glTranslatef(-scaledWidth + 47, -scaledHeight + 45, 0);
        GL11.glEnable(GL11.GL_BLEND);
        RenderUtil.create2DRectangleModal(scaledWidth - 47, scaledHeight - 45, 100, 95, 0);
        RenderUtil.TESSELLATOR.draw();
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();

        // Draw milestone string
        GL11.glPushMatrix();
        GL11.glTranslatef(scaledWidth - 14, scaledHeight - 8, 0.0f);
        GL11.glScalef(0.50f, 0.50f, 1.0f);
        GL11.glTranslatef(-scaledWidth + 14, -scaledHeight + 8, 0.0f);
        RenderUtil.MINECRAFT.fontRenderer.drawString("Alpha", scaledWidth - 14, scaledHeight - 3, Integer.parseInt("7767AE", 16));
        GL11.glPopMatrix();
    }
}
 
开发者ID:ObsidianBox,项目名称:Obsidian,代码行数:32,代码来源:GameListener.java

示例11: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent renderTickEvent) {
    if (renderTickEvent.phase == TickEvent.Phase.END) {
        TickUtil.RENDER_TICKER++;
        TickUtil.onRenderTick();
    }
}
 
开发者ID:mak326428,项目名称:EnderAmmunition,代码行数:8,代码来源:EAClientProxy.java

示例12: getFrame

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void getFrame(final TickEvent.RenderTickEvent event) {
    this.renderTickTime = event.renderTickTime;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:5,代码来源:RenderItemGlove.java

示例13: getTimer

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void getTimer(final TickEvent.RenderTickEvent event) {
    EventHandlerClient.renderTickTime = event.renderTickTime;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:5,代码来源:EventHandlerClient.java

示例14: tickEvent

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void tickEvent(TickEvent.RenderTickEvent event) {
    if(event.phase == Phase.END && NEIClientConfig.isEnabled())
        HUDRenderer.renderOverlay();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:6,代码来源:ClientHandler.java

示例15: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event) {
    if(event.phase == Phase.START)
        renderFrame = event.renderTickTime;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:6,代码来源:CCCEventHandler.java


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