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

    Résolu Changer le block composant les lacs

    1.8.x
    1.8.9
    5
    28
    3884
    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.
    • E
      elx9000 dernière édition par

      Bonjour, je viens vers vous car je n’arrive à générer des lacs custom. Je m’explique, je souhaiterais changer le block d’eau qu’il y a dans la génération des lacs de Minecraft par mon propre block de liquide. J’ai essayé de faire une classe extends de WorldGenLakes mais sans succès. Donc comment faire ?

      Merci d’avance pour votre aide.

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

        Personne n’a la moindre idée ?

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

          Tu veux juste changer la couleur des fluides, ou ton block a des propriétés spéciales ? Tu veux le faire dans tous les biomes de Minecraft, ou seulement dans le tien ?
          PS: Si personne ne répond, c’est parce que tu utilises une version ancienne et très peu utilisée par les membres du forum

          Si je t'ai aidé, n'hésite pas à cliquer sur le nombre vert en dessous de mon image de profil, pour me le faire savoir. Ca me motive pour continuer …

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

            @‘Dylem’:

            Tu veux juste changer la couleur des fluides, ou ton block a des propriétés spéciales ? Tu veux le faire dans tous les biomes de Minecraft, ou seulement dans le tien ?
            PS: Si personne ne répond, c’est parce que tu utilises une version ancienne et très peu utilisée par les membres du forum

            Mon block à des propriétés spéciales et je veux le faire seulement dans mon biome.

            Merci d’avance

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

              tu vas devoir faire un BiomeGen pour ton biome, et mettre “this.fillerBlock” à (byte)tonFluide

              Si je t'ai aidé, n'hésite pas à cliquer sur le nombre vert en dessous de mon image de profil, pour me le faire savoir. Ca me motive pour continuer …

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

                J ai du mal à comprendre. Tu veux dire que je dois créer une classe extends de mon biome dans laquelle je m occupe des lacs custom avec mon liquide grâce au this.fillerblock ?

                Merci d avance

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

                  Si c’est dans ton propre biome, tu as juste à changer tout ce qui fait référence à Blocks.WATER par ton block custom, dans les classes de génération de ton biome.

                  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
                  • E
                    elx9000 dernière édition par

                    Bah en fait dans mon biome j ai besoin des deux blocs de liquides : celui de minecraft et le mien. Sauf que le mien je voudrais qu’ il apparaissent en beaucoup plus petite quantité, dans des trous de 8 blocs de long max (comme les lacs de la génération de minecraft).

                    Merci d avance.

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

                      Ah oui d’accord, bah je sais plus comment la génération d’eau marche en 1.8.9 mais je crois que ça doit être avec quelque chose du genre WorldGenLakes (recherche avec CTRL+F), mais il faut que tu copies ce qui touche à ça dans les classes de ton biome en changeant par ton liquide.

                      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
                      • E
                        elx9000 dernière édition par

                        J’ai trouvé dans biome décorator la partie générant les liquides. Donc, dans ma fonction biomeTerrain qui s’occupe de mon biome j’ai mis ceci :

                        
                        if (this.theBiomeDecorator.generateLakes == false)
                               {
                                   if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER))
                                       for (int k5 = 0; k5 < 50; ++k5)
                                       {
                                           int i10 = rand.nextInt(16)+ 8;
                                           int l13 = rand.nextInt(16) + 8;
                                           int i17 = rand.nextInt(248) + 8;
                        
                                           if (i17 > 0)
                                           {
                                               int k19 = rand.nextInt(i17);
                                               BlockPos blockpos6 = pos.add(i10, k19, l13);
                                               (new WorldGenLiquids(ModSurvivant.blockPotableWater)).generate(world, rand, blockpos6);
                                           }
                                       }
                               }
                        
                        

                        Mais le jeu crash à cet endroit, il me dit qu’il y a un souci avec pos (qui est déclaré en haut de ma class par public BlockPos pos; ). Comment faire ?

                        Merci d’avance

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

                          Ta variable pos doit être null, montres ta classe en entier ça sera plus pratique pour trouver une solution.

                          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
                          • E
                            elx9000 dernière édition par

                            Voilà :

                            
                            package com.survivant.mod.biome;
                            
                            import java.util.Random;
                            
                            import com.survivant.mod.ModSurvivant;
                            import com.survivant.mod.blocks.BlockMod;
                            import com.survivant.mod.world.WorldGenDryGrass;
                            import com.survivant.mod.world.WorldGenPieceOfRock;
                            import com.survivant.mod.world.WorldGenRock;
                            import com.survivant.mod.world.tree.WorldGenBananaTree;
                            import com.survivant.mod.world.tree.WorldGenCocoTree;
                            
                            import net.minecraft.block.Block;
                            import net.minecraft.block.BlockLeaves;
                            import net.minecraft.block.BlockOldLeaf;
                            import net.minecraft.block.BlockOldLog;
                            import net.minecraft.block.BlockPlanks;
                            import net.minecraft.block.BlockSand;
                            import net.minecraft.block.BlockTallGrass;
                            import net.minecraft.block.material.Material;
                            import net.minecraft.block.state.IBlockState;
                            import net.minecraft.client.Minecraft;
                            import net.minecraft.init.Blocks;
                            import net.minecraft.util.BlockPos;
                            import net.minecraft.world.World;
                            import net.minecraft.world.biome.BiomeDecorator;
                            import net.minecraft.world.biome.BiomeGenBase;
                            import net.minecraft.world.chunk.ChunkPrimer;
                            import net.minecraft.world.gen.feature.WorldGenAbstractTree;
                            import net.minecraft.world.gen.feature.WorldGenLakes;
                            import net.minecraft.world.gen.feature.WorldGenLiquids;
                            import net.minecraft.world.gen.feature.WorldGenMegaJungle;
                            import net.minecraft.world.gen.feature.WorldGenShrub;
                            import net.minecraft.world.gen.feature.WorldGenTallGrass;
                            import net.minecraft.world.gen.feature.WorldGenTrees;
                            import net.minecraft.world.gen.feature.WorldGenerator;
                            
                            public class BiomeSurvivant extends BiomeGenBase
                            {
                               private boolean field_150614_aC;
                               private static final IBlockState field_181620_aE = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
                               private static final IBlockState field_181621_aF = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
                               private static final IBlockState field_181622_aG = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
                            
                                public BlockPos pos;
                            
                               public BiomeSurvivant(int id)
                               {
                                   super(id);
                                   this.setBiomeName("Archipel");
                                   this.topBlock = Blocks.grass.getDefaultState();
                                   this.fillerBlock = Blocks.dirt.getDefaultState();
                                   this.spawnableCaveCreatureList.clear();
                                   this.spawnableMonsterList.clear();
                                   this.spawnableCreatureList.clear();
                                   this.setColor(5470985);
                                   this.enableRain = true;
                                   this.enableSnow = false;
                                   this.setTemperatureRainfall(0.95F, 0.9F);
                                   this.minHeight = -0.7F;
                                   this.maxHeight = 0.2F;
                                   this.theBiomeDecorator.treesPerChunk = 15;
                                   this.theBiomeDecorator.reedsPerChunk = 10;
                                   this.theBiomeDecorator.grassPerChunk = 15;
                                   this.theBiomeDecorator.generateLakes = false;
                               }      
                            
                               @Override
                               public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
                               {
                                   this.biomeTerrain(world, rand, primer, x, z, noise);
                               }
                            
                               private void biomeTerrain(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
                               {                  
                                   boolean flag = true;
                                   IBlockState iblockstate = this.topBlock;
                                   IBlockState iblockstate1 = this.fillerBlock;
                                   int k = -1;
                                   int l = (int)(noise / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
                                   int i1 = x & 15;
                                   int j1 = z & 15;
                            
                                   for(int k1 = 255; k1 >= 0; –k1)
                                   {
                                       if (k1 <= 1)
                                       {
                                           primer.setBlockState(j1, k1, i1, Blocks.bedrock.getDefaultState());
                                       }
                                       else
                                       {
                                           IBlockState iblockstate2 = primer.getBlockState(j1, k1, i1);
                            
                                           if(iblockstate2.getBlock().getMaterial() == Material.air)
                                           {
                                               k = -1;
                                           }
                                           else if(iblockstate2.getBlock() == Blocks.stone)
                                           {
                                               if(k == -1)
                                               {
                                                   if(l <= 0)
                                                   {
                                                       iblockstate = null;
                                                       iblockstate1 = Blocks.stone.getDefaultState();
                                                   }
                                                   else if(k1 >= 59 && k1 <= 64)
                                                   {
                                                       iblockstate = this.topBlock;
                                                       iblockstate1 = this.fillerBlock;
                                                   }
                            
                                                   if(k1 < 63 && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
                                                   {
                                                       if(this.getFloatTemperature(new BlockPos(x, k1, z)) < 0.15F)
                                                       {
                                                           iblockstate = Blocks.ice.getDefaultState();
                                                       }
                                                       else
                                                       {
                                                           iblockstate = Blocks.water.getDefaultState();
                                                       }
                                                   }
                                                   k = 1;
                            
                                                   if(k1 >= 62)
                                                   {
                                                       primer.setBlockState(j1, k1, i1, iblockstate);
                                                   }
                                                   else if(k1 < 56 - l)
                                                   {
                                                       iblockstate = null;
                                                       iblockstate1 = Blocks.stone.getDefaultState();
                                                       primer.setBlockState(j1, k1, i1, Blocks.sand.getDefaultState());
                                                   }
                                                   else
                                                   {
                                                       primer.setBlockState(j1, k1, i1, iblockstate1);
                                                   }
                                               }
                                               else if(k > 0)
                                               {
                                                   --k;
                                                   primer.setBlockState(j1, k1, i1, iblockstate1);
                                               }
                                           }
                                       }
                                   }
                            
                                   if (this.theBiomeDecorator.generateLakes == false)
                                   {
                                       if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER))
                                           for (int k5 = 0; k5 < 50; ++k5)
                                           {
                                               int i10 = rand.nextInt(16)+ 8;
                                               int l13 = rand.nextInt(16) + 8;
                                               int i17 = rand.nextInt(248) + 8;
                            
                                               if (i17 > 0)
                                               {
                                                   int k19 = rand.nextInt(i17);
                                                   BlockPos blockpos6 = pos.add(i10, k19, l13);
                                                   (new WorldGenLiquids(ModSurvivant.blockPotableWater)).generate(world, rand, blockpos6);
                                               }
                                          }
                                   }
                               }
                            
                               public WorldGenAbstractTree genBigTreeChance(Random rand)
                               {
                                   return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : (rand.nextInt(2) == 0 ? new WorldGenShrub(field_181620_aE, field_181622_aG) : (!this.field_150614_aC && rand.nextInt(4) == 0 ? new WorldGenMegaJungle(false, 10, 20, field_181620_aE, field_181621_aF) : (rand.nextInt(2) == 0 ? new WorldGenBananaTree(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true) : new WorldGenCocoTree(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true)))));
                               }
                            
                               public WorldGenerator getRandomWorldGenForGrass(Random rand)
                               {              
                                   return rand.nextInt(20) == 0 ? new WorldGenDryGrass() : rand.nextInt(30) == 0 ? new WorldGenPieceOfRock() : rand.nextInt(50) == 0 ? new WorldGenRock() : rand.nextInt(20) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.DEAD_BUSH) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
                               }
                            }
                            
                            

                            Merci par avance

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

                              Tu pourrais donner la nature de l’erreur ? (On n’est jamais trop sûr) NullPointerException…?

                              ÉDIT: n’hésitez pas à débugger toi même pour comprendre s’il y a un bug. Genre pos à un problème, avant l’endroit où ça plante tu fais un System.out.println avec les informations relatives de pos et tu regardes si ça un sens sinon tu essayes de remonter dans le code et de comprendre où ça bug en faisant des println 😉 sinon trouves sur internet un code ressemblant 😉 ça doit forcément exister, Google: Minecraft taVersion Modding change a biom block with mine 😉

                              >! Développeur de Altis-Life (Arma III) sur Minecraft !
                              >! Site web     : https://lemnoslife.com
                              TeamSpeak : ts.lemnoslife.com

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

                                @Benjamin Loison Sa variable pos n’est initialisée nulle part donc elle est forcément nulle.

                                @elx9000 En regardant bien, je vois que tu as modifié ce que tu as copié de BiomeDecorator, le problème c’est que tu l’as pas fait de la bonne manière ^^
                                Le code générant ton lac devrait être comme ça :

                                              for (int k5 = 0; k5 < 50; ++k5)
                                              {
                                                  int i10 = x+rand.nextInt(16)+ 8;
                                                  int l13 = z+rand.nextInt(16) + 8;
                                                  int i17 = rand.nextInt(248) + 8;
                                
                                                      (new WorldGenLiquids(ModSurvivant.blockPotableWater)).generate(world, rand, new BlockPos(i10, i17, l13));
                                             }
                                

                                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
                                • E
                                  elx9000 dernière édition par

                                  j’ai corriger en mettant ce que tu m’a proposé mais le jeu crash.

                                  D’après le rapport de crash il y aurait un souci avec la ligne :

                                  
                                  (new WorldGenLiquids(ModSurvivant.blockPotableWater)).generate(world, rand, new BlockPos(i10, i17, l13));
                                  
                                  

                                  Merci d’avance

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

                                    Il faudrait un copier/coller du rapport de crash.

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

                                      Voici (je l’ai un peu raccourcis en enlevant les parties qui étaient répétées : je ne sais pas pourquoi, le fichier de crash report est trop volumineux, il rèpète des choses en boucle) :

                                      –-- Minecraft Crash Report ----
                                      // Shall we play a game?
                                      
                                      Time: 01/08/17 16:48
                                      Description: Exception generating new chunk
                                      
                                      java.lang.StackOverflowError: Exception generating new chunk
                                      at java.security.AccessController.doPrivileged(Native Method)
                                      at java.lang.ClassLoader.checkPackageAccess(Unknown Source)
                                      at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:175)
                                      at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:129)
                                      at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:99)
                                      at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:200)
                                      at net.minecraft.world.World.getChunkFromChunkCoords(World.java:336)
                                      at net.minecraft.world.World.getChunkFromBlockCoords(World.java:328)
                                      at net.minecraft.world.World.getBlockState(World.java:889)
                                      
                                      ...
                                      
                                      -- Chunk to be generated --
                                      Details:
                                       Location: 0,1
                                       Position hash: 4294967296
                                       Generator: RandomLevelSource
                                      -- Chunk to be generated --
                                      Details:
                                       Location: 1,0
                                       Position hash: 1
                                       Generator: RandomLevelSource
                                      
                                      ...
                                      
                                      -- Affected level --
                                      Details:
                                       Level name: Nouveau monde
                                       All players: 0 total; []
                                       Chunk stats: ServerChunkCache: 0 Drop: 0
                                       Level seed: -8297002036001858812
                                       Level generator: ID 00 - default, ver 1\. Features enabled: true
                                       Level generator options:
                                       Level spawn location: 0,00,0,00,0,00 - World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
                                       Level time: 0 game time, 0 day time
                                       Level dimension: 0
                                       Level storage version: 0x04ABD - Anvil
                                       Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
                                       Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
                                      -- System Details --
                                      Details:
                                       Minecraft Version: 1.8.9
                                       Operating System: Windows 8.1 (amd64) version 6.3
                                       Java Version: 1.8.0_121, Oracle Corporation
                                       Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                       Memory: 779675288 bytes (743 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
                                       JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                       IntCache: cache: 0, tcache: 1, allocated: 0, tallocated: 0
                                       FML: MCP 9.19 Powered by Forge 11.15.1.1747 4 mods loaded, 4 mods active
                                       States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
                                       UCHIJAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
                                       UCHIJAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1747.jar)
                                       UCHIJAA Forge{11.15.1.1747} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1747.jar)
                                       UCHIJAA survivant{1.0.0} [Mod Survivant] (bin)
                                       Loaded coremods (and transformers):
                                       GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
                                       Profiler Position: N/A (disabled)
                                       Player Count: 0 / 8; []
                                       Type: Integrated Server (map_client.txt)
                                       Is Modded: Definitely; Client brand changed to 'fml,forge'
                                      

                                      Merci d’avance

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

                                        Pas d’idée ?

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

                                          Il faudrait le crash complet car il n’y a pas de trace de ton mod dans le stacktrace 😕

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

                                            Voici à ce lien tout ce qu’à écrit la console :

                                            https://pastebin.com/ZR8u19GY

                                            Et voici la classe du biome :

                                            
                                            package com.survivant.mod.biome;
                                            
                                            import java.util.Random;
                                            
                                            import com.survivant.mod.ModSurvivant;
                                            import com.survivant.mod.blocks.BlockMod;
                                            import com.survivant.mod.world.WorldGenDryGrass;
                                            import com.survivant.mod.world.WorldGenPieceOfRock;
                                            import com.survivant.mod.world.WorldGenRock;
                                            import com.survivant.mod.world.tree.WorldGenBananaTree;
                                            import com.survivant.mod.world.tree.WorldGenCocoTree;
                                            
                                            import net.minecraft.block.Block;
                                            import net.minecraft.block.BlockLeaves;
                                            import net.minecraft.block.BlockOldLeaf;
                                            import net.minecraft.block.BlockOldLog;
                                            import net.minecraft.block.BlockPlanks;
                                            import net.minecraft.block.BlockSand;
                                            import net.minecraft.block.BlockTallGrass;
                                            import net.minecraft.block.material.Material;
                                            import net.minecraft.block.state.IBlockState;
                                            import net.minecraft.client.Minecraft;
                                            import net.minecraft.init.Blocks;
                                            import net.minecraft.util.BlockPos;
                                            import net.minecraft.world.World;
                                            import net.minecraft.world.biome.BiomeDecorator;
                                            import net.minecraft.world.biome.BiomeGenBase;
                                            import net.minecraft.world.chunk.ChunkPrimer;
                                            import net.minecraft.world.gen.feature.WorldGenAbstractTree;
                                            import net.minecraft.world.gen.feature.WorldGenLakes;
                                            import net.minecraft.world.gen.feature.WorldGenLiquids;
                                            import net.minecraft.world.gen.feature.WorldGenMegaJungle;
                                            import net.minecraft.world.gen.feature.WorldGenShrub;
                                            import net.minecraft.world.gen.feature.WorldGenTallGrass;
                                            import net.minecraft.world.gen.feature.WorldGenTrees;
                                            import net.minecraft.world.gen.feature.WorldGenerator;
                                            
                                            public class BiomeSurvivant extends BiomeGenBase
                                            {
                                               private boolean field_150614_aC;
                                               private static final IBlockState field_181620_aE = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
                                               private static final IBlockState field_181621_aF = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
                                               private static final IBlockState field_181622_aG = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
                                            
                                               public BiomeSurvivant(int id)
                                               {
                                                   super(id);
                                                   this.setBiomeName("Archipel");
                                                   this.topBlock = Blocks.grass.getDefaultState();
                                                   this.fillerBlock = Blocks.dirt.getDefaultState();
                                                   this.spawnableCaveCreatureList.clear();
                                                   this.spawnableMonsterList.clear();
                                                   this.spawnableCreatureList.clear();
                                                   this.setColor(5470985);
                                                   this.enableRain = true;
                                                   this.enableSnow = false;
                                                   this.setTemperatureRainfall(0.95F, 0.9F);
                                                   this.minHeight = -0.7F;
                                                   this.maxHeight = 0.2F;
                                                   this.theBiomeDecorator.treesPerChunk = 15;
                                                   this.theBiomeDecorator.reedsPerChunk = 10;
                                                   this.theBiomeDecorator.grassPerChunk = 15;
                                                   this.theBiomeDecorator.generateLakes = false;
                                               }      
                                            
                                               @Override
                                               public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
                                               {
                                                   this.biomeTerrain(world, rand, primer, x, z, noise);
                                               }
                                            
                                               private void biomeTerrain(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
                                               {                  
                                                   boolean flag = true;
                                                   IBlockState iblockstate = this.topBlock;
                                                   IBlockState iblockstate1 = this.fillerBlock;
                                                   int k = -1;
                                                   int l = (int)(noise / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
                                                   int i1 = x & 15;
                                                   int j1 = z & 15;
                                            
                                                   for(int k1 = 255; k1 >= 0; –k1)
                                                   {
                                                       if (k1 <= 1)
                                                       {
                                                           primer.setBlockState(j1, k1, i1, Blocks.bedrock.getDefaultState());
                                                       }
                                                       else
                                                       {
                                                           IBlockState iblockstate2 = primer.getBlockState(j1, k1, i1);
                                            
                                                           if(iblockstate2.getBlock().getMaterial() == Material.air)
                                                           {
                                                               k = -1;
                                                           }
                                                           else if(iblockstate2.getBlock() == Blocks.stone)
                                                           {
                                                               if(k == -1)
                                                               {
                                                                   if(l <= 0)
                                                                   {
                                                                       iblockstate = null;
                                                                       iblockstate1 = Blocks.stone.getDefaultState();
                                                                   }
                                                                   else if(k1 >= 59 && k1 <= 64)
                                                                   {
                                                                       iblockstate = this.topBlock;
                                                                       iblockstate1 = this.fillerBlock;
                                                                   }
                                            
                                                                   if(k1 < 63 && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
                                                                   {
                                                                       if(this.getFloatTemperature(new BlockPos(x, k1, z)) < 0.15F)
                                                                       {
                                                                           iblockstate = Blocks.ice.getDefaultState();
                                                                       }
                                                                       else
                                                                       {
                                                                           iblockstate = Blocks.water.getDefaultState();
                                                                       }
                                                                   }
                                                                   k = 1;
                                            
                                                                   if(k1 >= 62)
                                                                   {
                                                                       primer.setBlockState(j1, k1, i1, iblockstate);
                                                                   }
                                                                   else if(k1 < 56 - l)
                                                                   {
                                                                       iblockstate = null;
                                                                       iblockstate1 = Blocks.stone.getDefaultState();
                                                                       primer.setBlockState(j1, k1, i1, Blocks.sand.getDefaultState());
                                                                   }
                                                                   else
                                                                   {
                                                                       primer.setBlockState(j1, k1, i1, iblockstate1);
                                                                   }
                                                               }
                                                               else if(k > 0)
                                                               {
                                                                   --k;
                                                                   primer.setBlockState(j1, k1, i1, iblockstate1);
                                                               }
                                                           }
                                                       }
                                                   }
                                            
                                                   if (this.theBiomeDecorator.generateLakes == false)
                                                   {
                                                           for (int k5 = 0; k5 < 50; ++k5)
                                                           {
                                                               int i10 = rand.nextInt(16)+ 8;
                                                               int l13 = rand.nextInt(16) + 8;
                                                               int i17 = rand.nextInt(248) + 8;
                                            
                                                              (new WorldGenLiquids(ModSurvivant.blockPotableWater)).generate(world, rand, new BlockPos(i10, i17, l13));
                                                          }
                                                   }
                                               }
                                            
                                               public WorldGenAbstractTree genBigTreeChance(Random rand)
                                               {
                                                   return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : (rand.nextInt(2) == 0 ? new WorldGenShrub(field_181620_aE, field_181622_aG) : (!this.field_150614_aC && rand.nextInt(4) == 0 ? new WorldGenMegaJungle(false, 10, 20, field_181620_aE, field_181621_aF) : (rand.nextInt(2) == 0 ? new WorldGenBananaTree(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true) : new WorldGenCocoTree(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true)))));
                                               }
                                            
                                               public WorldGenerator getRandomWorldGenForGrass(Random rand)
                                               {              
                                                   return rand.nextInt(20) == 0 ? new WorldGenDryGrass() : rand.nextInt(30) == 0 ? new WorldGenPieceOfRock() : rand.nextInt(50) == 0 ? new WorldGenRock() : rand.nextInt(20) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.DEAD_BUSH) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
                                               }
                                            }
                                            
                                            

                                            Merci d’avance

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

                                            MINECRAFT FORGE FRANCE © 2018

                                            Powered by NodeBB