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


Java RenderGameOverlayEvent.isCancelable方法代码示例

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


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

示例1: eventHandler

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOW)
public void eventHandler(RenderGameOverlayEvent event) {
	if (event.isCancelable() || event.type == RenderGameOverlayEvent.ElementType.DEBUG) return; //NOT To draw when debug is open

	//Prepare rendering
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	GL11.glDisable(GL11.GL_LIGHTING);

	if (GuiModMain.nightMode) color = 0xff5e5e5e;
	else color = 0xffdddddd;

	EntityPlayer player = mc.thePlayer;
	World world = player.worldObj;
	BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
	Block lookingblock;

	if (blockpos != null) lookingblock = world.getBlockState(blockpos).getBlock();
	else lookingblock = null;

	verPos = 3;

	drawLeft(world, player, blockpos, lookingblock);
}
 
开发者ID:Admicos,项目名称:mcguimod,代码行数:24,代码来源:InGameCustomGuiOverlay.java

示例2: onRenderExperienceBar

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event) {

	if (event.isCancelable() || event.type != ElementType.EXPERIENCE) {
		return;
	}
	if (!mc.thePlayer.capabilities.isCreativeMode) {
		int posX = event.resolution.getScaledWidth() / 2 + 10;
		int posY = event.resolution.getScaledHeight() - 48;
		ExtendedPlayer props = ExtendedPlayer.get((EntityPlayer) Minecraft.getMinecraft().thePlayer);
		float maxMana = props.getMaxMana();
		int manabarwidth = (int) ((float) props.getMana() / maxMana * 48);
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		GL11.glDisable(GL11.GL_LIGHTING);
		this.mc.getTextureManager().bindTexture(texturepath);
		mc.renderEngine.bindTexture(new ResourceLocation(TheDarkEra.MODID + ":textures/gui/SoulBar.png"));
		mc.ingameGUI.drawTexturedModalRect(posX, posY, 0, 0, 50, 5);
		mc.ingameGUI.drawTexturedModalRect(posX + 1, posY + 1, 0, 6, manabarwidth, 3);
		String a = ""+props.getMaxMana();
		String b = ""+props.getMana();
		mc.fontRenderer.drawStringWithShadow(a, posX, posY, 0xFFFFFF);
		mc.fontRenderer.drawStringWithShadow(b, posX, posY+8, 0xFFFFFF);
		System.out.println(maxMana);
	}
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:26,代码来源:GuiManaBar.java

示例3: onRenderExperienceBar

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
	if (event.isCancelable() || event.type != EXPERIENCE) {
		return;
	}
	int width = event.resolution.getScaledWidth();
	int height = event.resolution.getScaledHeight();

	int k2 = height - 20;
	int blink = mc.thePlayer.getDataWatcher().getWatchableObjectInt(BLINK);
	int i4 = width / 2 + 91;
	int bar = MathHelper.ceiling_double_int((double) (blink + 2) * 10.0D
			/ MAX_BLINK);
	glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	glDisable(GL_LIGHTING);
	mc.getTextureManager().bindTexture(icons);
	drawTexturedModalRect(i4 - 281, k2 - 1, 0, 18, 83, 11);
	drawTexturedModalRect(i4 - 301, k2 - 1, 83, 18, 17, 11);
	for (int i = 0; i < 10; ++i) {
		if (i < bar) {
			drawTexturedModalRect(i4 + i * 8 - 280, k2, 100, 18, 9, 9);
		}
	}
}
 
开发者ID:hanetzer,项目名称:SecureCraftProtect,代码行数:26,代码来源:SCPGuiBlink.java

示例4: onRenderMountHealth

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderMountHealth(RenderGameOverlayEvent event)
{
    if (event.type == ElementType.EXPERIENCE || event.type == ElementType.FOOD || event.type == ElementType.JUMPBAR )
    {
        YesOrNo = true;
    }

    if (!event.isCancelable() || !YesOrNo)return;

    if(this.mc.thePlayer.ridingEntity != null)
    {
        GuiIngameForge.renderFood = true;
    }

    if(GuiIngameForge.renderExperiance)
    {
        if(this.mc.thePlayer.ridingEntity instanceof EntityHorse)
        {
            GuiIngameForge.renderJumpBar = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
        }
    }
}
 
开发者ID:DouweKoopmans,项目名称:BetterHorseHud,代码行数:24,代码来源:ModGui.java

示例5: onRenderGameOverlay

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent event) {

    if (event.isCancelable() || event.getType() != ElementType.EXPERIENCE) {
        return;
    }
    if (!this.mc.inGameHasFocus) {
        return;
    }
    if (FMLClientHandler.instance().getClient().currentScreen != null ) {
        return;
    }

    drawMetalOverlay();

}
 
开发者ID:legobmw99,项目名称:Allomancy,代码行数:18,代码来源:ClientEventHandler.java

示例6: onRenderOfOverlay

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderOfOverlay(RenderGameOverlayEvent event) {
	// Check the event is not cancellable
	if (event.isCancelable()) {
		return;
	}

	// Check it's not for experience
	if (event.type != ElementType.EXPERIENCE) {
		return;
	}

	// Check if hud enabled
	if (!RadioUtils.inProgress) {
		return;
	}

	// Otherwise, proceed to render icon
	ScaledResolution screenResolution = new ScaledResolution(mc,
			mc.displayWidth, mc.displayHeight);
	int height = screenResolution.getScaledHeight();
	height = height - mc.fontRendererObj.FONT_HEIGHT;

	mc.fontRendererObj.drawString(statusIndicator, 1, height,
			0xFFFFFF);
}
 
开发者ID:CircularChicken,项目名称:Picklr,代码行数:27,代码来源:RadioGui.java

示例7: hideHealth

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void hideHealth(RenderGameOverlayEvent event) {

	if(mc.thePlayer.getActivePotionEffect(ModPotions.lessening) != null && event.type.equals(ElementType.HEALTH) && event.isCancelable()) {
	
	event.setCanceled(true);

	mc.getTextureManager().bindTexture(new ResourceLocation(Reference.MOD_ID, "/textures/gui/icons.png"));
	GL11.glPushMatrix();
	for (int i = 0; i < Math.round(mc.thePlayer.getMaxHealth()/2); i++) {
		drawTexturedModalRect((int) (mc.displayWidth/6.5+(i*9)), mc.displayHeight/2-38, 0, 0, 9, 9);
	}
	for (int i = 0; i < Math.round(mc.thePlayer.getHealth()/2); i++) {
		drawTexturedModalRect((int) (mc.displayWidth/6.5+(i*9)), mc.displayHeight/2-38, 9, 0, 9, 9);
	}
	GL11.glPopMatrix();
	mc.getTextureManager().bindTexture(new ResourceLocation("minecraft:textures/gui/icons.png"));
	}

}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:21,代码来源:HUDHandler.java

示例8: onRenderGui

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderGui(RenderGameOverlayEvent event)
{
	if (event.isCancelable() || event.getType() != ElementType.TEXT)
	{
		return;
	}

	PlayerAether player = PlayerAether.get(this.mc.thePlayer);

	if (player.poisonInstance() != null)
	{
		AetherOverlay.renderCure(this.mc);
		AetherOverlay.renderPoison(this.mc);
	}

	if (player.thePlayer != null)
	{
		AetherOverlay.renderIronBubble(this.mc);
		AetherOverlay.renderCooldown(this.mc);
		AetherOverlay.renderJumps(this.mc);
		AetherOverlay.renderBossHP(this.mc);
	}

       float portalTime =  player.portalAnimTime * 1.2F + (player.prevPortalAnimTime -  player.portalAnimTime);

       if(portalTime > 0.0F)
       {
           if (portalTime > 0.0F)
           {
           	AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc));
           }
       }
       
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:36,代码来源:GuiAetherInGame.java

示例9: render

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
public void render(RenderGameOverlayEvent event) {
    // Check if hotbar should render
    if (!(event.getType().equals(RenderGameOverlayEvent.ElementType.HOTBAR) && event.isCancelable()))
        return;
    event.setCanceled(true);
    // Render
    GlStateManager.color(1, 1, 1, 1);
    //GlStateManager.disableLighting();
    if (Config.stackedHotbars && !HotbarLogic.shouldShowDefault()) {
        for (int hotbar = 0; hotbar < Config.numberOfHotbars; hotbar++)
            drawSingle(hotbar);
    }
    else if (Config.numberOfHotbars == 1 || HotbarLogic.shouldShowDefault())
        drawSingle(0);
    else if (Config.numberOfHotbars == 2)
        drawDouble(0);
    else if (Config.numberOfHotbars == 3) {
        drawDouble(0);
        drawSingle(2);
    } else if (Config.numberOfHotbars == 4) {
        drawDouble(0);
        drawDouble(2);
    }
    drawSelection();
    drawItems();
    drawTooltip();
    if (Minecraft.getMinecraft().player != null &&
            !Minecraft.getMinecraft().player.inventory.offHandInventory.get(0).isEmpty()) {
        drawOffhandSlot();
        drawOffhandItem();
    }
}
 
开发者ID:rolandoislas,项目名称:multi-hotbar,代码行数:33,代码来源:HotBarRenderer.java

示例10: onRenderBar

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@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,代码行数:28,代码来源:GuiMagicBar.java

示例11: onRenderExperienceBar

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@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,代码行数:29,代码来源:HudBaubles.java

示例12: onRenderOverlay

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onRenderOverlay(RenderGameOverlayEvent event) {

	if (event.type != RenderGameOverlayEvent.ElementType.ALL)
		return;

	if(event.isCancelable() || !Minecraft.getMinecraft().thePlayer.isInsideOfMaterial(ModBlocks.materialFluidTime)) {

		return;
	}
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	this.mc.getTextureManager().bindTexture(texture);
	drawTexturedModalRect(0, 0, 0, 0, event.resolution.getScaledWidth(), event.resolution.getScaledHeight());
}
 
开发者ID:Alex-the-666,项目名称:It-s-About-Time-Minecraft-Mod,代码行数:16,代码来源:EventLiquidSpaceTime.java

示例13: ShoutBarRun

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
public static void ShoutBarRun(RenderGameOverlayEvent event) {
	if (!event.isCancelable() && event.type == ElementType.EXPERIENCE) {
		Minecraft mc = Minecraft.getMinecraft();

		int posX = ((event.resolution.getScaledWidth() / 4) * 3) + 10;
		int posY = event.resolution.getScaledHeight() - 22;

		NumberIconLocation = Shout * 16;

		mc.renderEngine.bindTexture(new ResourceLocation(TheDarkEra.MODID + ":textures/gui/ShoutBar.png"));
		GL11.glEnable(GL11.GL_BLEND);
		GL11.glDisable(GL11.GL_DEPTH_TEST);
		GL11.glDepthMask(false);
		GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		GL11.glDisable(GL11.GL_ALPHA_TEST);
		mc.ingameGUI.drawTexturedModalRect(posX, posY, 0, 0, 22, 21);
		mc.ingameGUI.drawTexturedModalRect(posX + 3, posY + 3, NumberIconLocation, 22, 16, 16);
		if (FontDuration > 0) {
			mc.fontRenderer.drawStringWithShadow(ShoutNames[Shout], posX, posY, 0xFFFFFF);
			FontDuration--;
		}
		GL11.glDisable(GL11.GL_BLEND);
		GL11.glEnable(GL11.GL_DEPTH_TEST);
		GL11.glDepthMask(true);
	}
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:28,代码来源:ShoutList.java

示例14: SoulBarRun

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
public static void SoulBarRun(RenderGameOverlayEvent event) {
		if (!event.isCancelable() && event.type == ElementType.EXPERIENCE) {
			Minecraft mc = Minecraft.getMinecraft();
			if (!mc.thePlayer.capabilities.isCreativeMode) {
				//int posX = event.resolution.getScaledWidth() / 2 + 10;
				//int posY = event.resolution.getScaledHeight() - 48;

				mc.renderEngine.bindTexture(new ResourceLocation(ResourceHelper.getGuiResourceName() + "SoulBar.png"));

//				mc.ingameGUI.drawTexturedModalRect(posX, posY, 0, 0, 50, 5);
//				mc.ingameGUI.drawTexturedModalRect(posX + 1, posY + 1, 0, 6, (int) manaBar, 3);
			}
		}
	}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:15,代码来源:SoulBar.java

示例15: onRenderHotBar

import net.minecraftforge.client.event.RenderGameOverlayEvent; //导入方法依赖的package包/类
@SubscribeEvent
(priority = EventPriority.NORMAL)
public void onRenderHotBar(RenderGameOverlayEvent event) {
	FontRenderer fontRender = this.mc.fontRenderer;

	if (event.isCancelable() || event.type != ElementType.HOTBAR || mc.gameSettings.showDebugInfo) return;

	fontRender.drawStringWithShadow(Temperature.getTemp(mc.theWorld, mc.thePlayer), ConfigHandler.xPos_actual, ConfigHandler.yPos_actual, ConfigHandler.color_actual);
}
 
开发者ID:Konlii,项目名称:FingerInTheWind,代码行数:10,代码来源:FITWGUI.java


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