• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Solved La texture du livre au-dessus de la table de craft

    1.8.x
    1.8.9
    2
    3
    853
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dylem
      Dylem last edited by

      Salut,

      J’ai créé un block se basant sur la table d’enchantement, et j’aimerai savoir si je peux changer la texture du livre au-dessus.
      Dans GuiEnchantment on a ça :

      protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
          {
              GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
              this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_GUI_TEXTURE);
              int i = (this.width - this.xSize) / 2;
              int j = (this.height - this.ySize) / 2;
              this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
              GlStateManager.pushMatrix();
              GlStateManager.matrixMode(5889);
              GlStateManager.pushMatrix();
              GlStateManager.loadIdentity();
              ScaledResolution scaledresolution = new ScaledResolution(this.mc);
              GlStateManager.viewport((scaledresolution.getScaledWidth() - 320) / 2 * scaledresolution.getScaleFactor(), (scaledresolution.getScaledHeight() - 240) / 2 * scaledresolution.getScaleFactor(), 320 * scaledresolution.getScaleFactor(), 240 * scaledresolution.getScaleFactor());
              GlStateManager.translate(-0.34F, 0.23F, 0.0F);
              Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F);
              float f = 1.0F;
              GlStateManager.matrixMode(5888);
              GlStateManager.loadIdentity();
              RenderHelper.enableStandardItemLighting();
              GlStateManager.translate(0.0F, 3.3F, -16.0F);
              GlStateManager.scale(f, f, f);
              float f1 = 5.0F;
              GlStateManager.scale(f1, f1, f1);
              GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
              this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_BOOK_TEXTURE);
              GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
              float f2 = this.field_147076_A + (this.field_147080_z - this.field_147076_A) * partialTicks;
              GlStateManager.translate((1.0F - f2) * 0.2F, (1.0F - f2) * 0.1F, (1.0F - f2) * 0.25F);
              GlStateManager.rotate(-(1.0F - f2) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F);
              GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
              float f3 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.25F;
              float f4 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.75F;
              f3 = (f3 - (float)MathHelper.truncateDoubleToInt((double)f3)) * 1.6F - 0.3F;
              f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F;
      
              if (f3 < 0.0F)
              {
                  f3 = 0.0F;
              }
      
              if (f4 < 0.0F)
              {
                  f4 = 0.0F;
              }
      
              if (f3 > 1.0F)
              {
                  f3 = 1.0F;
              }
      
              if (f4 > 1.0F)
              {
                  f4 = 1.0F;
              }
      
              GlStateManager.enableRescaleNormal();
              MODEL_BOOK.render((Entity)null, 0.0F, f3, f4, f2, 0.0F, 0.0625F);
              GlStateManager.disableRescaleNormal();
              RenderHelper.disableStandardItemLighting();
              GlStateManager.matrixMode(5889);
              GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
              GlStateManager.popMatrix();
              GlStateManager.matrixMode(5888);
              GlStateManager.popMatrix();
              RenderHelper.disableStandardItemLighting();
              GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
              EnchantmentNameParts.getInstance().reseedRandomGenerator((long)this.container.xpSeed);
              int k = this.container.getLapisAmount();
      
              for (int l = 0; l < 3; ++l)
              {
                  int i1 = i + 60;
                  int j1 = i1 + 20;
                  int k1 = 86;
                  String s = EnchantmentNameParts.getInstance().generateNewRandomName();
                  this.zLevel = 0.0F;
                  this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_GUI_TEXTURE);
                  int l1 = this.container.enchantLevels[l];
                  GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
      
                  if (l1 == 0)
                  {
                      this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 185, 108, 19);
                  }
                  else
                  {
                      String s1 = "" + l1;
                      FontRenderer fontrenderer = this.mc.standardGalacticFontRenderer;
                      int i2 = 6839882;
      
                      if ((k < l + 1 || this.mc.thePlayer.experienceLevel < l1) && !this.mc.thePlayer.capabilities.isCreativeMode)
                      {
                          this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 185, 108, 19);
                          this.drawTexturedModalRect(i1 + 1, j + 15 + 19 * l, 16 * l, 239, 16, 16);
                          fontrenderer.drawSplitString(s, j1, j + 16 + 19 * l, k1, (i2 & 16711422) >> 1);
                          i2 = 4226832;
                      }
                      else
                      {
                          int j2 = mouseX - (i + 60);
                          int k2 = mouseY - (j + 14 + 19 * l);
      
                          if (j2 >= 0 && k2 >= 0 && j2 < 108 && k2 < 19)
                          {
                              this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 204, 108, 19);
                              i2 = 16777088;
                          }
                          else
                          {
                              this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 166, 108, 19);
                          }
      
                          this.drawTexturedModalRect(i1 + 1, j + 15 + 19 * l, 16 * l, 223, 16, 16);
                          fontrenderer.drawSplitString(s, j1, j + 16 + 19 * l, k1, i2);
                          i2 = 8453920;
                      }
      
                      fontrenderer = this.mc.fontRendererObj;
                      fontrenderer.drawStringWithShadow(s1, (float)(j1 + 86 - fontrenderer.getStringWidth(s1)), (float)(j + 16 + 19 * l + 7), i2);
                  }
              }
          }
      

      Cependant changer ENCHANTMENT_TABLE_BOOK_TEXTURE ne change que le livre dans la gui de la table, et pas le livre en dehors. Je n’ai trouvé aucune trace de cette texture autre part et je pensais la trouver ici car c’est dans cette fonction que le model du livre est créé 😕

      Si je t'ai aidé, n'hésite pas à cliquer sur le nombre vert en dessous de mon image de profil, pour me le faire savoir. Ca me motive pour continuer …

      1 Reply Last reply Reply Quote 0
      • AymericRed
        AymericRed last edited by

        Regarde dans Minecraft.client.render et cherche dans les sous packages si y’a pas un truc en rapport, c’est là que y’a tous les rendus spéciaux

        Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

        AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

        Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
        Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

        1 Reply Last reply Reply Quote 1
        • Dylem
          Dylem last edited by

          Merci ! C’est ce que je cherchais ! 🙂

          Si je t'ai aidé, n'hésite pas à cliquer sur le nombre vert en dessous de mon image de profil, pour me le faire savoir. Ca me motive pour continuer …

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Design by Woryk
          Contact / Mentions Légales

          MINECRAFT FORGE FRANCE © 2018

          Powered by NodeBB