MFF

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

    Création tnt

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    47 Messages 8 Publieurs 8.6k Vues 1 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.
    • S Hors-ligne
      Sebenf0rce
      dernière édition par

      ça s’affiche comme si la texture était manquante (carré violet et noir).
      Pour l’entité j’ai fait ça :

      package net.minecraft.entity.item;
      
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.nbt.NBTTagCompound;
      import net.minecraft.world.World;
      
      public class EntityTNTPrimed extends Entity
      {
      /** How long the fuse is */
      public int fuse;
      private EntityLivingBase tntPlacedBy;
      private static final String __OBFID = "CL_00001681";
      
      public EntityTNTPrimed(World p_i1729_1_)
      {
      super(p_i1729_1_);
      this.preventEntitySpawning = true;
      this.setSize(0.98F, 0.98F);
      this.yOffset = this.height / 2.0F;
      }
      
      public EntityTNTPrimed(World p_i1730_1_, double p_i1730_2_, double p_i1730_4_, double p_i1730_6_, EntityLivingBase p_i1730_8_)
      {
      this(p_i1730_1_);
      this.setPosition(p_i1730_2_, p_i1730_4_, p_i1730_6_);
      float f = (float)(Math.random() * Math.PI * 2.0D);
      this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
      this.motionY = 0.20000000298023224D;
      this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
      this.fuse = 80;
      this.prevPosX = p_i1730_2_;
      this.prevPosY = p_i1730_4_;
      this.prevPosZ = p_i1730_6_;
      this.tntPlacedBy = p_i1730_8_;
      }
      
      protected void entityInit() {}
      
      /**
      * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
      * prevent them from trampling crops
      */
      protected boolean canTriggerWalking()
      {
      return false;
      }
      
      /**
      * Returns true if other Entities should be prevented from moving through this Entity.
      */
      public boolean canBeCollidedWith()
      {
      return !this.isDead;
      }
      
      /**
      * Called to update the entity's position/logic.
      */
      public void onUpdate()
      {
      this.prevPosX = this.posX;
      this.prevPosY = this.posY;
      this.prevPosZ = this.posZ;
      this.motionY -= 0.03999999910593033D;
      this.moveEntity(this.motionX, this.motionY, this.motionZ);
      this.motionX *= 0.9800000190734863D;
      this.motionY *= 0.9800000190734863D;
      this.motionZ *= 0.9800000190734863D;
      
      if (this.onGround)
      {
      this.motionX *= 0.699999988079071D;
      this.motionZ *= 0.699999988079071D;
      this.motionY *= -0.5D;
      }
      
      if (this.fuse– <= 0)
      {
      this.setDead();
      
      if (!this.worldObj.isRemote)
      {
      this.explode();
      }
      }
      else
      {
      this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
      }
      }
      
      private void explode()
      {
      float f = 4.0F;
      this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
      }
      
      /**
      * (abstract) Protected helper method to write subclass entity data to NBT.
      */
      protected void writeEntityToNBT(NBTTagCompound p_70014_1_)
      {
      p_70014_1_.setByte("Fuse", (byte)this.fuse);
      }
      
      /**
      * (abstract) Protected helper method to read subclass entity data from NBT.
      */
      protected void readEntityFromNBT(NBTTagCompound p_70037_1_)
      {
      this.fuse = p_70037_1_.getByte("Fuse");
      }
      
      @SideOnly(Side.CLIENT)
      public float getShadowSize()
      {
      return 0.0F;
      }
      
      /**
      * returns null or the entityliving it was placed or ignited by
      */
      public EntityLivingBase getTntPlacedBy()
      {
      return this.tntPlacedBy;
      }
      }
      

      Si c’est bien ça, je ne vois pas l’endroit où est géré la puissance de la tnt. Il y a le rayon d’effet mais je ne vois pas ce que je cherche.

      1 réponse Dernière réponse Répondre Citer 0
      • YeyvoY Hors-ligne
        Yeyvo
        dernière édition par

        Normale faut crer une classe render pour ton EntityTnt ;D (pence a regardé les Tito de mff)

        1 réponse Dernière réponse Répondre Citer 0
        • DeletedD Hors-ligne
          Deleted
          dernière édition par

          Le f = 4.0f, de la méthode explode () détermine la puissance de l’explosion.

          1 réponse Dernière réponse Répondre Citer 0
          • S Hors-ligne
            Sebenf0rce
            dernière édition par

            @‘Plaigon’:

            Le f = 4.0f, de la méthode explode () détermine la puissance de l’explosion.

            J’ai mis la valeur f à 2000 afin de pouvoir détruire l’obsidienne cependant cela fait énormément (voir planter) laguer le jeu. Y a t’il une alternative possible ?
            J’ai pris cette valeur car le setResistance est à 2000 pour l’obsidienne, cela a t’il un rapport ?

            Sinon pour l’icone j’ai toujours un soucis avec le top et le bottom pourtant j’ai bien ce code :

            public void registerBlockIcons(IIconRegister p_149651_1_)
               {
                   this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
                   this.field_150116_a = p_149651_1_.registerIcon(this.getTextureName() + "_top");
                   this.field_150115_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom");
               }
            

            De plus je n’ai lorsque la tnt est activé il n’y a plus aucune texture elle disparait, où est l’endroit où cela est définit ?

            Merci de votre aide.

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R Hors-ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              Pour la texture il faut les logs.
              Pour la tnt qui disparaît c’est parce que l’entité n’est pas enregistré.

              et pour l’explosion il me semble qu’il faut faire une explosion custom pour augmenter la force sans augmenter le rayon.

              1 réponse Dernière réponse Répondre Citer 0
              • S Hors-ligne
                Sebenf0rce
                dernière édition par

                @‘robin4002’:

                Pour la texture il faut les logs.
                Pour la tnt qui disparaît c’est parce que l’entité n’est pas enregistré.

                et pour l’explosion il me semble qu’il faut faire une explosion custom pour augmenter la force sans augmenter le rayon.

                Voici les logs :
                http://pastebin.com/HSdWzMsG (j’ai un crash report mais je ne sais pas pourquoi puisque le jeu tourne bien)

                Pour l’explosion est ce bien ça ?

                /**
                     * Creates an explosion. Args: entity, x, y, z, strength
                     */
                    public Explosion createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_)
                    {
                        return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
                    }
                
                    /**
                     * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
                     */
                    public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
                    {
                        Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_);
                        explosion.isFlaming = p_72885_9_;
                        explosion.isSmoking = p_72885_10_;
                        if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion;
                        explosion.doExplosionA();
                        explosion.doExplosionB(true);
                        return explosion;
                    }
                

                Pourquoi lorsque je modifie la force cela modifie aussi le rayon ? Ce n’est pas un paramètre indépendant du rayon d’action ?

                Pour ce qui est de l’entité à définir pour pas que la tnt disparaisse est-ce ici ?

                 public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
                    {
                        if (p_149727_5_.getCurrentEquippedItem() != null && p_149727_5_.getCurrentEquippedItem().getItem() == Items.flint_and_steel)
                        {
                            this.func_150114_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, 1, p_149727_5_);
                            p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
                            p_149727_5_.getCurrentEquippedItem().damageItem(1, p_149727_5_);
                            return true;
                        }
                        else
                        {
                            return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
                        }
                    }
                
                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  [20:29:44] [Client thread/ERROR] [TEXTURE ERRORS/]: The missing resources for domain minecraft are:
                  [20:29:44] [Client thread/ERROR] [TEXTURE ERRORS/]: textures/blocks/zorifighttnt_top.png
                  [20:29:44] [Client thread/ERROR] [TEXTURE ERRORS/]: textures/blocks/zorifighttnt_bottom.png
                  [20:29:44] [Client thread/ERROR] [TEXTURE ERRORS/]: –-----------------------
                  [20:29:44] [Client thread/ERROR] [TEXTURE ERRORS/]: No other errors exist for domain minecraft
                  

                  Les textures sont manquantes car il les cherches dans le dossier assets/minecraft/textures/blocks/
                  Tu as oubliés de mettre modid:

                  Et pour le crash rapport il suffit de lire …
                  “This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR”

                  Pour la force d’explosion c’est en effet dans la classe Explosion que tout se passe.

                  Et pour l’entité, non ce n’est pas du tout ça.
                  Il faut juste ajouter un EntityRegistry.registerModEntity … dans ta classe principale avec ta tnt custom.

                  1 réponse Dernière réponse Répondre Citer 0
                  • S Hors-ligne
                    Sebenf0rce
                    dernière édition par

                    Merci, les texutres s’affichent parfaitement.

                    Pour l’explosion j’ai ajouté ces méthodes dans ma classe EntityTNTCustom :

                    private void explode()
                        {
                            float f = 2000.0F;
                            createExplosion(this, this.posX, this.posY, this.posZ, f, true);
                        }
                    
                        /**
                         * Creates an explosion. Args: entity, x, y, z, strength
                         */
                        public Explosion createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_)
                        {
                            return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
                        }
                    
                        /**
                         * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
                         */
                        public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
                        {
                            Explosion explosion = new Explosion(this.worldObj, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_);
                            explosion.isFlaming = p_72885_9_;
                            explosion.isSmoking = p_72885_10_;
                            if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.worldObj, explosion)) return explosion;
                            explosion.doExplosionA();
                            explosion.doExplosionB(true);
                            return explosion;
                        }
                    

                    Je peux donc créer ma propre explosion mais en utilisant le code déjà existant de la classe Explosion de base j’ai de nombreuse erreurs du fait des fonctions utilisant la classe de base (ex : The method canDropFromExplosion(net.minecraft.world.Explosion) in the type Block is not applicable for the arguments (com.sebenforce.Explosion))

                    Sinon pour mon problème de rayon j’ai repéré ceci :
                     float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F);

                    Cependant la taille n’est pas modifier par la force que je modifie moi même non ?

                    1 réponse Dernière réponse Répondre Citer 0
                    • AymericRedA Hors-ligne
                      AymericRed
                      dernière édition par

                      Pour résoudre tes erreurs, extends tout simplement ta classe Explosion.

                      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 réponse Dernière réponse Répondre Citer 0
                      • S Hors-ligne
                        Sebenf0rce
                        dernière édition par

                        Niquel ça marche merci. Maintenant je ne vois pas très bien comment résoudre mon problème initial. Empêcher les lags suite à l’explosion de la tnt car je n’ai modifié qu’un paramètre (la force) qui n’a pas d’impact sur les autre valeurs.

                        1 réponse Dernière réponse Répondre Citer 0
                        • AymericRedA Hors-ligne
                          AymericRed
                          dernière édition par

                          Empėcher les lags ? Même les explosions Vanilla laguent mais tu peux essayer de faire spawn moins de particules ou encore ne pas faire spawn les EntityItem des blocks…

                          Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk

                          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 réponse Dernière réponse Répondre Citer 0
                          • S Hors-ligne
                            Sebenf0rce
                            dernière édition par

                            @‘AymericRed’:

                            Empėcher les lags ? Même les explosions Vanilla laguent mais tu peux essayer de faire spawn moins de particules ou encore ne pas faire spawn les EntityItem des blocks…

                            Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk

                            Le problème c’est que là j’ai augmenté la puissance à 2000F pour pouvoir casser la tnt mais du coup ça fait limite crashé le jeu. Je ne trouve pas où réduire le rayon de la tnt.

                            Sinon pour register l’entité ce n’est pas comme ça ? :
                                     EntityRegistry.registerModEntity(TntZenodium.class, “tntZenodium”, 30, Main.MODID, 1, 1, true);

                            1 réponse Dernière réponse Répondre Citer 0
                            • MyrilandelM Hors-ligne
                              Myrilandel
                              dernière édition par

                              Salut Sebenf0rce,
                              Pour palier à ton problème, tu peux peut-être essayer de redéfinir la méthode doExplosionA() ?
                              C’est la méthode qui permet de détruire les blocks adjacent à ta TNT. Dans cette méthode tu as un test à un moment :

                              
                              Block block = this.worldObj.getBlock(j1, k1, l1);
                              if (block.getMaterial() != Material.air) {
                              float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
                              f1 -= (f3 + 0.3F) * f2;
                              }
                              

                              Si je ne dis pas de bétises, il me semble que tu récupères la résistance des blocks adjacent à ta TNT.
                              Modifie le pour que si le block  détecté est un block d’obsidienne alors la résistance f3 retranchée à f1 soit petite (genre tu mets un f3 = à la resistance de la dirt par exemple).
                              Et tu gardes une valeur d’explosion relativement faible ce qui va réduire tes lags et ton rayon d’action.
                              PS : Je suis pas chez moi pour l’instant, je ne peux pas tester ce que j’avance mais je le fais dès que j’arrive 😉
                              Bon courage et en espérant avoir aidé !

                              1 réponse Dernière réponse Répondre Citer 0
                              • S Hors-ligne
                                Sebenf0rce
                                dernière édition par

                                Salut,
                                J’ai essayé de faire ce que tu m’as dit mais le jeu crash, voila mon nouveau code :

                                if (block.getMaterial() != Material.air)
                                                           {
                                                            if(block.getMaterial() == Blocks.obsidian.getMaterial()) {
                                                             float f3 =  2.0f;
                                                             f1 -= (f3 + 0.3F) * f2;
                                                            }
                                                            else {
                                                               float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
                                                               f1 -= (f3 + 0.3F) * f2;
                                                           }
                                                           }
                                

                                Suis-je partis sur une mauvaise base ?

                                1 réponse Dernière réponse Répondre Citer 0
                                • MyrilandelM Hors-ligne
                                  Myrilandel
                                  dernière édition par

                                  Attention, si tu regardes le block d’obsidienne, il étend la classe BlockStone qui a pour material stone, du coup ta TNT risque de ravager à la fois l’obsidienne mais aussi tout les blocks de stone, cobble etc…
                                  J’ai essayé en modifiant la méthode comme ça et ça a marché :

                                  
                                  if (block.getMaterial() != Material.air)
                                  {
                                        float f3 = this.exploder != null ?
                                              this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) :
                                              block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
                                  
                                       if(block == Blocks.obsidian)
                                               f3 = 1.0F;
                                  
                                        f1 -= (f3 + 0.3F) * f2;
                                  }
                                  
                                  

                                  Si ça plante encore, envoie le rapport d’erreur s’il te plait : )

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • robin4002R Hors-ligne
                                    robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                    dernière édition par

                                    C’est en effet ici que la résistance du bloc est prit en compte :

                                    for (float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F)
                                    {
                                    int j1 = MathHelper.floor_double(d5);
                                    int k1 = MathHelper.floor_double(d6);
                                    int l1 = MathHelper.floor_double(d7);
                                    Block block = this.worldObj.getBlock(j1, k1, l1);
                                    
                                    if (block.getMaterial() != Material.air)
                                    {
                                    float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
                                    f1 -= (f3 + 0.3F) * f2;
                                    }
                                    
                                    if (f1 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, j1, k1, l1, block, f1)))
                                    {
                                    hashset.add(new ChunkPosition(j1, k1, l1));
                                    }
                                    
                                    d5 += d0 * (double)f2;
                                    d6 += d1 * (double)f2;
                                    d7 += d2 * (double)f2;
                                    }
                                    

                                    Dans la deuxième condition il suffit d’enlever f1 > 0.0F et ça devrait être bon.

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • S Hors-ligne
                                      Sebenf0rce
                                      dernière édition par

                                      J’ai un crash qui survient lors de la création de mon explosionCustom :
                                      http://pastebin.com/bF4Ev0UM

                                      Et je n’ai n’arrive pas à avoir la texture de la tnt lorsqu’elle est actionné pourtant je pense bien avoir register ce qu’il fallait.
                                      Voici mon code :
                                      Main :

                                      tntZenodium = new TntZenodium().setHardness(0.0F).setBlockName("tnt").setBlockTextureName(Main.MODID + "tnt");
                                              GameRegistry.registerBlock(tntZenodium, "tntZenodium");
                                              EntityRegistry.registerModEntity(EntityTNTCustom.class, "EntityTNTCustom", 30, Main.MODID, 80, 3, true);
                                      

                                      Classe de la tnt :

                                      package com.sebenforce;
                                      
                                      import cpw.mods.fml.relauncher.Side;
                                      import cpw.mods.fml.relauncher.SideOnly;
                                      
                                      import java.util.Random;
                                      
                                      import net.minecraft.block.Block;
                                      import net.minecraft.block.material.Material;
                                      import net.minecraft.client.renderer.texture.IIconRegister;
                                      import net.minecraft.creativetab.CreativeTabs;
                                      import net.minecraft.entity.Entity;
                                      import net.minecraft.entity.EntityLivingBase;
                                      import net.minecraft.entity.player.EntityPlayer;
                                      import net.minecraft.entity.projectile.EntityArrow;
                                      import net.minecraft.init.Items;
                                      import net.minecraft.util.IIcon;
                                      import net.minecraft.world.Explosion;
                                      import net.minecraft.world.World;
                                      
                                      public class TntZenodium extends Block
                                      {
                                         @SideOnly(Side.CLIENT)
                                         private IIcon field_150116_a;
                                         @SideOnly(Side.CLIENT)
                                         private IIcon field_150115_b;
                                      
                                         public TntZenodium()
                                         {
                                             super(Material.tnt);
                                             this.setCreativeTab(CreativeTabs.tabRedstone);
                                         }
                                      
                                         @SideOnly(Side.CLIENT)
                                         public IIcon getIcon(int p_149691_1_, int p_149691_2_)
                                         {
                                             return p_149691_1_ == 0 ? this.field_150115_b : (p_149691_1_ == 1 ? this.field_150116_a : this.blockIcon);
                                         }
                                      
                                         /**
                                          * Called whenever the block is added into the world. Args: world, x, y, z
                                          */
                                         public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
                                         {
                                             super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
                                      
                                             if (p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_))
                                             {
                                                 this.onBlockDestroyedByPlayer(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, 1);
                                                 p_149726_1_.setBlockToAir(p_149726_2_, p_149726_3_, p_149726_4_);
                                             }
                                         }
                                      
                                         /**
                                          * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
                                          * their own) Args: x, y, z, neighbor Block
                                          */
                                         public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
                                         {
                                             if (p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_))
                                             {
                                                 this.onBlockDestroyedByPlayer(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, 1);
                                                 p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_);
                                             }
                                         }
                                      
                                         /**
                                          * Returns the quantity of items to drop on block destruction.
                                          */
                                         public int quantityDropped(Random p_149745_1_)
                                         {
                                             return 1;
                                         }
                                      
                                         /**
                                          * Called upon the block being destroyed by an explosion
                                          */
                                         public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
                                         {
                                             if (!p_149723_1_.isRemote)
                                             {
                                              EntityTNTCustom entitytntprimed = new EntityTNTCustom(p_149723_1_, (double)((float)p_149723_2_ + 0.5F), (double)((float)p_149723_3_ + 0.5F), (double)((float)p_149723_4_ + 0.5F), p_149723_5_.getExplosivePlacedBy());
                                                 entitytntprimed.fuse = p_149723_1_.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
                                                 p_149723_1_.spawnEntityInWorld(entitytntprimed);
                                             }
                                         }
                                      
                                         /**
                                          * Called right before the block is destroyed by a player.  Args: world, x, y, z, metaData
                                          */
                                         public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_)
                                         {
                                             this.func_150114_a(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_, (EntityLivingBase)null);
                                         }
                                      
                                         public void func_150114_a(World p_150114_1_, int p_150114_2_, int p_150114_3_, int p_150114_4_, int p_150114_5_, EntityLivingBase p_150114_6_)
                                         {
                                             if (!p_150114_1_.isRemote)
                                             {
                                                 if ((p_150114_5_ & 1) == 1)
                                                 {
                                                  EntityTNTCustom entitytntprimed = new EntityTNTCustom(p_150114_1_, (double)((float)p_150114_2_ + 0.5F), (double)((float)p_150114_3_ + 0.5F), (double)((float)p_150114_4_ + 0.5F), p_150114_6_);
                                                     p_150114_1_.spawnEntityInWorld(entitytntprimed);
                                                     p_150114_1_.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
                                                 }
                                             }
                                         }
                                      
                                         /**
                                          * Called upon block activation (right click on the block.)
                                          */
                                         public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
                                         {
                                             if (p_149727_5_.getCurrentEquippedItem() != null && p_149727_5_.getCurrentEquippedItem().getItem() == Items.flint_and_steel)
                                             {
                                                 this.func_150114_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, 1, p_149727_5_);
                                                 p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
                                                 p_149727_5_.getCurrentEquippedItem().damageItem(1, p_149727_5_);
                                                 return true;
                                             }
                                             else
                                             {
                                                 return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
                                             }
                                         }
                                      
                                         /**
                                          * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
                                          */
                                         public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
                                         {
                                             if (p_149670_5_ instanceof EntityArrow && !p_149670_1_.isRemote)
                                             {
                                                 EntityArrow entityarrow = (EntityArrow)p_149670_5_;
                                      
                                                 if (entityarrow.isBurning())
                                                 {
                                                     this.func_150114_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);
                                                     p_149670_1_.setBlockToAir(p_149670_2_, p_149670_3_, p_149670_4_);
                                                 }
                                             }
                                         }
                                      
                                         /**
                                          * Return whether this block can drop from an explosion.
                                          */
                                         public boolean canDropFromExplosion(Explosion p_149659_1_)
                                         {
                                             return false;
                                         }
                                      
                                         @SideOnly(Side.CLIENT)
                                         public void registerBlockIcons(IIconRegister p_149651_1_)
                                         {
                                             this.blockIcon = p_149651_1_.registerIcon(Main.MODID + ":tnt_side");
                                             this.field_150116_a = p_149651_1_.registerIcon(Main.MODID + ":tnt_top");
                                             this.field_150115_b = p_149651_1_.registerIcon(Main.MODID + ":tnt_bottom");
                                         }
                                      }
                                      

                                      La classe de l’entité :

                                      package com.sebenforce;
                                      
                                      import cpw.mods.fml.relauncher.Side;
                                      import cpw.mods.fml.relauncher.SideOnly;
                                      import net.minecraft.entity.Entity;
                                      import net.minecraft.entity.EntityLivingBase;
                                      import net.minecraft.nbt.NBTTagCompound;
                                      import net.minecraft.world.Explosion;
                                      import net.minecraft.world.World;
                                      
                                      public class EntityTNTCustom extends Entity
                                      {
                                         /** How long the fuse is */
                                         public int fuse;
                                         private EntityLivingBase tntPlacedBy;
                                         private static final String __OBFID = "CL_00001681";
                                      
                                         public EntityTNTCustom(World p_i1729_1_)
                                         {
                                             super(p_i1729_1_);
                                             this.preventEntitySpawning = true;
                                             this.setSize(0.98F, 0.98F);
                                             this.yOffset = this.height / 2.0F;
                                         }
                                      
                                         public EntityTNTCustom(World p_i1730_1_, double p_i1730_2_, double p_i1730_4_, double p_i1730_6_, EntityLivingBase p_i1730_8_)
                                         {
                                             this(p_i1730_1_);
                                             this.setPosition(p_i1730_2_, p_i1730_4_, p_i1730_6_);
                                             float f = (float)(Math.random() * Math.PI * 2.0D);
                                             this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
                                             this.motionY = 0.20000000298023224D;
                                             this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
                                             this.fuse = 80;
                                             this.prevPosX = p_i1730_2_;
                                             this.prevPosY = p_i1730_4_;
                                             this.prevPosZ = p_i1730_6_;
                                             this.tntPlacedBy = p_i1730_8_;
                                         }
                                      
                                         protected void entityInit() {}
                                      
                                         /**
                                          * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
                                          * prevent them from trampling crops
                                          */
                                         protected boolean canTriggerWalking()
                                         {
                                             return false;
                                         }
                                      
                                         /**
                                          * Returns true if other Entities should be prevented from moving through this Entity.
                                          */
                                         public boolean canBeCollidedWith()
                                         {
                                             return !this.isDead;
                                         }
                                      
                                         /**
                                          * Called to update the entity's position/logic.
                                          */
                                         public void onUpdate()
                                         {
                                             this.prevPosX = this.posX;
                                             this.prevPosY = this.posY;
                                             this.prevPosZ = this.posZ;
                                             this.motionY -= 0.03999999910593033D;
                                             this.moveEntity(this.motionX, this.motionY, this.motionZ);
                                             this.motionX *= 0.9800000190734863D;
                                             this.motionY *= 0.9800000190734863D;
                                             this.motionZ *= 0.9800000190734863D;
                                      
                                             if (this.onGround)
                                             {
                                                 this.motionX *= 0.699999988079071D;
                                                 this.motionZ *= 0.699999988079071D;
                                                 this.motionY *= -0.5D;
                                             }
                                      
                                             if (this.fuse– <= 0)
                                             {
                                                 this.setDead();
                                      
                                                 if (!this.worldObj.isRemote)
                                                 {
                                                     this.explode();
                                                 }
                                             }
                                             else
                                             {
                                                 this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
                                             }
                                         }
                                      
                                         private void explode()
                                         {
                                             float f = 4.0F;
                                            createExplosion(this, this.posX, this.posY, this.posZ, f, true);
                                         }
                                      
                                         /**
                                          * Creates an explosion. Args: entity, x, y, z, strength
                                          */
                                         public ExplosionCustom createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_)
                                         {
                                             return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
                                         }
                                      
                                         /**
                                          * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
                                          */
                                         public ExplosionCustom newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
                                         {
                                          ExplosionCustom explosion = new ExplosionCustom(this.worldObj, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_);
                                             explosion.isFlaming = p_72885_9_;
                                             explosion.isSmoking = p_72885_10_;
                                             if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.worldObj, explosion)) return explosion;
                                             explosion.doExplosionA();
                                             explosion.doExplosionB(true);
                                             return explosion;
                                         }
                                      
                                         /**
                                          * (abstract) Protected helper method to write subclass entity data to NBT.
                                          */
                                         protected void writeEntityToNBT(NBTTagCompound p_70014_1_)
                                         {
                                             p_70014_1_.setByte("Fuse", (byte)this.fuse);
                                         }
                                      
                                         /**
                                          * (abstract) Protected helper method to read subclass entity data from NBT.
                                          */
                                         protected void readEntityFromNBT(NBTTagCompound p_70037_1_)
                                         {
                                             this.fuse = p_70037_1_.getByte("Fuse");
                                         }
                                      
                                         @SideOnly(Side.CLIENT)
                                         public float getShadowSize()
                                         {
                                             return 0.0F;
                                         }
                                      
                                         /**
                                          * returns null or the entityliving it was placed or ignited by
                                          */
                                         public EntityLivingBase getTntPlacedBy()
                                         {
                                             return this.tntPlacedBy;
                                         }
                                      }
                                      

                                      Et la classe de l’explosion :

                                      package com.sebenforce;
                                      
                                      import java.util.ArrayList;
                                      import java.util.HashMap;
                                      import java.util.HashSet;
                                      import java.util.Iterator;
                                      import java.util.List;
                                      import java.util.Map;
                                      import java.util.Random;
                                      
                                      import net.minecraft.block.Block;
                                      import net.minecraft.block.material.Material;
                                      import net.minecraft.enchantment.EnchantmentProtection;
                                      import net.minecraft.entity.Entity;
                                      import net.minecraft.entity.EntityLivingBase;
                                      import net.minecraft.entity.player.EntityPlayer;
                                      import net.minecraft.init.Blocks;
                                      import net.minecraft.util.AxisAlignedBB;
                                      import net.minecraft.util.DamageSource;
                                      import net.minecraft.util.MathHelper;
                                      import net.minecraft.util.Vec3;
                                      import net.minecraft.world.ChunkPosition;
                                      import net.minecraft.world.Explosion;
                                      import net.minecraft.world.World;
                                      
                                      public class ExplosionCustom extends Explosion
                                      {
                                         /** whether or not the explosion sets fire to blocks around it */
                                         public boolean isFlaming;
                                         /** whether or not this explosion spawns smoke particles */
                                         public boolean isSmoking = true;
                                         private int field_77289_h = 16;
                                         private Random explosionRNG = new Random();
                                         private World worldObj;
                                         public double explosionX;
                                         public double explosionY;
                                         public double explosionZ;
                                         public Entity exploder;
                                         public float explosionSize;
                                         /** A list of ChunkPositions of blocks affected by this explosion */
                                         public List affectedBlockPositions = new ArrayList();
                                         private Map field_77288_k = new HashMap();
                                         private static final String __OBFID = "CL_00000134";
                                      
                                         public ExplosionCustom(World p_i1948_1_, Entity p_i1948_2_, double p_i1948_3_, double p_i1948_5_, double p_i1948_7_, float p_i1948_9_)
                                         {
                                           super(p_i1948_1_,p_i1948_2_ , p_i1948_3_, p_i1948_5_,p_i1948_7_, p_i1948_9_);
                                         }
                                      
                                         /**
                                          * Does the first part of the explosion (destroy blocks)
                                          */
                                         public void doExplosionA()
                                         {
                                             float f = this.explosionSize;
                                             HashSet hashset = new HashSet();
                                             int i;
                                             int j;
                                             int k;
                                             double d5;
                                             double d6;
                                             double d7;
                                      
                                             for (i = 0; i < this.field_77289_h; ++i)
                                             {
                                                 for (j = 0; j < this.field_77289_h; ++j)
                                                 {
                                                     for (k = 0; k < this.field_77289_h; ++k)
                                                     {
                                                         if (i == 0 || i == this.field_77289_h - 1 || j == 0 || j == this.field_77289_h - 1 || k == 0 || k == this.field_77289_h - 1)
                                                         {
                                                             double d0 = (double)((float)i / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F);
                                                             double d1 = (double)((float)j / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F);
                                                             double d2 = (double)((float)k / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F);
                                                             double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
                                                             d0 /= d3;
                                                             d1 /= d3;
                                                             d2 /= d3;
                                                             float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F);
                                                             d5 = this.explosionX;
                                                             d6 = this.explosionY;
                                                             d7 = this.explosionZ;
                                      
                                                             for (float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F)
                                                             {
                                                                 int j1 = MathHelper.floor_double(d5);
                                                                 int k1 = MathHelper.floor_double(d6);
                                                                 int l1 = MathHelper.floor_double(d7);
                                                                 Block block = this.worldObj.getBlock(j1, k1, l1);
                                      
                                                                 if (block.getMaterial() != Material.air)
                                                                 {
                                                                     float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
                                                                     f1 -= (f3 + 0.3F) * f2;
                                                                 }
                                      
                                                                 if (f1 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, j1, k1, l1, block, f1)))
                                                                 {
                                                                     hashset.add(new ChunkPosition(j1, k1, l1));
                                                                 }
                                      
                                                                 d5 += d0 * (double)f2;
                                                                 d6 += d1 * (double)f2;
                                                                 d7 += d2 * (double)f2;
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                      
                                             this.affectedBlockPositions.addAll(hashset);
                                             this.explosionSize *= 2.0F;
                                             i = MathHelper.floor_double(this.explosionX - (double)this.explosionSize - 1.0D);
                                             j = MathHelper.floor_double(this.explosionX + (double)this.explosionSize + 1.0D);
                                             k = MathHelper.floor_double(this.explosionY - (double)this.explosionSize - 1.0D);
                                             int i2 = MathHelper.floor_double(this.explosionY + (double)this.explosionSize + 1.0D);
                                             int l = MathHelper.floor_double(this.explosionZ - (double)this.explosionSize - 1.0D);
                                             int j2 = MathHelper.floor_double(this.explosionZ + (double)this.explosionSize + 1.0D);
                                             List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2));
                                             net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, this.explosionSize);
                                             Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ);
                                      
                                             for (int i1 = 0; i1 < list.size(); ++i1)
                                             {
                                                 Entity entity = (Entity)list.get(i1);
                                                 double d4 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)this.explosionSize;
                                      
                                                 if (d4 <= 1.0D)
                                                 {
                                                     d5 = entity.posX - this.explosionX;
                                                     d6 = entity.posY + (double)entity.getEyeHeight() - this.explosionY;
                                                     d7 = entity.posZ - this.explosionZ;
                                                     double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
                                      
                                                     if (d9 != 0.0D)
                                                     {
                                                         d5 /= d9;
                                                         d6 /= d9;
                                                         d7 /= d9;
                                                         double d10 = (double)this.worldObj.getBlockDensity(vec3, entity.boundingBox);
                                                         double d11 = (1.0D - d4) * d10;
                                                         entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float)((int)((d11 * d11 + d11) / 2.0D * 8.0D * (double)this.explosionSize + 1.0D)));
                                                         double d8 = EnchantmentProtection.func_92092_a(entity, d11);
                                                         entity.motionX += d5 * d8;
                                                         entity.motionY += d6 * d8;
                                                         entity.motionZ += d7 * d8;
                                      
                                                         if (entity instanceof EntityPlayer)
                                                         {
                                                             this.field_77288_k.put((EntityPlayer)entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
                                                         }
                                                     }
                                                 }
                                             }
                                      
                                             this.explosionSize = f;
                                         }
                                      
                                         /**
                                          * Does the second part of the explosion (sound, particles, drop spawn)
                                          */
                                         public void doExplosionB(boolean p_77279_1_)
                                         {
                                             this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
                                      
                                             if (this.explosionSize >= 2.0F && this.isSmoking)
                                             {
                                                 this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
                                             }
                                             else
                                             {
                                                 this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
                                             }
                                      
                                             Iterator iterator;
                                             ChunkPosition chunkposition;
                                             int i;
                                             int j;
                                             int k;
                                             Block block;
                                      
                                             if (this.isSmoking)
                                             {
                                                 iterator = this.affectedBlockPositions.iterator();
                                      
                                                 while (iterator.hasNext())
                                                 {
                                                     chunkposition = (ChunkPosition)iterator.next();
                                                     i = chunkposition.chunkPosX;
                                                     j = chunkposition.chunkPosY;
                                                     k = chunkposition.chunkPosZ;
                                                     block = this.worldObj.getBlock(i, j, k);
                                      
                                                     if (p_77279_1_)
                                                     {
                                                         double d0 = (double)((float)i + this.worldObj.rand.nextFloat());
                                                         double d1 = (double)((float)j + this.worldObj.rand.nextFloat());
                                                         double d2 = (double)((float)k + this.worldObj.rand.nextFloat());
                                                         double d3 = d0 - this.explosionX;
                                                         double d4 = d1 - this.explosionY;
                                                         double d5 = d2 - this.explosionZ;
                                                         double d6 = (double)MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
                                                         d3 /= d6;
                                                         d4 /= d6;
                                                         d5 /= d6;
                                                         double d7 = 0.5D / (d6 / (double)this.explosionSize + 0.1D);
                                                         d7 *= (double)(this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F);
                                                         d3 *= d7;
                                                         d4 *= d7;
                                                         d5 *= d7;
                                                         this.worldObj.spawnParticle("explode", (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5);
                                                         this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
                                                     }
                                      
                                                     if (block.getMaterial() != Material.air)
                                                     {
                                                         if (block.canDropFromExplosion(this))
                                                         {
                                                             block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0);
                                                         }
                                      
                                                         block.onBlockExploded(this.worldObj, i, j, k, this);
                                                     }
                                                 }
                                             }
                                      
                                             if (this.isFlaming)
                                             {
                                                 iterator = this.affectedBlockPositions.iterator();
                                      
                                                 while (iterator.hasNext())
                                                 {
                                                     chunkposition = (ChunkPosition)iterator.next();
                                                     i = chunkposition.chunkPosX;
                                                     j = chunkposition.chunkPosY;
                                                     k = chunkposition.chunkPosZ;
                                                     block = this.worldObj.getBlock(i, j, k);
                                                     Block block1 = this.worldObj.getBlock(i, j - 1, k);
                                      
                                                     if (block.getMaterial() == Material.air && block1.func_149730_j() && this.explosionRNG.nextInt(3) == 0)
                                                     {
                                                         this.worldObj.setBlock(i, j, k, Blocks.fire);
                                                     }
                                                 }
                                             }
                                         }
                                      
                                         public Map func_77277_b()
                                         {
                                             return this.field_77288_k;
                                         }
                                      
                                         /**
                                          * Returns either the entity that placed the explosive block, the entity that caused the explosion or null.
                                          */
                                         public EntityLivingBase getExplosivePlacedBy()
                                         {
                                             return this.exploder == null ? null : (this.exploder instanceof EntityTNTCustom ? ((EntityTNTCustom)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null));
                                         }
                                      }
                                      
                                      1 réponse Dernière réponse Répondre Citer 0
                                      • AymericRedA Hors-ligne
                                        AymericRed
                                        dernière édition par

                                        Tu as un npe à la ligne 80, c’est bien celle là : float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); ?
                                        Si oui, fais un print de this.worldObj puis this.worldObj.rand.

                                        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 réponse Dernière réponse Répondre Citer 0
                                        • S Hors-ligne
                                          Sebenf0rce
                                          dernière édition par

                                          @‘AymericRed’:

                                          Tu as un npe à la ligne 80, c’est bien celle là : float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); ?
                                          Si oui, fais un print de this.worldObj puis this.worldObj.rand.

                                          J’ai donc ajouté cette ligne à la ligne 80 : System.out.println("Wordobj : " + this.worldObj + " worldObj.rand : " + this.worldObj.rand);
                                          Cependant aucun texte ne s’affiche dans la console.

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • robin4002R Hors-ligne
                                            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                            dernière édition par

                                            Supprimes également les lignes :
                                            private static final String __OBFID = “CL_xxxxxxx”;
                                            Sinon tu vas avoir des problèmes lors de la compilation.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB