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

    Résolu (Bug) Génération minerais.

    1.7.x
    1.7.x
    4
    6
    1149
    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.
    • azatom
      azatom dernière édition par robin4002

      Bonjour, j’ai généré les minerais que j’ai codé sur une map et malgré des recherches assez poussées (X-ray) je n’ai pas trouvé mes minerais, pourtant, il n’y a aucune erreurs apparentes dans les classes des minerais.
      Je précise que j’ai suivis le tutoriel 1.6, qui semblait encore a jour pour la 1.7.

      voici la partie de ma classe principale où il y a les minerais :

      
      //G�n�ration
      GameRegistry.registerWorldGenerator(new GenBA(), 0);
      GameRegistry.registerWorldGenerator(new GenRU(), 0);
      GameRegistry.registerWorldGenerator(new GenSA(), 0);
      //Four
      GameRegistry.addSmelting(BMA, new ItemStack(LA, 1), 1);
      GameRegistry.addSmelting(BMR, new ItemStack(RU, 1), 2);
      GameRegistry.addSmelting(BMS, new ItemStack(SA, 1), 3);
      GameRegistry.addSmelting(CS, new ItemStack(SA, 1), 0);
      GameRegistry.addSmelting(PS, new ItemStack(SA, 2), 0);
      GameRegistry.addSmelting(JS, new ItemStack(SA, 2), 0);
      GameRegistry.addSmelting(BS, new ItemStack(SA, 1), 0);
      }
      
      

      Voici la classe de GenBA (argent) :

      package fr.emergia.EmergiaMod.common;
      
      import java.util.Random;
      
      import net.minecraft.init.Blocks;
      import net.minecraft.world.World;
      import net.minecraft.world.chunk.IChunkProvider;
      import net.minecraft.world.gen.feature.WorldGenMinable;
      import cpw.mods.fml.common.IWorldGenerator;
      
      public class GenBA implements IWorldGenerator
      {
          @Override
          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
          {
              switch(world.provider.dimensionId)
              {
                  case 0:
                      this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
              }
      
          }
      
          private void generateSurface(World world, int x, int z, Random rand)
          {
              for(int i = 0; i < 10; i++)
              {
                  (new WorldGenMinable(EmergiaMenu.BMA, 7, 0, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
              }
      
          }
      }
      

      GenRU (rubis) :

      package fr.emergia.EmergiaMod.common;
      
      import java.util.Random;
      
      import net.minecraft.init.Blocks;
      import net.minecraft.world.World;
      import net.minecraft.world.chunk.IChunkProvider;
      import net.minecraft.world.gen.feature.WorldGenMinable;
      import cpw.mods.fml.common.IWorldGenerator;
      
      public class GenRU implements IWorldGenerator
      {
          @Override
          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
          {
              switch(world.provider.dimensionId)
              {
                  case 0:
                      this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
              }
      
          }
      
          private void generateSurface(World world, int x, int z, Random rand)
          {
              for(int i = 0; i < 1; i++)
              {
                  (new WorldGenMinable(EmergiaMenu.BMR, 0, 5, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
              }
      
          }
      }
      

      GenSA (saphir) :

      package fr.emergia.EmergiaMod.common;
      
      import java.util.Random;
      
      import net.minecraft.init.Blocks;
      import net.minecraft.world.World;
      import net.minecraft.world.chunk.IChunkProvider;
      import net.minecraft.world.gen.feature.WorldGenMinable;
      import cpw.mods.fml.common.IWorldGenerator;
      
      public class GenSA implements IWorldGenerator
      {
          @Override
          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
          {
              switch(world.provider.dimensionId)
              {
                  case 0:
                      this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
              }
          }
      
          private void generateSurface(World world, int x, int z, Random rand)
          {
              for(int i = 0; i < 1; i++)
              {
                  (new WorldGenMinable(EmergiaMenu.BMS, 0, 3, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
              }
          }
      }
      

      Ce sont à peut près les même.
      Merci pour votre aide, cordialement, azatom.

      1 réponse Dernière réponse Répondre Citer 0
      • Überfap
        Überfap dernière édition par

        problème de metadata ici (enfin je crois)

        
        (new WorldGenMinable (EmergiaMenu.BMA, 7,0, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt (16));
        
        

        De plus, 1 dans la boucle for est extrèmement petit, essaye de mettre une grosse valeur pour voir 😉

        Si je t'ai aidé, n'hésites pas à mettre un point de réputation positif !
        Si tu m'as aidé, je n'hésiterais pas à t'en donner à mon tour !

        1 réponse Dernière réponse Répondre Citer 0
        • azatom
          azatom dernière édition par

          Ok, l’argent ce génère, par contre, je ne trouve pas de saphir et de rubis … je vais essayé d’abaisser la rareté pour voir si c’est a cause de celle ci.

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

            GameRegistry.registerWorldGenerator(new GenBA(), 0);
            GameRegistry.registerWorldGenerator(new GenRU(), 0);
            GameRegistry.registerWorldGenerator(new GenSA(), 0);
            What is this shit ?
            Tu peux mettre tout les générateurs dans la même classe … :

            package fr.emergia.EmergiaMod.common;
            
            import java.util.Random;
            
            import net.minecraft.init.Blocks;
            import net.minecraft.world.World;
            import net.minecraft.world.chunk.IChunkProvider;
            import net.minecraft.world.gen.feature.WorldGenMinable;
            import cpw.mods.fml.common.IWorldGenerator;
            
            public class MyGenerator implements IWorldGenerator
            {
                @Override
                public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
                {
                    switch(world.provider.dimensionId)
                    {
                        case 0:
                            this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
                    }
            
                }
            
                private void generateSurface(World world, int x, int z, Random rand)
                {
                    for(int i = 0; i < 10; i++)
                    {
                        (new WorldGenMinable(EmergiaMenu.BMA, 7, 0, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
                    }
            
                    for(int i = 0; i < 1; i++)
                    {
                        (new WorldGenMinable(EmergiaMenu.BMR, 0, 5, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
                    }
            
                    for(int i = 0; i < 1; i++)
                    {
                        (new WorldGenMinable(EmergiaMenu.BMS, 0, 3, Blocks.stone)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(48), z + rand.nextInt(16));
                    }
            
                }
            }
            

            +

            GameRegistry.registerWorldGenerator(new MyGenerator(), 0);
            
            1 réponse Dernière réponse Répondre Citer 0
            • F
              FR_Style13 dernière édition par

              Petit tutoriel en 1.7 🙂 J’ai vu la vidéo c’est un peu le même style que toi sauf qu’il manque quelques trucs 😉 Je te laisse avec ce lien la dernière fois que j’ai fais des générations de minerais c’était en 1.5 donc désolé ^^…

              Youtube Video

              1 réponse Dernière réponse Répondre Citer 0
              • azatom
                azatom dernière édition par

                Ha, c’est très pratique O_o merci. (se sent con…)
                J’ai réussis a trouver du rubis, mais pour le moment… toujours pas de saphir. je continue a chercher, si j’en trouve j’edit et je mes en résolut. Merci.
                Edit : ça marche en mettant un filon plus grand, je mes en résolut.

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

                MINECRAFT FORGE FRANCE © 2018

                Powered by NodeBB