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

Ajouter une nouvelle dimension

La génération & les dimensions
1.7.10
11
101
33.8k
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.
  • SCAREX
    SCAREX dernière édition par 1 août 2015, 17:12

    Il faut enregistrer les provider avant la dimension.

    PS : quand tu donnes un crash report, penses à donner tes classes en entier (avec les imports etc.) sinon le crash report est faussé car on a pas la bonne ligne.

    Site web contenant mes scripts : http://SCAREXgaming.github.io

    Pas de demandes de support par MP ni par skype SVP.
    Je n'accepte sur skype que l…

    1 réponse Dernière réponse Répondre Citer 0
    • KingSlime
      KingSlime dernière édition par 1 août 2015, 18:18

      @‘SCAREX’:

      Il faut enregistrer les provider avant la dimension.

      PS : quand tu donnes un crash report, penses à donner tes classes en entier (avec les imports etc.) sinon le crash report est faussé car on a pas la bonne ligne.

      Merci, ça ne crash plus désolée pour n’avoir pas donner mes classes en entier et que ça sois une erreur toute bête, sinon même si ça ne crash plus ma dimension ne semble toujours pas marché.

      1 réponse Dernière réponse Répondre Citer 0
      • Diangle
        Diangle dernière édition par 1 août 2015, 18:44

        je vais (pense) faire un tuto pour montrer comment passer une dimension en 1.8 ^^

        1 réponse Dernière réponse Répondre Citer 0
        • KingSlime
          KingSlime dernière édition par 1 août 2015, 19:08

          @‘Diangle’:

          je vais (pense) faire un tuto pour montrer comment passer une dimension en 1.8 ^^

          A part l’histoire des getBlock il y a pas beaucoup de choses à modifier je pense.

          1 réponse Dernière réponse Répondre Citer 0
          • SCAREX
            SCAREX dernière édition par 1 août 2015, 21:14

            Pense aussi à mettre les @override, car certains paramètres ont changé (comme les coordonnées x,y,z devenu BlockPos).

            Site web contenant mes scripts : http://SCAREXgaming.github.io

            Pas de demandes de support par MP ni par skype SVP.
            Je n'accepte sur skype que l…

            1 réponse Dernière réponse Répondre Citer 0
            • Diangle
              Diangle dernière édition par 1 août 2015, 21:21

              @‘KingSlime’:

              @‘Diangle’:

              je vais (pense) faire un tuto pour montrer comment passer une dimension en 1.8 ^^

              A part l’histoire des getBlock il y a pas beaucoup de choses à modifier je pense.

              Il y a pas mal de chose qui on changer. C’est pour ça que je compte montrer comment passer de 1.7 à 1.8 :P.

              1 réponse Dernière réponse Répondre Citer 0
              • Flow
                Flow dernière édition par 1 août 2015, 22:34

                WorldProvider

                package mod.common.world.type;
                import cpw.mods.fml.relauncher.Side;
                import cpw.mods.fml.relauncher.SideOnly;
                import mod.common.world.structure.DimensionRegister;
                import net.minecraft.entity.Entity;
                import net.minecraft.init.Blocks;
                import net.minecraft.util.Vec3;
                import net.minecraft.world.WorldProvider;
                public class AncientWorldProvider extends WorldProvider
                {
                public void registerWorldChunkManager()
                {
                this.worldChunkMgr = new AncientWorldChunkManager(worldObj.getSeed(), terrainType);
                this.dimensionId = DimensionRegister.tutoDimAncient4;
                }
                public String getDimensionName()
                {
                return "Ancient World";
                }
                public String getSaveFolder()
                {
                return "AncientWorld";
                }
                public boolean canRespawnHere()
                {
                return true;
                }
                public boolean getWorldHasVoidParticles()
                {
                return true;
                }
                public int getHeight()
                {
                return 256;
                }
                public boolean canCoordinateBeSpawn(int par1, int par2)
                {
                return this.worldObj.getTopBlock(par1, par2) == Blocks.grass;
                }
                protected void generateLightBrightnessTable()
                {
                float f = 0.2F;
                for(int i = 0; i <= 15; ++i)
                {
                float f1 = 1.0F - (float)i / 15.0F;
                this.lightBrightnessTable* = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
                }
                }
                public float calculateCelestialAngle(long par1, float par2)
                {
                int j = (int)(par1 % 24000L);
                float f1 = ((float)j + par2) / 24000.0F - 0.25F;
                if(f1 < 0.0F)
                {
                ++f1;
                }
                if(f1 > 1.0F)
                {
                –f1;
                }
                float f2 = f1;
                f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D);
                f1 = f2 + (f1 - f2) / 3.0F;
                return f1;
                }
                public int getMoonPhase(long par1)
                {
                return (int)(par1 / 24000L % 8L + 8L) % 8;
                }
                public String getWelcomeMessage()
                {
                if(this instanceof AncientWorldProvider)
                {
                return "Entering the Ancient Dimension";
                }
                return null;
                }
                public String getDepartMessage()
                {
                if(this instanceof AncientWorldProvider)
                {
                return "Leaving the Ancient Dimension";
                }
                return null;
                }
                @SideOnly(Side.CLIENT)
                public boolean isSkyColored()
                {
                return true;
                }
                @Override
                public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
                { //à modifier pour changer la couleur
                return Vec3.createVectorHelper(2.8, 1.1, 1.7);
                }
                }

                Pareil désolé de mon absence appendicite aigue , presque péritonite pas la joie 😞

                Oui ce gif est drôle.

                1 réponse Dernière réponse Répondre Citer 0
                • Diangle
                  Diangle dernière édition par 1 août 2015, 22:43

                  il y a pas l’ai d’avoir d’erreur ici, regarde dans tes autres classe si tu utilise le WorldChunkManager.

                  1 réponse Dernière réponse Répondre Citer 0
                  • Flow
                    Flow dernière édition par 1 août 2015, 23:25

                    Ligne 114 et 220 dans AncientChunkProvider :

                    package mod.common.world.type;
                    import cpw.mods.fml.relauncher.Side;
                    import cpw.mods.fml.relauncher.SideOnly;
                    import mod.common.world.structure.DimensionRegister;
                    import net.minecraft.entity.Entity;
                    import net.minecraft.init.Blocks;
                    import net.minecraft.util.Vec3;
                    import net.minecraft.world.WorldProvider;
                    public class AncientWorldProvider extends WorldProvider
                    {
                    public void registerWorldChunkManager()
                    {
                    this.worldChunkMgr = new AncientWorldChunkManager(worldObj.getSeed(), terrainType);
                    this.dimensionId = DimensionRegister.tutoDimAncient4;
                    }
                    public String getDimensionName()
                    {
                    return "Ancient World";
                    }
                    public String getSaveFolder()
                    {
                    return "AncientWorld";
                    }
                    public boolean canRespawnHere()
                    {
                    return true;
                    }
                    public boolean getWorldHasVoidParticles()
                    {
                    return true;
                    }
                    public int getHeight()
                    {
                    return 256;
                    }
                    public boolean canCoordinateBeSpawn(int par1, int par2)
                    {
                    return this.worldObj.getTopBlock(par1, par2) == Blocks.grass;
                    }
                    protected void generateLightBrightnessTable()
                    {
                    float f = 0.2F;
                    for(int i = 0; i <= 15; ++i)
                    {
                    float f1 = 1.0F - (float)i / 15.0F;
                    this.lightBrightnessTable* = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
                    }
                    }
                    public float calculateCelestialAngle(long par1, float par2)
                    {
                    int j = (int)(par1 % 24000L);
                    float f1 = ((float)j + par2) / 24000.0F - 0.25F;
                    if(f1 < 0.0F)
                    {
                    ++f1;
                    }
                    if(f1 > 1.0F)
                    {
                    –f1;
                    }
                    float f2 = f1;
                    f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D);
                    f1 = f2 + (f1 - f2) / 3.0F;
                    return f1;
                    }
                    public int getMoonPhase(long par1)
                    {
                    return (int)(par1 / 24000L % 8L + 8L) % 8;
                    }
                    public String getWelcomeMessage()
                    {
                    if(this instanceof AncientWorldProvider)
                    {
                    return "Entering the Ancient Dimension";
                    }
                    return null;
                    }
                    public String getDepartMessage()
                    {
                    if(this instanceof AncientWorldProvider)
                    {
                    return "Leaving the Ancient Dimension";
                    }
                    return null;
                    }
                    @SideOnly(Side.CLIENT)
                    public boolean isSkyColored()
                    {
                    return true;
                    }
                    @Override
                    public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
                    { //à modifier pour changer la couleur
                    return Vec3.createVectorHelper(2.8, 1.1, 1.7);
                    }
                    }

                    Dans la classe WorldChunkManager du coup x) :

                    package mod.common.world.type;
                    import java.util.ArrayList;
                    import java.util.Arrays;
                    import java.util.List;
                    import java.util.Random;
                    import cpw.mods.fml.relauncher.Side;
                    import cpw.mods.fml.relauncher.SideOnly;
                    import mod.common.world.biome.BiomeRegister;
                    import mod.common.world.generator.AncientGenLayer;
                    import net.minecraft.world.ChunkPosition;
                    import net.minecraft.world.World;
                    import net.minecraft.world.WorldType;
                    import net.minecraft.world.biome.BiomeCache;
                    import net.minecraft.world.biome.BiomeGenBase;
                    import net.minecraft.world.biome.WorldChunkManager;
                    import net.minecraft.world.gen.layer.GenLayer;
                    import net.minecraft.world.gen.layer.IntCache;
                    public class AncientWorldChunkManager extends WorldChunkManager
                    {
                    /**
                    * GenLayer = classe de GenLayer si vous utiliser un GenLayer qui n’hérite
                    * pas de la classe GenLayer alors il faut changer par votre classe
                    */
                    private GenLayer genBiomes;
                    private GenLayer biomeIndexLayer;
                    /** L'objet du BiomeCache pour le monde */
                    private BiomeCache biomeCache;
                    /** List des biome ou le joueur peu spawn */
                    private List <biomegenbase>biomesToSpawnIn;
                    protected AncientWorldChunkManager()
                    {
                    this.biomeCache = new BiomeCache(this);
                    // liste des biomes ou nous spawons
                    this.biomesToSpawnIn = new ArrayList<biomegenbase>();
                    // Ce biome n'est pas le biome ou vous spawner forcement, mais dans
                    // toute les classes il devra être mis
                    this.biomesToSpawnIn.add(BiomeGenBase.savanna);
                    }
                    public AncientWorldChunkManager(long par1, WorldType worldType)
                    {
                    this();
                    /**
                    * Appele la fonction makeTheWorld dans la classe TutoGenLayer, la
                    * fonction est la fonction de génération de nos biome
                    */
                    GenLayer[] agenlayer = AncientGenLayer.makeTheWorld(par1);
                    this.genBiomes = agenlayer[0];
                    this.biomeIndexLayer = agenlayer[1];
                    }
                    public AncientWorldChunkManager(World world)
                    {
                    this(world.getSeed(), world.provider.terrainType);
                    }
                    /** Permet d'obtenir la list des biomes ou le joueur peut apparaitre */
                    public List <biomegenbase>getBiomesToSpawnIn()
                    {
                    return this.biomesToSpawnIn;
                    }
                    /** Renvoie au BiomeGenBase a la position x, z relative dans le monde */
                    public BiomeGenBase getBiomeGenAt(int x, int z)
                    {
                    BiomeGenBase biome = this.biomeCache.getBiomeGenAt(x, z);
                    if(biome == null)
                    {
                    return BiomeGenBase.savanna;
                    }
                    return biome;
                    }
                    /**
                    * Retourne a la list des valeurs pour la pluis… ... pour en fonction de
                    * blocs spésifier
                    */
                    public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
                    {
                    if(par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
                    {
                    par1ArrayOfFloat = new float[par4 * par5];
                    }
                    Arrays.fill(par1ArrayOfFloat, 0, par4 * par5, 0.0F);
                    return par1ArrayOfFloat;
                    }
                    /** Retourne a une température donner par raport au y */
                    @SideOnly(Side.CLIENT)
                    public float getTemperatureAtHeight(float par1, int par2)
                    {
                    return par1;
                    }
                    /** Retourne à un tableau pour les biomes a générer */
                    public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
                    {
                    IntCache.resetIntCache();
                    if(par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
                    {
                    par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
                    }
                    int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
                    for(int i = 0; i < par4 * par5; ++i)
                    {
                    if(aint* >= 0)
                    {
                    par1ArrayOfBiomeGenBase* = BiomeGenBase.getBiome(aint*);
                    }
                    else
                    {
                    par1ArrayOfBiomeGenBase* = BiomeGenBase.forest;
                    }
                    }
                    return par1ArrayOfBiomeGenBase;
                    }
                    /** Retourne au biome et charge les données pour les blocs */
                    public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
                    {
                    return this.getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true);
                    }
                    /**
                    * Retourne a une liste de biome pour les blocs spécifiés argument : x, y,
                    * largeur, longueur, cache.
                    */
                    public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] arrayOfBiomeGenBase, int x, int y, int width, int length, boolean cacheFlag)
                    {
                    if(arrayOfBiomeGenBase == null || arrayOfBiomeGenBase.length < width * length)
                    {
                    arrayOfBiomeGenBase = new BiomeGenBase[width * length];
                    }
                    if(cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0)
                    {
                    BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
                    System.arraycopy(abiomegenbase1, 0, arrayOfBiomeGenBase, 0, width * length);
                    return arrayOfBiomeGenBase;
                    }
                    else
                    {
                    int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
                    for(int i1 = 0; i1 < width * length; ++i1)
                    {
                    if(aint[i1] >= 0)
                    {
                    arrayOfBiomeGenBase[i1] = BiomeGenBase.getBiome(aint[i1]);
                    }
                    else
                    {
                    arrayOfBiomeGenBase[i1] = BiomeGenBase.forest;
                    }
                    }
                    return arrayOfBiomeGenBase;
                    }
                    }
                    /** Verifie les données du chunk */
                    public boolean areBiomesViable(int x, int y, int z, List par4List)
                    {
                    IntCache.resetIntCache();
                    int l = x - z >> 2;
                    int i1 = y - z >> 2;
                    int j1 = x + z >> 2;
                    int k1 = y + z >> 2;
                    int l1 = j1 - l + 1;
                    int i2 = k1 - i1 + 1;
                    int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
                    for(int j2 = 0; j2 < l1 * i2; ++j2)
                    {
                    BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
                    if(!par4List.contains(biomegenbase))
                    {
                    return false;
                    }
                    }
                    return true;
                    }
                    /** Supprime le biome dans les 30s. si il n'est pas vérifier dans la temps */
                    public void cleanupCache()
                    {
                    this.biomeCache.cleanupCache();
                    }
                    }

                    Ligne 13 et 15 dans AncientWorldProvider :

                    package mod.common.world.type;
                    import cpw.mods.fml.relauncher.Side;
                    import cpw.mods.fml.relauncher.SideOnly;
                    import mod.common.world.structure.DimensionRegister;
                    import net.minecraft.entity.Entity;
                    import net.minecraft.init.Blocks;
                    import net.minecraft.util.Vec3;
                    import net.minecraft.world.WorldProvider;
                    public class AncientWorldProvider extends WorldProvider
                    {
                    public void registerWorldChunkManager()
                    {
                    this.worldChunkMgr = new AncientWorldChunkManager(worldObj.getSeed(), terrainType);
                    this.dimensionId = DimensionRegister.tutoDimAncient4;
                    }
                    public String getDimensionName()
                    {
                    return "Ancient World";
                    }
                    public String getSaveFolder()
                    {
                    return "AncientWorld";
                    }
                    public boolean canRespawnHere()
                    {
                    return true;
                    }
                    public boolean getWorldHasVoidParticles()
                    {
                    return true;
                    }
                    public int getHeight()
                    {
                    return 256;
                    }
                    public boolean canCoordinateBeSpawn(int par1, int par2)
                    {
                    return this.worldObj.getTopBlock(par1, par2) == Blocks.grass;
                    }
                    protected void generateLightBrightnessTable()
                    {
                    float f = 0.2F;
                    for(int i = 0; i <= 15; ++i)
                    {
                    float f1 = 1.0F - (float)i / 15.0F;
                    this.lightBrightnessTable* = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
                    }
                    }
                    public float calculateCelestialAngle(long par1, float par2)
                    {
                    int j = (int)(par1 % 24000L);
                    float f1 = ((float)j + par2) / 24000.0F - 0.25F;
                    if(f1 < 0.0F)
                    {
                    ++f1;
                    }
                    if(f1 > 1.0F)
                    {
                    –f1;
                    }
                    float f2 = f1;
                    f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D);
                    f1 = f2 + (f1 - f2) / 3.0F;
                    return f1;
                    }
                    public int getMoonPhase(long par1)
                    {
                    return (int)(par1 / 24000L % 8L + 8L) % 8;
                    }
                    public String getWelcomeMessage()
                    {
                    if(this instanceof AncientWorldProvider)
                    {
                    return "Entering the Ancient Dimension";
                    }
                    return null;
                    }
                    public String getDepartMessage()
                    {
                    if(this instanceof AncientWorldProvider)
                    {
                    return "Leaving the Ancient Dimension";
                    }
                    return null;
                    }
                    @SideOnly(Side.CLIENT)
                    public boolean isSkyColored()
                    {
                    return true;
                    }
                    @Override
                    public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
                    { //à modifier pour changer la couleur
                    return Vec3.createVectorHelper(2.8, 1.1, 1.7);
                    }
                    }

                    J’ai rien trouver d’autre et je vois pas d’erreur…</biomegenbase></biomegenbase></biomegenbase>

                    Oui ce gif est drôle.

                    1 réponse Dernière réponse Répondre Citer 0
                    • Diangle
                      Diangle dernière édition par 2 août 2015, 09:24

                      tu t’es tromper de classe :D, tu pourrais envoyer le ChunkProvider ?

                      1 réponse Dernière réponse Répondre Citer 0
                      • Flow
                        Flow dernière édition par 2 août 2015, 11:19

                        package mod.common.world.type;
                        import java.util.List;
                        import java.util.Random;
                        import mod.common.world.biome.AncientBiome;
                        import net.minecraft.block.Block;
                        import net.minecraft.block.BlockFalling;
                        import net.minecraft.entity.EnumCreatureType;
                        import net.minecraft.init.Blocks;
                        import net.minecraft.util.MathHelper;
                        import net.minecraft.world.ChunkPosition;
                        import net.minecraft.world.SpawnerAnimals;
                        import net.minecraft.world.World;
                        import net.minecraft.world.WorldType;
                        import net.minecraft.world.biome.BiomeGenBase;
                        import net.minecraft.world.biome.BiomeGenPlains;
                        import net.minecraft.world.chunk.Chunk;
                        import net.minecraft.world.chunk.IChunkProvider;
                        import net.minecraft.world.gen.MapGenBase;
                        import net.minecraft.world.gen.MapGenCaves;
                        import net.minecraft.world.gen.MapGenRavine;
                        import net.minecraft.world.gen.NoiseGenerator;
                        import net.minecraft.world.gen.NoiseGeneratorOctaves;
                        import net.minecraft.world.gen.NoiseGeneratorPerlin;
                        import net.minecraft.world.gen.feature.WorldGenDungeons;
                        import net.minecraft.world.gen.feature.WorldGenLakes;
                        import net.minecraft.world.gen.structure.MapGenMineshaft;
                        import net.minecraft.world.gen.structure.MapGenScatteredFeature;
                        import net.minecraftforge.common.MinecraftForge;
                        import net.minecraftforge.event.terraingen.ChunkProviderEvent;
                        import net.minecraftforge.event.terraingen.PopulateChunkEvent;
                        import net.minecraftforge.event.terraingen.TerrainGen;
                        import cpw.mods.fml.common.eventhandler.Event.Result;
                        import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*;
                        import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
                        public abstract class AncientChunkProvider implements IChunkProvider {
                        private Random rand;
                        private NoiseGeneratorOctaves noiseGen1;//les noises
                        private NoiseGeneratorOctaves noiseGen2;
                        private NoiseGeneratorOctaves noiseGen3;
                        private NoiseGeneratorPerlin noiseGen4;
                        public NoiseGeneratorOctaves noiseGen5;
                        public NoiseGeneratorOctaves noiseGen6;
                        public NoiseGeneratorOctaves mobSpawnerNoise;
                        private World worldObj;
                        private WorldType worldType;
                        private final double[] noiseArray;
                        private final float[] parabolicField;
                        private final boolean mapFeaturesEnabled;
                        private MapGenBase caveGenerator = new MapGenCaves();//la génération des caves, remplacer par votre ravin si vous utiliser une autre stone
                        private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();//la génération des mineshaft, "" "" ""
                        private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
                        private MapGenBase ravineGenerator = new MapGenRavine();//la structure du ravin, "" "" ""
                        private double[] stoneNoise = new double[256];
                        private BiomeGenBase[] biomesForGeneration;
                        double[] noiseData1; //les noises data
                        double[] noiseData2;
                        double[] noiseData3;
                        double[] noiseData4;
                        {
                        caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
                        mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT);
                        scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE);
                        ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE);
                        }
                        public AncientChunkProvider(World world, long seed, boolean features)
                        {
                        this.worldObj = world;
                        this.mapFeaturesEnabled = features;
                        this.worldType = world.getWorldInfo().getTerrainType();
                        this.rand = new Random(seed);
                        this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
                        this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
                        this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
                        this.noiseGen4 = new NoiseGeneratorPerlin(this.rand, 4);
                        this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
                        this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
                        this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
                        this.noiseArray = new double[825];
                        this.parabolicField = new float[25];
                        for (int j = -2; j <= 2; ++j)
                        {
                        for (int k = -2; k <= 2; ++k)
                        {
                        float f = 10.0F / MathHelper.sqrt_float((float)(j * j + k * k) + 0.2F);
                        this.parabolicField[j + 2 + (k + 2) * 5] = f;
                        }
                        }
                        NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
                        noiseGens = TerrainGen.getModdedNoiseGenerators(world, this.rand, noiseGens);
                        this.noiseGen1 = (NoiseGeneratorOctaves)noiseGens[0];
                        this.noiseGen2 = (NoiseGeneratorOctaves)noiseGens[1];
                        this.noiseGen3 = (NoiseGeneratorOctaves)noiseGens[2];
                        this.noiseGen4 = (NoiseGeneratorPerlin)noiseGens[3];
                        this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4];
                        this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5];
                        this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6];
                        }
                        public void func_147424_a(int Xchunks, int Zchunks, Block[] topBlock)
                        {
                        byte b0 = 63;
                        this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, Xchunks * 4 - 2, Zchunks * 4 - 2, 10, 10);
                        this.func_147423_a(Xchunks * 4, 0, Zchunks * 4);
                        final Random rand = new Random();
                        for (int k = 0; k < 4; ++k)
                        {
                        int l = k * 5;
                        int i1 = (k + 1) * 5;
                        for (int j1 = 0; j1 < 4; ++j1)
                        {
                        int k1 = (l + j1) * 33;
                        int l1 = (l + j1 + 1) * 33;
                        int i2 = (i1 + j1) * 33;
                        int j2 = (i1 + j1 + 1) * 33;
                        for (int k2 = 0; k2 < 32; ++k2)
                        {
                        double d0 = 0.105D;
                        double d1 = this.noiseArray[k1 + k2];
                        double d2 = this.noiseArray[l1 + k2];
                        double d3 = this.noiseArray[i2 + k2];
                        double d4 = this.noiseArray[j2 + k2];
                        double d5 = (this.noiseArray[k1 + k2 + 1] - d1) * d0;
                        double d6 = (this.noiseArray[l1 + k2 + 1] - d2) * d0;
                        double d7 = (this.noiseArray[i2 + k2 + 1] - d3) * d0;
                        double d8 = (this.noiseArray[j2 + k2 + 1] - d4) * d0;
                        for (int l2 = 0; l2 < 8; ++l2)
                        {
                        double d9 = 0.25D;
                        double d10 = d1;
                        double d11 = d2;
                        double d12 = (d3 - d1) * d9;
                        double d13 = (d4 - d2) * d9;
                        for (int i3 = 0; i3 < 4; ++i3)
                        {
                        int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
                        short short1 = 256;
                        j3 -= short1;
                        double d14 = 0.25D;
                        double d16 = (d11 - d10) * d14;
                        double d15 = d10 - d16;
                        for (int k3 = 0; k3 < 4; ++k3)
                        {
                        if ((d15 += d16) > 0.0D)
                        {
                        topBlock[j3 += short1] = Blocks.stone;
                        }
                        else if (k2 * 8 + l2 < b0)
                        {
                        topBlock[j3 += short1] = Blocks.water;
                        }
                        else
                        {
                        topBlock[j3 += short1] = null;
                        }
                        }
                        d10 += d12;
                        d11 += d13;
                        }
                        d1 += d5;
                        d2 += d6;
                        d3 += d7;
                        d4 += d8;
                        }
                        }
                        }
                        }
                        }
                        public void replaceBlocksForBiome(int coordX, int coordZ, Block[] block, byte[] arrayOfByte, BiomeGenBase[] biomeList)
                        {
                        ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, coordX, coordZ, block, biomeList);
                        MinecraftForge.EVENT_BUS.post(event);
                        if (event.getResult() == Result.DENY) return;
                        double d0 = 0.03125D;
                        this.stoneNoise = this.noiseGen4.func_151599_a(this.stoneNoise, (double)(coordX * 16), (double)(coordZ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
                        for (int k = 0; k < 16; ++k)
                        {
                        for (int l = 0; l < 16; ++l)
                        {
                        AncientBiome biomegenbase = (AncientBiome /*TODO ce biome est a remplacer par le votre*/)biomeList[l + k * 16];
                        biomegenbase.genTerrainBlocks(this.worldObj, this.rand, block, arrayOfByte, coordX * 16 + k, coordZ * 16 + l, this.stoneNoise[l + k * 16]);
                        }
                        }
                        }
                        public Chunk loadChunk(int par1, int par2)
                        {
                        return this.provideChunk(par1, par2);
                        }
                        public Chunk provideChunk(int par1, int par2)
                        {
                        this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
                        Block[] ablock = new Block[65536];
                        byte[] abyte = new byte[65536];
                        this.func_147424_a(par1, par2, ablock);
                        this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
                        this.replaceBlocksForBiome(par1, par2, ablock, abyte, this.biomesForGeneration);
                        this.caveGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);
                        this.ravineGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);
                        if (this.mapFeaturesEnabled)
                        {
                        this.mineshaftGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);
                        this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);
                        }
                        Chunk chunk = new Chunk(this.worldObj, ablock, abyte, par1, par2);
                        byte[] abyte1 = chunk.getBiomeArray();
                        for (int k = 0; k < abyte1.length; ++k)
                        {
                        abyte1[k] = (byte)this.biomesForGeneration[k].biomeID;
                        }
                        chunk.generateSkylightMap();
                        return chunk;
                        }
                        private void func_147423_a(int x, int y, int z)
                        {
                        double d0 = 684.412D;
                        double d1 = 684.412D;
                        double d2 = 512.0D;
                        double d3 = 512.0D;
                        this.noiseData4 = this.noiseGen6.generateNoiseOctaves(this.noiseData4, x, z, 5, 5, 200.0D, 200.0D, 0.5D);
                        this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, x, y, z, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D);
                        this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
                        this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
                        boolean flag1 = false;
                        boolean flag = false;
                        int l = 0;
                        int i1 = 0;
                        double d4 = 8.5D;
                        for (int j1 = 0; j1 < 5; ++j1)
                        {
                        for (int k1 = 0; k1 < 5; ++k1)
                        {
                        float f = 0.0F;
                        float f1 = 0.0F;
                        float f2 = 0.0F;
                        byte b0 = 2;
                        BiomeGenBase biomegenbase = this.biomesForGeneration[j1 + 2 + (k1 + 2) * 10];
                        for (int l1 = -b0; l1 <= b0; ++l1)
                        {
                        for (int i2 = -b0; i2 <= b0; ++i2)
                        {
                        BiomeGenBase biomegenbase1 = this.biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10];
                        float f3 = biomegenbase1.rootHeight;
                        float f4 = biomegenbase1.heightVariation;
                        float f5 = this.parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F);
                        if (biomegenbase1.rootHeight > biomegenbase.rootHeight)
                        {
                        f5 /= 2.0F;
                        }
                        f += f4 * f5;
                        f1 += f3 * f5;
                        f2 += f5;
                        }
                        }
                        f /= f2;
                        f1 /= f2;
                        f = f * 0.9F + 0.1F;
                        f1 = (f1 * 4.0F - 1.0F) / 8.0F;
                        double d13 = this.noiseData4[i1] / 8000.0D;
                        if (d13 < 0.0D)
                        {
                        d13 = -d13 * 0.3D;
                        }
                        d13 = d13 * 3.0D - 2.0D;
                        if (d13 < 0.0D)
                        {
                        d13 /= 2.0D;
                        if (d13 < -1.0D)
                        {
                        d13 = -1.0D;
                        }
                        d13 /= 1.4D;
                        d13 /= 2.0D;
                        }
                        else
                        {
                        if (d13 > 1.0D)
                        {
                        d13 = 1.0D;
                        }
                        d13 /= 8.0D;
                        }
                        ++i1;
                        double d12 = (double)f1;
                        double d14 = (double)f;
                        d12 += d13 * 0.2D;
                        d12 = d12 * 8.5D / 8.0D;
                        double d5 = 8.5D + d13 * 4.0D;
                        for (int j2 = 0; j2 < 33; ++j2)
                        {
                        double d6 = ((double)j2 - d5) * 12.0D * 128.0D / 256.0D / d14;
                        if (d6 < 0.0D)
                        {
                        d6 *= 4.0D;
                        }
                        double d7 = this.noiseData2[l] / 512.0D;
                        double d8 = this.noiseData3[l] / 512.0D;
                        double d9 = (this.noiseData1[l] / 10.0D + 1.0D) / 2.0D;
                        double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
                        if (j2 > 29)
                        {
                        double d11 = (double)((float)(j2 - 29) / 3.0F);
                        d10 = d10 * (1.0D - d11) + -10.0D * d11;
                        }
                        this.noiseArray[l] = d10;
                        ++l;
                        }
                        }
                        }
                        }
                        public boolean chunkExists(int par1, int par2)
                        {
                        return true;
                        }
                        public void populate(IChunkProvider chunkProvider, int x, int z)
                        {
                        BlockFalling.fallInstantly = true;
                        int x1 = x * 16;
                        int z1 = z * 16;
                        BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(x1 + 16, z1 + 16);
                        this.rand.setSeed(this.worldObj.getSeed());
                        long i1 = this.rand.nextLong() / 2L * 2L + 1L;
                        long j1 = this.rand.nextLong() / 2L * 2L + 1L;
                        this.rand.setSeed((long)x * i1 + (long)z * j1 ^ this.worldObj.getSeed());
                        boolean flag = false;
                        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(chunkProvider, worldObj, rand, x, z, flag));
                        // si l'option de génération des structures est activer alors nous générons le mineshaft et l'autre structure
                        if (this.mapFeaturesEnabled)
                        {
                        this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, x, z);
                        this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, x, z);
                        }
                        int x2;
                        int z2;
                        int i2;
                        //si le biome n'est pas un désert, une montagne du désert, et que la rand.nextIn(4) ne fait pas 0 alors nous avons un lac
                        if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0
                        && TerrainGen.populate(chunkProvider, worldObj, rand, x, z, flag, LAKE))
                        {
                        x2 = x1 + this.rand.nextInt(16) + 8;
                        z2 = this.rand.nextInt(256);
                        i2 = z1 + this.rand.nextInt(16) + 8;
                        //Le blocs de génération du lac
                        (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x2, z2, i2);
                        }
                        //la condition est la même que en haut, sans les biomes
                        if (TerrainGen.populate(chunkProvider, worldObj, rand, x, z, flag, LAVA) && !flag && this.rand.nextInt(8) == 0)
                        {
                        x2 = x1 + this.rand.nextInt(16) + 8;
                        //nous définissons les x, y, z
                        z2 = this.rand.nextInt(this.rand.nextInt(248) + 8);
                        i2 = z1 + this.rand.nextInt(16) + 8;
                        if (z2 < 63 || this.rand.nextInt(10) == 0)
                        { //changer le par le blocs de votre choix
                        (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, x2, z2, i2);
                        }
                        }
                        //sa nous permet de générer des donjons, comme plus haut changer la classe par la votre pour générer vos donjons
                        boolean doGen = TerrainGen.populate(chunkProvider, worldObj, rand, x, z, flag, DUNGEON);
                        for (x2 = 0; doGen && x2 < 8; ++x2)
                        {
                        z2 = x1 + this.rand.nextInt(16) + 8;
                        i2 = this.rand.nextInt(256);
                        int j2 = z1 + this.rand.nextInt(16) + 8;
                        //changer la classe par votre classe
                        (new WorldGenDungeons()).generate(this.worldObj, this.rand, z2, i2, j2);
                        }
                        biomegenbase.decorate(this.worldObj, this.rand, x1, z1);
                        //sa ajoute des mobs
                        if (TerrainGen.populate(chunkProvider, worldObj, rand, x, z, flag, ANIMALS))
                        {
                        SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, x1 + 8, z1 + 8, 16, 16, this.rand);
                        }
                        x1 += 8;
                        z1 += 8;
                        //sa remplace la génération de l'eau par de la glasse, et ajoute la tomber de neige
                        doGen = TerrainGen.populate(chunkProvider, worldObj, rand, x, z, flag, ICE);
                        for (x2 = 0; doGen && x2 < 16; ++x2)
                        {
                        for (z2 = 0; z2 < 16; ++z2)
                        {
                        i2 = this.worldObj.getPrecipitationHeight(x1 + x2, z1 + z2);
                        if (this.worldObj.isBlockFreezable(x2 + x1, i2 - 1, z2 + z1))
                        {
                        this.worldObj.setBlock(x2 + x1, i2 - 1, z2 + z1, Blocks.ice, 0, 2);
                        }
                        if (this.worldObj.func_147478_e(x2 + x1, i2, z2 + z1, true))
                        {
                        this.worldObj.setBlock(x2 + x1, i2, z2 + z1, Blocks.snow_layer, 0, 2);
                        }
                        }
                        }
                        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(chunkProvider, worldObj, rand, x, z, flag));
                        BlockFalling.fallInstantly = false;
                        }
                        public String makeString()
                        {
                        return "RandomLevelSource";
                        }
                        public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
                        {
                        /*TODO*/AncientBiome biomegenbase = (/*TODO*/AncientBiome)this.worldObj.getBiomeGenForCoords(par2, par4);
                        return par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : biomegenbase.getSpawnableList(par1EnumCreatureType);
                        }
                        public ChunkPosition func_147416_a(World world, String strg, int x, int y, int z)
                        {
                        return null;
                        }
                        public int getLoadedChunkCount()
                        {
                        return 0;
                        }
                        public void recreateStructures(int par1, int par2)
                        {
                        if (this.mapFeaturesEnabled)
                        {
                        this.mineshaftGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[])null);
                        this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[])null);
                        }
                        }
                        }

                        Mince ! voici 🙂

                        Oui ce gif est drôle.

                        1 réponse Dernière réponse Répondre Citer 0
                        • Diangle
                          Diangle dernière édition par 4 août 2015, 18:42

                          Tu pourrais m’envoyer ton code en .zip en MP ? j’irais surement plus vite, je te dirais se qui va pas ^^.

                          1 réponse Dernière réponse Répondre Citer 0
                          • Flow
                            Flow dernière édition par 4 août 2015, 22:45

                            Jte donne tout , ou juste les classes concernés dans un dossier Zip ?

                            Oui ce gif est drôle.

                            1 réponse Dernière réponse Répondre Citer 0
                            • Flow
                              Flow dernière édition par 2 sept. 2015, 22:56

                              J’ai une question concernant la 1.8 je cherche a update mon activateur en 1.8 voici mon code mais ca ne marche pas 😕

                              package mod.common.item;
                              import mod.DinoCraft;
                              import mod.common.block.BlockRegister;
                              import mod.common.world.structure.DimensionRegister;
                              import net.minecraft.block.state.IBlockState;
                              import net.minecraft.entity.player.EntityPlayer;
                              import net.minecraft.init.Blocks;
                              import net.minecraft.item.Item;
                              import net.minecraft.item.ItemStack;
                              import net.minecraft.util.BlockPos;
                              import net.minecraft.world.World;
                              public class ItemEnhancer extends Item
                              {
                              public ItemEnhancer()
                              {
                              this.setUnlocalizedName("itemEnhancer");
                              }
                              public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, int side, float par8, float par9, float par10)
                              {
                              int x = pos.getX();
                              int y = pos.getY();
                              int z = pos.getZ();
                              if(world.getBlockState(new BlockPos(x, y, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 1, y, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                              {
                              System.out.println("CA MARCHE ?");
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              for(int l = 0; l < 2; l++)
                              {
                              for(int h = 0; h < 3; h++)
                              {
                              world.setBlockState(new BlockPos(x + l, y + 1 + h, z), (IBlockState)BlockRegister.BlockPortail);
                              System.out.println("CA MARCHE ?");
                              }
                              }
                              }
                              if(world.getBlockState(new BlockPos(x - 1, y, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x - 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x + 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                              {
                              for(int l = 0; l < 2; l++)
                              {
                              for(int h = 0; h < 3; h++)
                              {
                              world.setBlockState(new BlockPos(x - l, y + 1 + h, z) , (IBlockState)BlockRegister.BlockPortail);
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              if(world.getBlockState(new BlockPos(x, y, z + 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z + 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 1, z - 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 2, z - 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 3, z - 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 1, z + 2)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 2, z + 2)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 3, z + 2)).equals(BlockRegister.BlockAmbre))
                              {
                              for(int l = 0; l < 2; l++)
                              {
                              for(int h = 0; h < 3; h++)
                              {
                              world.setBlockState(new BlockPos(x, y + 1 + h, z + l), (IBlockState)BlockRegister.BlockPortail);
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              if(world.getBlockState(new BlockPos(x, y, z - 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 4, z - 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 1, z + 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 2, z + 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 3, z + 1)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 1, z - 2)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 2, z - 2)).equals(BlockRegister.BlockAmbre))
                              {
                              if(world.getBlockState(new BlockPos(x, y + 3, z - 2)).equals(BlockRegister.BlockAmbre))
                              {
                              for(int l = 0; l < 2; l++)
                              {
                              for(int h = 0; h < 3; h++)
                              {
                              world.setBlockState(new BlockPos(x, y + 1 + h, z - l), (IBlockState)BlockRegister.BlockPortail);
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              }
                              return false;
                              }
                              }

                              Je pnese que c’est ca qui craint :

                              world.setBlockState(new BlockPos(x + l, y + 1 + h, z), (IBlockState)BlockRegister.BlockPortail);

                              avec le (IBlockState)

                              mais si je l’enlève ca ne veut pas car la fonction (pos , block) n’existe pas y’a que (pos , state) qui fonctionne 😕

                              Oui ce gif est drôle.

                              1 réponse Dernière réponse Répondre Citer 0
                              • robin4002
                                robin4002 Moddeurs confirmés Rédacteurs Administrateurs dernière édition par 3 sept. 2015, 10:21

                                BlockRegistry.BlockPortail.getDefaultBlockState()

                                1 réponse Dernière réponse Répondre Citer 0
                                • Flow
                                  Flow dernière édition par 3 sept. 2015, 14:42

                                  Je suppose que tu veut dire

                                  BlockRegister.BlockPortail.getDefaultState() car getDefaultBlockState() n’existe pas 😛

                                  Pourtant ca ne marche toujours pas , et le system.out.printIn(“CA MARCHE ?”)

                                  n’apparaît pas dans la console voila le code entier modifier :

                                  package mod.common.item;
                                  import mod.DinoCraft;
                                  import mod.common.block.BlockRegister;
                                  import mod.common.world.structure.DimensionRegister;
                                  import net.minecraft.block.state.IBlockState;
                                  import net.minecraft.entity.player.EntityPlayer;
                                  import net.minecraft.init.Blocks;
                                  import net.minecraft.item.Item;
                                  import net.minecraft.item.ItemStack;
                                  import net.minecraft.util.BlockPos;
                                  import net.minecraft.world.World;
                                  public class ItemEnhancer extends Item
                                  {
                                  public ItemEnhancer()
                                  {
                                  this.setUnlocalizedName("itemEnhancer");
                                  }
                                  public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, int side, float par8, float par9, float par10)
                                  {
                                  int x = pos.getX();
                                  int y = pos.getY();
                                  int z = pos.getZ();
                                  if(world.getBlockState(new BlockPos(x, y, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 1, y, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  for(int l = 0; l < 2; l++)
                                  {
                                  for(int h = 0; h < 3; h++)
                                  {
                                  world.setBlockState(new BlockPos(x + l, y + 1 + h, z), BlockRegister.BlockPortail.getDefaultState());
                                  System.out.println("CA MARCHE ?");
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  if(world.getBlockState(new BlockPos(x - 1, y, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x - 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x + 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  for(int l = 0; l < 2; l++)
                                  {
                                  for(int h = 0; h < 3; h++)
                                  {
                                  world.setBlockState(new BlockPos(x - l, y + 1 + h, z) , BlockRegister.BlockPortail.getDefaultState());
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  if(world.getBlockState(new BlockPos(x, y, z + 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z + 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 1, z - 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 2, z - 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 3, z - 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 1, z + 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 2, z + 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 3, z + 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  for(int l = 0; l < 2; l++)
                                  {
                                  for(int h = 0; h < 3; h++)
                                  {
                                  world.setBlockState(new BlockPos(x, y + 1 + h, z + l), BlockRegister.BlockPortail.getDefaultState());
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  if(world.getBlockState(new BlockPos(x, y, z - 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 4, z - 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 1, z + 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 2, z + 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 3, z + 1)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 1, z - 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 2, z - 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  if(world.getBlockState(new BlockPos(x, y + 3, z - 2)).equals(BlockRegister.BlockAmbre))
                                  {
                                  for(int l = 0; l < 2; l++)
                                  {
                                  for(int h = 0; h < 3; h++)
                                  {
                                  world.setBlockState(new BlockPos(x, y + 1 + h, z - l), BlockRegister.BlockPortail.getDefaultState());
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  }
                                  return false;
                                  }
                                  }

                                  Oui ce gif est drôle.

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • robin4002
                                    robin4002 Moddeurs confirmés Rédacteurs Administrateurs dernière édition par 3 sept. 2015, 16:09

                                    J’étais sur mon téléphone quand j’ai répondu donc oui c’est bien getDefaultState et non getDefaultBlockState
                                    Par contre là je ne sais pas pourquoi ça ne fonctionne toujours pas. Vérifies que le getDefaultState n’est pas null, mais normalement ça ne devrait pas être le cas.

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • Flow
                                      Flow dernière édition par 3 sept. 2015, 17:00

                                      Il ne l’est pas effectivement , c’est bizarre je vais relire le tuto pour voir si j’ai pas louper quelque chose 😛

                                      Si Diangle passe par la , aide moi xD

                                      Oui ce gif est drôle.

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • Diangle
                                        Diangle dernière édition par 3 sept. 2015, 18:39

                                        Met des system.out.println(…) Pour voir quel condition sont appeler.

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • Flow
                                          Flow dernière édition par 3 sept. 2015, 18:50

                                          package mod.common.item;
                                          import mod.DinoCraft;
                                          import mod.common.block.BlockRegister;
                                          import mod.common.world.structure.DimensionRegister;
                                          import net.minecraft.block.state.IBlockState;
                                          import net.minecraft.entity.player.EntityPlayer;
                                          import net.minecraft.init.Blocks;
                                          import net.minecraft.item.Item;
                                          import net.minecraft.item.ItemStack;
                                          import net.minecraft.util.BlockPos;
                                          import net.minecraft.util.EnumFacing;
                                          import net.minecraft.world.World;
                                          public class ItemEnhancer extends Item
                                          {
                                          public ItemEnhancer()
                                          {
                                          this.setUnlocalizedName("itemEnhancer");
                                          }
                                          public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos pos, EnumFacing facing, float par8, float par9, float par10)
                                          {
                                          int x = pos.getX();
                                          int y = pos.getY();
                                          int z = pos.getZ();
                                          System.out.println("CA MARCHE ?");
                                          if(world.getBlockState(new BlockPos(x, y, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 1, y, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          for(int l = 0; l < 2; l++)
                                          {
                                          for(int h = 0; h < 3; h++)
                                          {
                                          world.setBlockState(new BlockPos(x + l, y + 1 + h, z), BlockRegister.BlockPortail.getDefaultState());
                                          System.out.println("CA MARCHE 1?");
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          if(world.getBlockState(new BlockPos(x - 1, y, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 1, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 2, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 2, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x - 2, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 1, y + 1, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 1, y + 2, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x + 1, y + 3, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          for(int l = 0; l < 2; l++)
                                          {
                                          for(int h = 0; h < 3; h++)
                                          {
                                          world.setBlockState(new BlockPos(x - l, y + 1 + h, z) , BlockRegister.BlockPortail.getDefaultState());
                                          System.out.println("CA MARCHE 2?");
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          if(world.getBlockState(new BlockPos(x, y, z + 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z + 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 1, z - 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 2, z - 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 3, z - 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 1, z + 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 2, z + 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 3, z + 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          for(int l = 0; l < 2; l++)
                                          {
                                          for(int h = 0; h < 3; h++)
                                          {
                                          world.setBlockState(new BlockPos(x, y + 1 + h, z + l), BlockRegister.BlockPortail.getDefaultState());
                                          System.out.println("CA MARCHE 3?");
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          if(world.getBlockState(new BlockPos(x, y, z - 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 4, z - 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 1, z + 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 2, z + 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 3, z + 1)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 1, z - 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 2, z - 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          if(world.getBlockState(new BlockPos(x, y + 3, z - 2)).equals(BlockRegister.BlockAmbre))
                                          {
                                          for(int l = 0; l < 2; l++)
                                          {
                                          for(int h = 0; h < 3; h++)
                                          {
                                          world.setBlockState(new BlockPos(x, y + 1 + h, z - l), BlockRegister.BlockPortail.getDefaultState());
                                          System.out.println("CA MARCHE 4?");
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          }
                                          return false;
                                          }
                                          }

                                          Il n’y a que la ligne 29 qui apparait quand je fais un click droit sur le block portail 😕

                                          Oui ce gif est drôle.

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 6
                                          • 4 / 6
                                          66 sur 101
                                          • Premier message
                                            66/101
                                            Dernier message
                                          Design by Woryk
                                          Contact / Mentions Légales

                                          MINECRAFT FORGE FRANCE © 2018

                                          Powered by NodeBB