• Récent
  • Mots-clés
  • Populaire
  • Utilisateurs
  • Groupes
  • S'inscrire
  • Se connecter
  • S'inscrire
  • Se connecter
  • Recherche
  • Récent
  • Mots-clés
  • Populaire
  • Utilisateurs
  • Groupes

Résolu Création tnt

1.7.x
1.7.10
8
47
7.6k
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.
  • robin4002
    robin4002 Moddeurs confirmés Rédacteurs Administrateurs dernière édition par 20 mai 2016, 16:53

    La texture c’est bon, TextureMap.locationBlocksTexture c’est le fichier de texture des blocs.
    C’est ce qu’il faut utiliser pour avoir la texture d’un bloc dans une entité.
    Le problème ne vient pas de là.

    1 réponse Dernière réponse Répondre Citer 0
    • S
      Sebenf0rce dernière édition par 20 mai 2016, 16:53

      @‘robin4002’:

      Et toujours pas de rendu ?

      Si j’ai crée la classe RenderTntPrimed :

      package com.sebenforce;
      import net.minecraft.client.renderer.RenderBlocks;
      import net.minecraft.client.renderer.entity.Render;
      import net.minecraft.client.renderer.texture.TextureMap;
      import net.minecraft.entity.Entity;
      import net.minecraft.init.Blocks;
      import net.minecraft.util.ResourceLocation;
      import org.lwjgl.opengl.GL11;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      @SideOnly(Side.CLIENT)
      public class RenderTNTPrimed extends Render
      {
      private RenderBlocks blockRenderer = new RenderBlocks();
      public RenderTNTPrimed()
      {
      this.shadowSize = 0.5F;
      }
      /**
      * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
      * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
      * (Render <t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br="">* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
      */
      public void doRender(EntityTNTCustom p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
      {
      GL11.glPushMatrix();
      GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
      float f2;
      if ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F < 10.0F)
      {
      f2 = 1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 10.0F;
      if (f2 < 0.0F)
      {
      f2 = 0.0F;
      }
      if (f2 > 1.0F)
      {
      f2 = 1.0F;
      }
      f2 *= f2;
      f2 *= f2;
      float f3 = 1.0F + f2 * 0.3F;
      GL11.glScalef(f3, f3, f3);
      }
      f2 = (1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 100.0F) * 0.8F;
      this.bindEntityTexture(p_76986_1_);
      this.blockRenderer.renderBlockAsItem(Main.tntZenodium, 0, p_76986_1_.getBrightness(p_76986_9_));
      if (p_76986_1_.fuse / 5 % 2 == 0)
      {
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
      this.blockRenderer.renderBlockAsItem(Main.tntZenodium, 0, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glDisable(GL11.GL_BLEND);
      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
      }
      GL11.glPopMatrix();
      }
      /**
      * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
      */
      protected ResourceLocation getEntityTexture(EntityTNTCustom p_110775_1_)
      {
      return TextureMap.locationBlocksTexture;
      }
      /**
      * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
      */
      protected ResourceLocation getEntityTexture(Entity p_110775_1_)
      {
      return this.getEntityTexture((EntityTNTCustom)p_110775_1_);
      }
      /**
      * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
      * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
      * (Render <t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br="">* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
      */
      public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
      {
      this.doRender((EntityTNTCustom)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
      }
      } [java]
      @'Plaigon':
      > Faut que tu fasses attention aux imports, à prendre le bon RenderTNTPrimed.
      En faisant ctrl clique gauche sur le nom ça me redirige bien vers ma classe.
      @'darkvince37':
      > Sa viendrai pas de la texture ? car je c'est que si on mais pas de texture au mob l'entity est invisible c'est pas pareil pour la TNT ?
      >
      > [java] protected ResourceLocation getEntityTexture(EntityTntObsi p_110775_1_)
      >     {
      >         return TextureMap.locationBlocksTexture;
      >     }
      > ```
      ça y est dans mon rendu du coup.</t></t>
      1 réponse Dernière réponse Répondre Citer 0
      • darkvince37
        darkvince37 dernière édition par 20 mai 2016, 20:15

        En cherchant un peut j’ai trouver sa

        https://www.minecraftforgefrance.fr/showthread.php?tid=394

        en 1.7 sa donne sa

        Oublie pas l’implements IEntityAdditionalSpawnData

        @Override
        public void writeSpawnData(ByteBuf buffer) {
        buffer.writeInt(this.fuse);
        }
        @Override
        public void readSpawnData(ByteBuf additionalData) {
        this.fuse = additionalData.readInt();
        }

        J’ai tester sa marche

        1 réponse Dernière réponse Répondre Citer 2
        • S
          Sebenf0rce dernière édition par 20 mai 2016, 22:22

          Merci, la tnt ne disparais plus !
          Par contre c’est un bloc blanc, comment puis-je appliquer une texture ?

          1 réponse Dernière réponse Répondre Citer 0
          • darkvince37
            darkvince37 dernière édition par 20 mai 2016, 22:44

            @‘Sebenf0rce’:

            Merci, la tnt ne disparais plus !
            Par contre c’est un bloc blanc, comment puis-je appliquer une texture ?

            Bizarre j’ai la texture chez moi

            Edit:

            J’ai pu constaté que chez moi il crash sur le serveur pareil pour toi ?

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs dernière édition par 21 mai 2016, 09:41

              Blanc ? Tu peux envoyer un screen ?

              1 réponse Dernière réponse Répondre Citer 0
              • S
                Sebenf0rce dernière édition par 21 mai 2016, 09:49

                @‘robin4002’:

                Blanc ? Tu peux envoyer un screen ?

                C’était vraiment tout blanc sans rien dessus x)
                Je viens de résoudre le problème. J’ai fait une erreur bête, mauvais lien ici :
                @SidedProxy(clientSide = “com.sebenforce.ClientProxy”, serverSide = “com.sebenforce.CommonProxy”)

                Du coup mon register ne s’appliquait pas.

                Merci à tous ceux qui m’ont aidé.

                1 réponse Dernière réponse Répondre Citer 0
                • 1
                • 2
                • 3
                • 3 / 3
                41 sur 47
                • Premier message
                  41/47
                  Dernier message
                Design by Woryk
                Contact / Mentions Légales

                MINECRAFT FORGE FRANCE © 2018

                Powered by NodeBB