MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Faire une deuxième barre d'armure

    Planifier Épinglé Verrouillé Déplacé Non résolu Sans suite
    1.7.10
    2 Messages 2 Publieurs 1.1k Vues 3 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • HeavenH Hors-ligne
      Heaven
      dernière édition par Heaven

      Bonjour, comme dit dans le titre j aimerais faire une deuxième barre d’armure mais je n y arrive pas. J ai cherché de mon coté et j ai trouver que ca se faisais grâce a l’event RenderGameOverlayEvent.Pre

      voici mon code

      @SideOnly(Side.CLIENT)
          @SubscribeEvent
          public void RenderGameOverlayEvent(RenderGameOverlayEvent.Pre event){
          
              int p_110327_1_ = this.p_110327_1_;
              int p_110327_2_ = this.p_110327_2_;
             if(event.type == RenderGameOverlayEvent.ElementType.DEBUG)
              {
                  event.setCanceled(true);
              }/* 
              if(mc.pointedEntity != null && this.mc.pointedEntity instanceof EntityPinkSlime){
      ce code sert a autre chose
                  this.drawString(mc.fontRenderer,"Regime: All",350, 10, 0xFFFFFF);
              }
              if(mc.pointedEntity != null && this.mc.pointedEntity instanceof EntityRockSlime){
      
                  this.drawString(mc.fontRenderer,"Regime: Vegetables",350, 10, 0xFFFFFF);
              }*/
              if (event.type == RenderGameOverlayEvent.ElementType.ARMOR){
      
                  int k = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth());
                  int l = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth);
                  this.rand.setSeed((long)(this.updateCounter * 312871));
                  boolean flag1 = false;
                  FoodStats foodstats = this.mc.thePlayer.getFoodStats();
                  int i1 = foodstats.getFoodLevel();
                  int j1 = foodstats.getPrevFoodLevel();
                  IAttributeInstance iattributeinstance = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth);
                  int k1 = p_110327_1_ / 2 - 91;
                  int l1 = p_110327_1_ / 2 + 91;
                  int i2 = p_110327_2_ - 39;
                  float f = (float)iattributeinstance.getAttributeValue();
                  float f1 = this.mc.thePlayer.getAbsorptionAmount();
                  int j2 = MathHelper.ceiling_float_int((f + f1) / 2.0F / 10.0F);
                  int k2 = Math.max(10 - (j2 - 2), 3);
                  int l2 = i2 - (j2 - 1) * k2 - 10;
                  float f2 = f1;
                  int i3 = this.mc.thePlayer.getTotalArmorValue();
                  int j3 = -1;
      
                  if (this.mc.thePlayer.isPotionActive(Potion.regeneration))
                  {
                      j3 = this.updateCounter % MathHelper.ceiling_float_int(f + 5.0F);
                  }
      
                  this.mc.mcProfiler.startSection("armor");
                  int k3;
                  int l3;
      
                  for (k3 = 0; k3 < 10; ++k3)
                  {
                      if (i3 > 0)
                      {
                          l3 = k1 + k3 * 8;
      
                          if (k3 * 2 + 1 < i3)
                          {
                              this.drawTexturedModalRect(l3, l2, 34, 9, 9, 9);
                          }
      
                          if (k3 * 2 + 1 == i3)
                          {
                              this.drawTexturedModalRect(l3, l2, 25, 9, 9, 9);
                          }
      
                          if (k3 * 2 + 1 > i3)
                          {
                              this.drawTexturedModalRect(l3, l2, 16, 9, 9, 9);
                          }
                      }
                  }
      
      
          }
      
      
          }
      

      et celui de Minecraft(GuiInGame):
      https://hastebin.com/agobiheqeg.java <–la classe entière

      int k = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth());
              int l = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth);
              this.rand.setSeed((long)(this.updateCounter * 312871));
              boolean flag1 = false;
              FoodStats foodstats = this.mc.thePlayer.getFoodStats();
              int i1 = foodstats.getFoodLevel();
              int j1 = foodstats.getPrevFoodLevel();
              IAttributeInstance iattributeinstance = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth);
              int k1 = p_110327_1_ / 2 - 91;
              int l1 = p_110327_1_ / 2 + 91;
              int i2 = p_110327_2_ - 39;
              float f = (float)iattributeinstance.getAttributeValue();
              float f1 = this.mc.thePlayer.getAbsorptionAmount();
              int j2 = MathHelper.ceiling_float_int((f + f1) / 2.0F / 10.0F);
              int k2 = Math.max(10 - (j2 - 2), 3);
              int l2 = i2 - (j2 - 1) * k2 - 10;
              float f2 = f1;
              int i3 = this.mc.thePlayer.getTotalArmorValue();
              int j3 = -1;
      
              if (this.mc.thePlayer.isPotionActive(Potion.regeneration))
              {
                  j3 = this.updateCounter % MathHelper.ceiling_float_int(f + 5.0F);
              }
      
              this.mc.mcProfiler.startSection("armor");
              int k3;
              int l3;
      
              for (k3 = 0; k3 < 10; ++k3)
              {
                  if (i3 > 0)
                  {
                      l3 = k1 + k3 * 8;
      
                      if (k3 * 2 + 1 < i3)
                      {
                          this.drawTexturedModalRect(l3, l2, 34, 9, 9, 9);
                      }
      
                      if (k3 * 2 + 1 == i3)
                      {
                          this.drawTexturedModalRect(l3, l2, 25, 9, 9, 9);
                      }
      
                      if (k3 * 2 + 1 > i3)
                      {
                          this.drawTexturedModalRect(l3, l2, 16, 9, 9, 9);
                      }
                  }
              }
      

      Merci d’avance
      Heaven
      Edit:j ai trouver pourquoi la barre ne s affichais pas car en fait les draw ne marche nt pas lais jsp comment régler le problème car j ai tester avec un func ou il faut 8 argument et ca m a mit juste un petit slot d armure un peux buger ?

      1 réponse Dernière réponse Répondre Citer -1
      • O Hors-ligne
        Ocomma
        dernière édition par

        Je n’en s’ait rien essai de demander sur Paladium

        1 réponse Dernière réponse Répondre Citer -3
        • 1 / 1
        • Premier message
          Dernier message
        Design by Woryk
        ContactMentions Légales

        MINECRAFT FORGE FRANCE © 2024

        Powered by NodeBB