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


Java ForgeHooks.getTotalArmorValue方法代码示例

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


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

示例1: renderArmor

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
protected void renderArmor(int width, int height)
{
    if (pre(ARMOR)) return;
    mc.mcProfiler.startSection("armor");

    GlStateManager.enableBlend();
    int left = width / 2 - 91;
    int top = height - left_height;

    int level = ForgeHooks.getTotalArmorValue(mc.thePlayer);
    for (int i = 1; level > 0 && i < 20; i += 2)
    {
        if (i < level)
        {
            drawTexturedModalRect(left, top, 34, 9, 9, 9);
        }
        else if (i == level)
        {
            drawTexturedModalRect(left, top, 25, 9, 9, 9);
        }
        else if (i > level)
        {
            drawTexturedModalRect(left, top, 16, 9, 9, 9);
        }
        left += 8;
    }
    left_height += 10;

    GlStateManager.disableBlend();
    mc.mcProfiler.endSection();
    post(ARMOR);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:GuiIngameForge.java

示例2: renderArmor

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
protected void renderArmor(int width, int height)
{
    if (pre(ARMOR)) return;
    field_73839_d.field_71424_I.func_76320_a("armor");

    GL11.glEnable(GL11.GL_BLEND);
    int left = width / 2 - 91;
    int top = height - left_height;

    int level = ForgeHooks.getTotalArmorValue(field_73839_d.field_71439_g);
    for (int i = 1; level > 0 && i < 20; i += 2)
    {
        if (i < level)
        {
            func_73729_b(left, top, 34, 9, 9, 9);
        }
        else if (i == level)
        {
            func_73729_b(left, top, 25, 9, 9, 9);
        }
        else if (i > level)
        {
            func_73729_b(left, top, 16, 9, 9, 9);
        }
        left += 8;
    }
    left_height += 10;

    GL11.glDisable(GL11.GL_BLEND);
    field_73839_d.field_71424_I.func_76319_b();
    post(ARMOR);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:33,代码来源:GuiIngameForge.java

示例3: ReDraw_Armor

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
@SubscribeEvent
public void ReDraw_Armor(RenderGameOverlayEvent.Pre event) {
	if(event.type == ElementType.ARMOR) {
		if (Helper.isUnDraw(Helper.getPlayer(), "Armor")) {
			return ;
		}
		
    	event.setCanceled(true);
    	Minecraft mc = Minecraft.getMinecraft();
    	int width = event.resolution.getScaledWidth();
    	int height = event.resolution.getScaledHeight();
    	int armor = ForgeHooks.getTotalArmorValue(Minecraft.getMinecraft().thePlayer);
    	int maxarmor = 20;
   
    	if (armor != 0) {  
    		int goalwidth = width / 2 - 91;
	        int goalheight = height - 49;
	        
	        if (Helper.getHUDPositionX(Helper.getPlayer(), "Armor") != 0) {
	        	goalwidth = (int) (width * Helper.getHUDPositionX(Helper.getPlayer(), "Armor")) - 45;
	        }
	        
	        if (Helper.getHUDPositionY(Helper.getPlayer(), "Armor") != 0) {
	        	goalheight = (int) (height * Helper.getHUDPositionY(Helper.getPlayer(), "Armor"));
	        }
    		
    		int length = 90 * armor / maxarmor;
    		Gui.drawRect(goalwidth, goalheight, goalwidth + 90, goalheight + 9, 0x7F000000);
    		Gui.drawRect(goalwidth, goalheight, goalwidth + length, goalheight + 9, 0x7FAFAFAF);

    		String ap = "Armor: " + armor + " / " + maxarmor;
    		FontRenderer fontRenderer = mc.fontRenderer;
    		fontRenderer.drawStringWithShadow(ap, goalwidth, goalheight, 0xFFFFFF);
    		fontRenderer.drawString("", 0, 0, 0xFFFFFF);	//��ʼ��ײ�Ѽ�       
    	}
    	
    	mc.renderEngine.bindTexture(Gui.icons);
	}
}
 
开发者ID:Kanbe-Kotori,项目名称:BetterHUD,代码行数:40,代码来源:ReDraw_HUD_Armor.java

示例4: renderArmor

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
protected void renderArmor(int width, int height)
{
    if (pre(ARMOR)) return;
    mc.mcProfiler.startSection("armor");

    GL11.glEnable(GL11.GL_BLEND);
    int left = width / 2 - 91;
    int top = height - left_height;

    int level = ForgeHooks.getTotalArmorValue(mc.thePlayer);
    for (int i = 1; level > 0 && i < 20; i += 2)
    {
        if (i < level)
        {
            drawTexturedModalRect(left, top, 34, 9, 9, 9);
        }
        else if (i == level)
        {
            drawTexturedModalRect(left, top, 25, 9, 9, 9);
        }
        else if (i > level)
        {
            drawTexturedModalRect(left, top, 16, 9, 9, 9);
        }
        left += 8;
    }
    left_height += 10;

    GL11.glDisable(GL11.GL_BLEND);
    mc.mcProfiler.endSection();
    post(ARMOR);
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:33,代码来源:GuiIngameForge.java

示例5: getBarPoints

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
/** Searches the player's armor inventory to work out how many points need
 * to be shown. Will skip full bars if compression is turned on
 * @return The player's armor points to display in the bar, along with
 * the number of full bars skipped at index {@code 4} */
private int[] getBarPoints(EntityPlayer player) {
	int[] points = new int[5]; // 5th slot stores bar levels
	int i = 0;
	points[4] = 0;

	// Skip full bars if compressing
	if(ArmorChroma.config.compressBar) {
		int ignore = ForgeHooks.getTotalArmorValue(player) - 1;
		ignore /= 20; // Number of full bars to ignore

		if(ignore > 0) {
			points[4] = ignore;
			ignore *= 20;

			for(; ignore > 0; i++) {
				ignore -= getArmorPoints(player, i);
			}
			// Put the overflow back in the bar
			points[i-1] = -ignore;
		}
	}

	// Fill in remaining slots
	for(; i < 4; i++) {
		points[i] = getArmorPoints(player, i);
	}
	return points;
}
 
开发者ID:mccreery,项目名称:armor-chroma,代码行数:33,代码来源:GuiArmor.java

示例6: renderArmor

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
protected void renderArmor(int width, int height)
{
    if (pre(ARMOR)) return;
    mc.mcProfiler.startSection("armor");

    int left = width / 2 - 91;
    int top = height - left_height;

    int level = ForgeHooks.getTotalArmorValue(mc.thePlayer);
    for (int i = 1; level > 0 && i < 20; i += 2)
    {
        if (i < level)
        {
            drawTexturedModalRect(left, top, 34, 9, 9, 9);
        }
        else if (i == level)
        {
            drawTexturedModalRect(left, top, 25, 9, 9, 9);
        }
        else if (i > level)
        {
            drawTexturedModalRect(left, top, 16, 9, 9, 9);
        }
        left += 8;
    }
    left_height += 10;

    mc.mcProfiler.endSection();
    post(ARMOR);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:31,代码来源:GuiIngameForge.java


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