MFF

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

    Génération de minerais dans un multiverse

    Planifier Épinglé Verrouillé Déplacé Support pour les utilisateurs
    1.7.10
    11 Messages 4 Publieurs 3.1k 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.
    • _ Hors-ligne
      _BrowNeez_
      dernière édition par

      Hello 😄

      je sais qu’en ce moment je créer beaucoup de topic mais j’ai énormément de problèmes.

      Bref, j’ai voulus créer un monde multiverse avec les minerais de mon mod mais problème: il n’y a pas les minerais dans la map

      J’ai essayer avec un seed mais pareil

      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

        Il suffit de retirer la condition ou le switch avec l’id de la dimension dans le générateur.

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

          dans le mod ou avec la commande ?

          comme par exemple /mv create test ?

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

            Dans le mod

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

              donc j’enlève :

              switch(world.etc……){
              }

              c’est bien ça ?

              Edit:

              Quand j’enlève le switch j’ai des érreurs à generateSurface(Random random, int chunkX, int chunkZ, World world), ça me dit de mettre un suppressionWarning ou de supprimer :

              package fr.browneez.gen;

              import cpw.mods.fml.common.IWorldGenerator;
              import fr.browneez.locky.Main;
              import java.util.Random;
              import net.minecraft.block.Block;
              import net.minecraft.init.Blocks;
              import net.minecraft.world.World;
              import net.minecraft.world.WorldProvider;
              import net.minecraft.world.chunk.IChunkProvider;
              import net.minecraft.world.gen.feature.WorldGenMinable;

              public class GenStats
                implements IWorldGenerator
              {
                public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
                {

              }

              private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance)
                {
                  for (int i = 0; i < spawnChance; i++)
                  {
                    int defaultChunkSize = 16;

              int xPos = posX + random.nextInt(defaultChunkSize);
                    int yPos = minY + random.nextInt(maxY - minY);
                    int zPos = posZ + random.nextInt(defaultChunkSize);

              new WorldGenMinable(block, minVeinSize + random.nextInt(maxVeinSize - minVeinSize), blockSpawn).generate(world, random, xPos, yPos, zPos);
                  }
                }

              private void generateSurface(Random random, int chunkX, int chunkZ, World world)
                {
                  addOre(Main.Lockyumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 13, 3, 5, 2);
                  addOre(Main.Titaniumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 20, 4, 5, 3);
                  addOre(Main.Thoriumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 45, 4, 10, 15);
                }

              }

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

                Envoie ton ancienne classe, avant que tu supprime le switch (quand il n’y avait pas d’erreurs) et met là entre balise java

                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

                  Comme ça :

                  package fr.browneez.gen;
                  
                  import cpw.mods.fml.common.IWorldGenerator;
                  import fr.browneez.locky.Main;
                  import java.util.Random;
                  import net.minecraft.block.Block;
                  import net.minecraft.init.Blocks;
                  import net.minecraft.world.World;
                  import net.minecraft.world.WorldProvider;
                  import net.minecraft.world.chunk.IChunkProvider;
                  import net.minecraft.world.gen.feature.WorldGenMinable;
                  
                  public class GenStats
                   implements IWorldGenerator
                  {
                   public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
                   {
                      addOre(Main.Lockyumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 13, 3, 5, 2);
                      addOre(Main.Titaniumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 20, 4, 5, 3);
                      addOre(Main.Thoriumore, Blocks.stone, random, world, chunkX, chunkZ, 4, 45, 4, 10, 15);
                   }
                  
                   private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance)
                   {
                     for (int i = 0; i < spawnChance; i++)
                     {
                       int defaultChunkSize = 16;
                  
                       int xPos = posX + random.nextInt(defaultChunkSize);
                       int yPos = minY + random.nextInt(maxY - minY);
                       int zPos = posZ + random.nextInt(defaultChunkSize);
                  
                       new WorldGenMinable(block, minVeinSize + random.nextInt(maxVeinSize - minVeinSize), blockSpawn).generate(world, random, xPos, yPos, zPos);
                     }
                   }
                  }
                  
                  1 réponse Dernière réponse Répondre Citer 0
                  • _ Hors-ligne
                    _BrowNeez_
                    dernière édition par

                    package fr.browneez.gen;
                    
                    import cpw.mods.fml.common.IWorldGenerator;
                    import fr.browneez.lockycraft.Main;
                    import java.util.Random;
                    import net.minecraft.block.Block;
                    import net.minecraft.init.Blocks;
                    import net.minecraft.world.World;
                    import net.minecraft.world.WorldProvider;
                    import net.minecraft.world.chunk.IChunkProvider;
                    import net.minecraft.world.gen.feature.WorldGenMinable;
                    
                    public class GenStats
                     implements IWorldGenerator
                    {
                     public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
                     {
                       switch (world.provider.dimensionId)
                       {
                       case -1:
                         generateNether(random, chunkX * 16, chunkZ * 16, world);
                         break;
                       case 0:
                         generateSurface(random, chunkX * 16, chunkZ * 16, world);
                         break;
                       case 1:
                         generateEnd(random, chunkX * 16, chunkZ * 16, world);
                         break;
                       }
                     }
                    
                     private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance)
                     {
                       for (int i = 0; i < spawnChance; i++)
                       {
                         int defaultChunkSize = 16;
                    
                         int xPos = posX + random.nextInt(defaultChunkSize);
                         int yPos = minY + random.nextInt(maxY - minY);
                         int zPos = posZ + random.nextInt(defaultChunkSize);
                    
                         new WorldGenMinable(block, minVeinSize + random.nextInt(maxVeinSize - minVeinSize), blockSpawn).func_76484_a(world, random, xPos, yPos, zPos);
                       }
                     }
                    
                     private void generateEnd(Random random, int chunkX, int chunkZ, World world) {}
                    
                     private void generateSurface(Random random, int chunkX, int chunkZ, World world)
                     {
                       addOre(Main.LockyumOre, Blocks.stone, random, world, chunkX, chunkZ, 4, 13, 3, 5, 2);
                       addOre(Main.TitaniumOre, Blocks.stone, random, world, chunkX, chunkZ, 4, 20, 4, 5, 3);
                       addOre(Main.ThoriumOre, Blocks.stone, random, world, chunkX, chunkZ, 4, 45, 4, 10, 15);
                     }
                    
                     private void generateNether(Random random, int chunkX, int chunkZ, World world) {}
                    }
                    

                    Je vien de remarquer que sur la bêta de mon mod, il y avais l’import :
                    import net.minecraft.world.WorldProvider
                    Mais la il n’est pas utilisé

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

                      As-tu testé le code de robin ?

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

                        Non j’avais pas fait attention, je vais tester

                        Edit:

                        Je viens de tester et quand je fais : /mv create test normal, ça ne génère pas les minerais 😞

                        La version de multiverse est : 2.5

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

                          Personnellement, j’ai changé ceci:
                          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
                          switch (world.provider.dimensionId) {
                          case 0:
                          generateSurface(world, random, chunkX * 16, chunkZ * 16);
                          }
                          }

                          Pour cela:
                          public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
                          if(world.provider.isSurfaceWorld()) {
                          generateSurface(world, random, chunkX * 16, chunkZ * 16);
                          }
                          }

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

                          MINECRAFT FORGE FRANCE © 2024

                          Powered by NodeBB