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

    Résolu Génération Nether

    1.7.x
    1.7.x
    4
    12
    2971
    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.
    • M
      MrDiaboloz dernière édition par robin4002

      Bonjour et désoler de encore susciter votre aide.
      Je voudrai générer un minerai dans le nether j’ai suivi le tuto de agaboue pour générer dans le monde normal ça marche très bien mais pas dans le nether ça génère pas (je vous passe le code

      package Craftaclysm.livehost.fr.server;
      
      import java.util.Random;
      
      import net.minecraft.block.Block;
      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 WorldGeneration implements IWorldGenerator {
      
          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
              switch (world.provider.dimensionId)
              {
                  case -1:
                      generateNether(world, random, chunkX * 16, chunkZ * 16);
                  case 0:
                      generateSurface(world, random, chunkX * 16, chunkZ * 16);
                  case 1:
                      generateEnd(world, random, chunkX * 16, chunkZ * 16);
              }
          }
      
          private void generateEnd(World world, Random random, int x, int z) {
      
          }
      
          private void generateSurface(World world, Random random, int x, int z) {
              this.addOreSpawn(Craftamod.Rubisore, world, random, x, z, 16, 16, 1 + random.nextInt(4), 0.5, 3, 10);
              this.addOreSpawn(Craftamod.Crystalore, world, random, x, z, 16, 16, 1 + random.nextInt(5), 0.75, 3, 15);
          }
      
          private void generateNether(World world, Random random, int x, int z) {
              this.addOreSpawn(Craftamod.Ambreore, world, random, x, z, 16, 16, 2 + random.nextInt(5), 200, 1, 256);
          }
      
          public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, double d, int minY, int maxY) {
              assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum.";
              assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16.";
              assert minY > 0 : "La position Y minimum doit être supérieure à 0.";
              assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256.";
              assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16.";
      
              int diffBtwnMinMaxY = maxY - minY;
              for (int x = 0; x < d; x++) {
      
                  int posX = blockXPos + random.nextInt(maxX);
                  int posY = minY + random.nextInt(diffBtwnMinMaxY);
                  int posZ = blockZPos + random.nextInt(maxZ);
                  (new WorldGenMinable(block, maxVeinSize)).generate(world, random, posX, posY, posZ);
              }
          }
      }
      

      Le fichier WorldGeneration

      Rejoignez-nous
      http://craftaclysm.livehost.fr/

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

        Salut,
        Utilise cette fonction :

        public void addOreSpawn(Block block, int metadata, Block target, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, double d, int minY, int maxY) {
        
        assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum.";
        assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16.";
        assert minY > 0 : "La position Y minimum doit être supérieure à 0.";
        assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256.";
        assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16.";
        
        int diffBtwnMinMaxY = maxY - minY;
        for (int x = 0; x < d; x++) {
        
        int posX = blockXPos + random.nextInt(maxX);
        int posY = minY + random.nextInt(diffBtwnMinMaxY);
        int posZ = blockZPos + random.nextInt(maxZ);
        (new WorldGenMinable(block, maxVeinSize, metadata, target)).generate(world, random, posX, posY, posZ);
        }
        }
        }
        

        Du-coup :
        this.addOreSpawn(Craftamod.Rubisore, world, random, x, z, 16, 16, 1 + random.nextInt(4), 0.5, 3, 10);
        Devient :
        this.addOreSpawn(Craftamod.Rubisore, 0, Blocks.stone world, random, x, z, 16, 16, 1 + random.nextInt(4), 0.5, 3, 10);
        Et donc pour le nether même chose, sauf qu’il faut mettre la nether rock ou la soul sand à la place de la stone.

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

          Robin j’ai remplacer et ça ne génère toujour pas

          package Craftaclysm.livehost.fr.server;
          
          import java.util.Random;
          
          import net.minecraft.block.Block;
          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 WorldGeneration implements IWorldGenerator {
          
          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
          
          switch (world.provider.dimensionId)
          {
          case -1:
          generateNether(world, random, chunkX * 16, chunkZ * 16);
          case 0:
          generateSurface(world, random, chunkX * 16, chunkZ * 16);
          case 1:
          generateEnd(world, random, chunkX * 16, chunkZ * 16);
          }
          
          }
          
          private void generateEnd(World world, Random random, int x, int z) {
          
          }
          
          private void generateSurface(World world, Random random, int x, int z) {
          
          this.addOreSpawn(Craftamod.Rubisore, 0, Blocks.stone, world, random, x, z, 16, 16, 1 + random.nextInt(4), 0.5, 3, 10);
          this.addOreSpawn(Craftamod.Crystalore, 0, Blocks.stone, world, random, x, z, 16, 16, 1 + random.nextInt(4), 0.5, 3, 10);
          
          }
          
          private void generateNether(World world, Random random, int x, int z) {
          
          this.addOreSpawn(Craftamod.Ambreore, 0, Blocks.netherrack, world, random, x, z, 16, 16, 1 + random.nextInt(4), 200, 3, 10);
          
          }
          
          public void addOreSpawn(Block block, int metadata, Block target, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, double d, int minY, int maxY) {
          
          assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum.";
          assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16.";
          assert minY > 0 : "La position Y minimum doit être supérieure à 0.";
          assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256.";
          assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16.";
          
          int diffBtwnMinMaxY = maxY - minY;
          for (int x = 0; x < d; x++) {
          
          int posX = blockXPos + random.nextInt(maxX);
          int posY = minY + random.nextInt(diffBtwnMinMaxY);
          int posZ = blockZPos + random.nextInt(maxZ);
          (new WorldGenMinable(block, maxVeinSize, metadata, target)).generate(world, random, posX, posY, posZ);
          }
          }
          }
          

          Rejoignez-nous
          http://craftaclysm.livehost.fr/

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

            Ton maxY (le dernier int de la méthode, donc le 10) est beaucoup trop faible, ton minerai se génère tout en bas du nether.

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

              meme en modifiant en mettant de 1 a 256 ça ne marche pas

              Rejoignez-nous
              http://craftaclysm.livehost.fr/

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

                Tu as bien ouvert un nouveau monde hein ^^’ ou aller dans des chunks qui n’étaient pas généré

                ^^

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

                  avec la methode de robin les minerai de génère plus dans le monde normal

                  Rejoignez-nous
                  http://craftaclysm.livehost.fr/

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

                    Étrange ça.
                    Sinon fait comme ça :

                    private void generateNether(World world, Random random, int x, int z) {
                    for(int i = 0; i < 200; i++)
                    {
                    (new WorldGenMinable(Craftamod.Ambreore, 0, 1 + random.nextInt(4), Blocks.netherrack)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(128), z + rand.nextInt(16));
                    }
                    }
                    
                    1 réponse Dernière réponse Répondre Citer 1
                    • Phenix246
                      Phenix246 Rédacteurs dernière édition par

                      au passage oubli pas de mettre des break sinon tu aura des problèmes plus tard :

                      switch (world.provider.dimensionId)
                      {
                      case -1:
                      generateNether(world, random, chunkX * 16, chunkZ * 16);
                      break;
                      case 0:
                      generateSurface(world, random, chunkX * 16, chunkZ * 16);
                      break;
                      case 1:
                      generateEnd(world, random, chunkX * 16, chunkZ * 16);
                      break;
                      }
                      
                      1 réponse Dernière réponse Répondre Citer 1
                      • M
                        MrDiaboloz dernière édition par

                        MERCI et juste un truc comment on edite la rareté avec ta méthode robin ? et merci a toi phenix aussi

                        Rejoignez-nous
                        http://craftaclysm.livehost.fr/

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

                          d’une part la boucle for, plus le nombre est grand plus il y a de minerais; d’autre part ça : “1 + random.nextInt(4)” c’est le nombre de minerais par filon donc à toi de trouver le juste équilibre.

                          Après un autre paramètre qui peut jouer c’est le bloc dans lequel tu fais spawner le minerais, plus il est rare moins le minerais sera présent

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

                            Par contre MrDiaboloz, tu pourrai réduire ta signature ? 11 lignes c’est beaucoup trop grand à mon goût.

                            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