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