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


Java ElementType.ALL属性代码示例

本文整理汇总了Java中net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java ElementType.ALL属性的具体用法?Java ElementType.ALL怎么用?Java ElementType.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType的用法示例。


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

示例1: onHudRender

@SubscribeEvent
public static void onHudRender(RenderGameOverlayEvent.Pre event)
{
	if (event.getType() == ElementType.ALL)
	{
		PlayerHUDRenderer.render(event.getPartialTicks());
	}
	
	if (	event.getType() == ElementType.HOTBAR || 
			event.getType() == ElementType.FOOD || 
			event.getType() == ElementType.HEALTH ||
			event.getType() == ElementType.EXPERIENCE)
	{
		event.setCanceled(true);
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:16,代码来源:ExPHandlerClient.java

示例2: onRenderGameOverlay

@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Pre event) {

    if (event.type != ElementType.ALL)
        return;
    Minecraft mc = Minecraft.getMinecraft();
    ScaledResolution var5 = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth,
            Minecraft.getMinecraft().displayHeight);
    int var6 = var5.getScaledWidth();
    int var7 = var5.getScaledHeight();
    mc.entityRenderer.setupOverlayRendering();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0.5F, 0.5F, 0.5F, 1.0F);

    bindOverlayTexture();
    zLevel = -90f;
    this.drawTexturedModalRect(0, var7 / 6, 0, 0, 147, 182);

    fontRenderer.setUnicodeFlag(true);
    int i = 0;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:AnDwHaT5,项目名称:PixelUtilities,代码行数:23,代码来源:PixelmonInfoGui.java

示例3: afterDraw

@SubscribeEvent
public void afterDraw (RenderGameOverlayEvent.Post event) {

	if (event.getType() != ElementType.ALL) return;
	if (ZTS.displayStatus() == 1) {
		computeDrawPosIfChanged();
		drawRect(rectX1, rectSnY1, rectX2, rectSnY2, ZTS.toggleSneak?colorPack(0,0,196,196):colorPack(196,196,196,64));	    	
		drawString(mc.fontRendererObj, sneakTxt, rectX1 + 2, rectSnY1 + 2,
				MIM.sneak?colorPack(255,255,0,96):colorPack(64,64,64,128));
		drawRect(rectX1, rectSpY1, rectX2, rectSpY2, ZTS.toggleSprint?colorPack(0,0,196,196):colorPack(196,196,196,64));	    	
		drawString(mc.fontRendererObj, sprintTxt, rectX1 + 2, rectSpY1 + 2,
				MIM.sprint?colorPack(255,255,0,96):colorPack(64,64,64,128));
	} else if (ZTS.displayStatus() == 2) {
		// no optimization here - I don't like the text only display anyway
        computeTextPos(onlyTxt = MIM.displayText());
		drawString(mc.fontRendererObj, onlyTxt, rectX1, rectSnY1, colorPack(255,255,255,192));
	}
}
 
开发者ID:BlueAnanas,项目名称:ZebrasToggleSneak,代码行数:18,代码来源:GuiDrawer.java

示例4: renderOverlay

@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event)
{
	if (event.type == ElementType.ALL)
	{
		if (overlayFramebuffer == null)
		{
			overlayFramebuffer = new GXFramebuffer(128, 128);
		}
		if (gx == null)
		{
			return;
		}
		overlayFramebuffer.bind();
        gx.render((int)(128), (int)(128));
        overlayFramebuffer.unbind();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        overlayFramebuffer.bindTexture();
        RenderUtils.setColor(255, 255, 255);
        RenderUtils.texturedRectangle(0, 0, 128, 128, 0F, 1F, 1F, 0F);
        overlayFramebuffer.unbindTexture();
	}
}
 
开发者ID:ds84182,项目名称:OpenGX,代码行数:23,代码来源:DebugOverlay.java

示例5: renderFramebuffersOverlay

@SubscribeEvent
public void renderFramebuffersOverlay(RenderGameOverlayEvent.Post event)
{
	if (event.type != ElementType.ALL) return;
	//cleanse monitor list
	Iterator<WeakReference<ComponentMonitor>> iter = monitors.iterator();
	while (iter.hasNext())
	{
		WeakReference<ComponentMonitor> w = iter.next();
		if (w.get() == null)
		{
			iter.remove();
		}
		else
		{
			ComponentMonitor ex = (ComponentMonitor) w.get();
			if (ex.fb != null && ex.owner != null)
			{
				ex.fb.bind();
				ex.owner.gx.render(ex.width, ex.height);
				ex.fb.unbind();
			}
		}
	}
}
 
开发者ID:ds84182,项目名称:OpenGX,代码行数:25,代码来源:ClientEvents.java

示例6: onRenderOverlayPostEvent

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderOverlayPostEvent(RenderGameOverlayEvent.Post event) {
	if (event.getType() == ElementType.ALL) {
		Minecraft minecraft = Minecraft.getMinecraft();
		EntityPlayer player = minecraft.player;
		if (player.getHeldItem(EnumHand.OFF_HAND).getItem() instanceof IInfernalPowerItem) {
			int maxPower = player.getHeldItem(EnumHand.OFF_HAND).getMaxDamage();
			int power = maxPower - player.getHeldItem(EnumHand.OFF_HAND).getItemDamage();
			int width = event.getResolution().getScaledWidth();
			int height = event.getResolution().getScaledHeight();
			GuiIngame gui = Minecraft.getMinecraft().ingameGUI;
			Minecraft.getMinecraft().getTextureManager().bindTexture(HUD_TEXTURE);
			GlStateManager.enableBlend();
			
			int y = (height / 2) - (42 / 2);
			int x = 3;
			int barHeight = (int) (((float) power / (float) maxPower) * 32);
			
			gui.drawTexturedModalRect(x, y, 0, 0, 10, 42);
			gui.drawTexturedModalRect(x + 1, y + 5 + (32 - barHeight), 10, 5, 8, barHeight);
			
			Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.ICONS);
			GlStateManager.disableBlend();
		}
		
	}
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:28,代码来源:EventHandlerClient.java

示例7: onDrawScreenPost

@SubscribeEvent
public static void onDrawScreenPost(RenderGameOverlayEvent.Post event)
{

	Minecraft mc = Minecraft.getMinecraft();
	if (event.getType() == ElementType.ALL)
	{
		EntityPlayer player = net.minecraft.client.Minecraft.getMinecraft().player;

		// a chance to do great things in the realm of huds
	}
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:12,代码来源:ClientEvents.java

示例8: renderBar

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.BOTTOM)
public static void renderBar(RenderGameOverlayEvent.Pre event) {
	if (SingleProjection.isProjectionState()) {
		markEventCanceled(event);
		HUDManager.setupOverlayRendering();
	} else if (event.getType() == ElementType.ALL)
		HUDManager.render();
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:9,代码来源:AlchemyEventSystem.java

示例9: onRenderBar

@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderBar(RenderGameOverlayEvent event) {
    if (event.isCancelable() || event.type != ElementType.ALL || mc.thePlayer.getHeldItem() == null ||
            !(mc.thePlayer.getHeldItem().getItem() instanceof IMagicalItem)) {
        return;
    }

    IMagicalItem f = (IMagicalItem) mc.thePlayer.getHeldItem().getItem();

    // Starting position for the buff bar - 2 pixels from the top left corner.
    int xPos = 2;
    int yPos = 100;

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("dynamiccraft", "textures/gui/magic.png"));

    this.drawTexturedModalRect(xPos, yPos, 6, 0, 5, 70);

    int i1;
    if (f.getMagic(mc.thePlayer.getHeldItem()) > 0) {
        i1 = f.getMagic(mc.thePlayer.getHeldItem()) * 70 / f.getMaxMagic(mc.thePlayer.getHeldItem());

        this.drawTexturedModalRect(xPos, yPos + 70 - i1, 0, 70 - i1, 5, i1);
    }

}
 
开发者ID:BRForgers,项目名称:DynamicCraft,代码行数:27,代码来源:GuiMagicBar.java

示例10: onRenderExperienceBar

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderExperienceBar(RenderGameOverlayEvent event) 
{		
	if (event.isCancelable() || event.type != ElementType.ALL)
		return;
	
	LocX = ConfigBaublesHud.hudPositionX;
	LocY = ConfigBaublesHud.hudPositionY;
	isVertical = ConfigBaublesHud.isVertical;
	scale = ConfigBaublesHud.hudScale;
	if(isVertical == 0)
	{
		LocOffsetY = 15;
		LocOffsetX = 0;
	}
	if(isVertical == 1)
	{
		LocOffsetY = 0;
		LocOffsetX = 15;
	}

	if (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiHud) && !mc.gameSettings.showDebugInfo)
	{ 
		if(ConfigBaublesHud.enable == 0)
			drawBaublesHudIcons(event.resolution);
	}
}
 
开发者ID:gigabit101,项目名称:BaublesHud,代码行数:28,代码来源:HudBaubles.java

示例11: onRenderGameOverlayPost

@SubscribeEvent
public void onRenderGameOverlayPost(RenderGameOverlayEvent.Post event)
{
    if (event.getType() == ElementType.ALL && State.getHideGui() == false)
    {
        this.renderHud();
    }
}
 
开发者ID:maruohon,项目名称:multishot,代码行数:8,代码来源:MsGui.java

示例12: onRenderGameOverlay

@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event)
{
    if (event.getType() != ElementType.ALL)
    {
        return;
    }

    if ((this.mc.currentScreen instanceof GuiChat) == false && this.mc.player != null)
    {
        this.buildersWandRenderer.renderHud(this.mc.player);
        this.rulerRenderer.renderHud();
        this.renderPlacementPropertiesHud(this.mc.player);
    }
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:15,代码来源:RenderEventHandler.java

示例13: onRenderGameOverlay

@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Pre evt) {
	if (evt.type == ElementType.ALL) {
		GuiScreen gui = FMLClientHandler.instance().getClient().currentScreen;

		if (gui instanceof GuiCapture) {
			final GuiCapture capture = (GuiCapture)gui;
			// this must be here, since there are some elements (like food bar) that are overriden every tick
			capture.forceGuiElementsState();
		}
	}
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:12,代码来源:TerminalManagerClient.java

示例14: renderOverlay

@SubscribeEvent
public void renderOverlay(@Nonnull RenderGameOverlayEvent.Post event) {
  ItemStack equippedWrench = getEquippedWrench();
  if (event.getType() == ElementType.ALL && Prep.isValid(equippedWrench)) {
    doRenderOverlay(event, equippedWrench);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:7,代码来源:YetaWrenchOverlayRenderer.java

示例15: renderOverlay

@SubscribeEvent
public void renderOverlay(@Nonnull RenderGameOverlayEvent.Post event) {
  ItemStack equippedProbe = getEquippedProbe();
  if (event.getType() == ElementType.ALL && Prep.isValid(equippedProbe)) {
    doRenderOverlay(event, equippedProbe);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:7,代码来源:ConduitProbeOverlayRenderer.java


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