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


Java AttributeInstance.func_111126_e方法代码示例

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


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

示例1: func_71151_f

import net.minecraft.entity.ai.attributes.AttributeInstance; //导入方法依赖的package包/类
public float func_71151_f() {
   float var1 = 1.0F;
   if(this.field_71075_bZ.field_75100_b) {
      var1 *= 1.1F;
   }

   AttributeInstance var2 = this.func_110148_a(SharedMonsterAttributes.field_111263_d);
   var1 = (float)((double)var1 * ((var2.func_111126_e() / (double)this.field_71075_bZ.func_75094_b() + 1.0D) / 2.0D));
   if(this.func_71039_bw() && this.func_71011_bu().field_77993_c == Item.field_77707_k.field_77779_bT) {
      int var3 = this.func_71057_bx();
      float var4 = (float)var3 / 20.0F;
      if(var4 > 1.0F) {
         var4 = 1.0F;
      } else {
         var4 *= var4;
      }

      var1 *= 1.0F - var4 * 0.15F;
   }

   return var1;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:23,代码来源:EntityPlayerSP.java

示例2: func_111175_f

import net.minecraft.entity.ai.attributes.AttributeInstance; //导入方法依赖的package包/类
protected double func_111175_f() {
   AttributeInstance var1 = this.field_75299_d.func_110148_a(SharedMonsterAttributes.field_111265_b);
   return var1 == null?16.0D:var1.func_111126_e();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:EntityAITarget.java

示例3: renderHealth

import net.minecraft.entity.ai.attributes.AttributeInstance; //导入方法依赖的package包/类
@Override
public void renderHealth(int width, int height) {
    bind(field_110324_m);
    if (pre(HEALTH)) return;
    mc.mcProfiler.startSection("health");

    boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1;

    if (mc.thePlayer.hurtResistantTime < 10) {
        highlight = false;
    }

    AttributeInstance attrMaxHealth = this.mc.thePlayer.func_110148_a(SharedMonsterAttributes.field_111267_a);
    int health = MathHelper.ceiling_float_int(mc.thePlayer.func_110143_aJ());
    int healthLast = MathHelper.ceiling_float_int(mc.thePlayer.prevHealth);
    float healthMax = (float)attrMaxHealth.func_111126_e();
    float absorb = this.mc.thePlayer.func_110139_bj();

    int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F);
    int rowHeight = Math.max(10 - (healthRows - 2), 3);

    this.rand.setSeed((long)(updateCounter * 312871));

    int left = width / 2 - 91;
    int top = height - left_height;
    left_height += (healthRows * rowHeight);
    if (rowHeight != 10) left_height += 10 - rowHeight;

    int regen = -1;
    if (mc.thePlayer.isPotionActive(Potion.regeneration)) {
        regen = updateCounter % 25;
    }

    final int TOP =  9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0);
    final int BACKGROUND = (highlight ? 25 : 16);
    int MARGIN = 16;
    if (mc.thePlayer.isPotionActive(Potion.poison))      MARGIN += 36;
    else if (mc.thePlayer.isPotionActive(Potion.wither)) MARGIN += 72;
    float absorbRemaining = absorb;

    for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) {
        //int b0 = (highlight ? 1 : 0);
        int row = MathHelper.ceiling_float_int((float)(i + 1) / 10.0F) - 1;
        int x = left + i % 10 * 8;
        int y = top - row * rowHeight;

        if (health <= 4) y += rand.nextInt(2);
        if (i == regen) y -= 2;

        drawTexturedModalRect(x, y, BACKGROUND, TOP, 9, 9);

        if (highlight)  {
            if (i * 2 + 1 < healthLast)
                drawTexturedModalRect(x, y, MARGIN + 54, TOP, 9, 9); //6
            else if (i * 2 + 1 == healthLast)
                drawTexturedModalRect(x, y, MARGIN + 63, TOP, 9, 9); //7
        }

        if (absorbRemaining > 0.0F) {
            if (absorbRemaining == absorb && absorb % 2.0F == 1.0F)
                drawTexturedModalRect(x, y, MARGIN + 153, TOP, 9, 9); //17
            else
                drawTexturedModalRect(x, y, MARGIN + 144, TOP, 9, 9); //16
            absorbRemaining -= 2.0F;
        }
        else {
            if (i * 2 + 1 < health)
                drawTexturedModalRect(x, y, MARGIN + 36, TOP, 9, 9); //4
            else if (i * 2 + 1 == health)
                drawTexturedModalRect(x, y, MARGIN + 45, TOP, 9, 9); //5
        }
    }

    mc.mcProfiler.endSection();
    post(HEALTH);
}
 
开发者ID:Aurilux,项目名称:HotbarPlus,代码行数:77,代码来源:HBPGui.java


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