示例#1
0
        public override Task OnActivateAsync()
        {
            _densityMap   = new float[5, 33, 5];
            _depthMap     = new float[5, 1, 5];
            _mainNoiseMap = new float[5, 33, 5];
            _minLimitMap  = new float[5, 33, 5];
            _maxLimitMap  = new float[5, 33, 5];
            _surfaceMap   = new float[16, 1, 16];

            _seed         = (int)this.GetPrimaryKeyLong();
            _random       = new Random(_seed);
            _depthNoise   = new OctavedNoise <PerlinNoise>(new PerlinNoise(_random.Next()), 8, 0.5F);
            _mainNoise    = new OctavedNoise <PerlinNoise>(new PerlinNoise(_random.Next()), 8, 0.5F);
            _maxNoise     = new OctavedNoise <PerlinNoise>(new PerlinNoise(_random.Next()), 8, 0.5F);
            _minNoise     = new OctavedNoise <PerlinNoise>(new PerlinNoise(_random.Next()), 8, 0.5F);
            _surfaceNoise = new OctavedNoise <PerlinNoise>(new PerlinNoise(_random.Next()), 8, 0.5F);

            _biomeWeights = new float[5, 5];
            for (int i = -2; i <= 2; ++i)
            {
                for (int j = -2; j <= 2; ++j)
                {
                    float f = 10.0F / (float)Math.Sqrt((i * i + j * j) + 0.2D);
                    _biomeWeights[i + 2, j + 2] = f;
                }
            }

            _biomesForGeneration = new Biome[16, 16];

            _genlayer = GenLayer.InitAllLayer(_seed);

            return(Task.CompletedTask);
        }
 public GenLayerTemperatureMix(GenLayer genlayer, GenLayer genlayer1, int i)
     : base(0L)
 {
     parent        = genlayer1;
     field_35505_b = genlayer;
     field_35506_c = i;
 }
示例#3
0
        public void Test1()
        {
            using (StreamWriter sw = new StreamWriter("../../GenLayer.txt"))
            {
                GenLayer layer = GenLayer.InitAllLayer(1);
                int      x     = -4;
                int      z     = -4;
                int[,] biomeIds = layer.GetInts(16 * x - 16, 16 * z - 16, 48, 48);
                sw.WriteLine("pre: ");
                for (int i = 0; i < 48; ++i)
                {
                    for (int j = 0; j < 48; ++j)
                    {
                        sw.Write(biomeIds[i, j] + " ");
                    }

                    sw.WriteLine();
                }

                biomeIds = layer.GetInts(16 * x, 16 * z, 16, 16);
                sw.WriteLine("suc: ");
                for (int i = 0; i < 16; ++i)
                {
                    for (int j = 0; j < 16; ++j)
                    {
                        sw.Write(biomeIds[i, j] + " ");
                    }

                    sw.WriteLine();
                }
            }
        }
 public GenLayerTemperatureMix(GenLayer genlayer, GenLayer genlayer1, int i)
     : base(0L)
 {
     parent = genlayer1;
     field_35505_b = genlayer;
     field_35506_c = i;
 }
 public GenLayerDownfallMix(GenLayer genlayer, GenLayer genlayer1, int i)
     : base(0L)
 {
     parent = genlayer1;
     field_35507_b = genlayer;
     field_35508_c = i;
 }
示例#6
0
 public GenLayerDownfallMix(GenLayer genlayer, GenLayer genlayer1, int i)
     : base(0L)
 {
     parent        = genlayer1;
     field_35507_b = genlayer;
     field_35508_c = i;
 }
示例#7
0
 public GenLayerVillageLandscape(long l, GenLayer genlayer)
     : base(l)
 {
     allowedBiomes = (new BiomeGenBase[] {
         BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga
     });
     parent = genlayer;
 }
 public GenLayerVillageLandscape(long l, GenLayer genlayer)
     : base(l)
 {
     allowedBiomes = (new BiomeGenBase[] {
     BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga
     });
     parent = genlayer;
 }
示例#9
0
 public WorldChunkManager(long seed, WorldType worldType, string worldGeneratorOptions) : this()
 {
     //to be implemented the POINT!
     field_180301_f = worldGeneratorOptions;
     GenLayer[] agenLayer = GenLayer.initializeAllBiomeGenerators(seed, worldType, worldGeneratorOptions);
     genBiomes       = agenLayer [0];
     biomeIndexLayer = agenLayer [1];
 }
示例#10
0
        public static GenLayer[] Func_48425_a(long par0, WorldType par2WorldType)
        {
            GenLayer obj = new GenLayerIsland(1L);

            obj = new GenLayerFuzzyZoom(2000L, ((GenLayer)(obj)));
            obj = new GenLayerAddIsland(1L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2001L, ((GenLayer)(obj)));
            obj = new GenLayerAddIsland(2L, ((GenLayer)(obj)));
            obj = new GenLayerAddSnow(2L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2002L, ((GenLayer)(obj)));
            obj = new GenLayerAddIsland(3L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2003L, ((GenLayer)(obj)));
            obj = new GenLayerAddIsland(4L, ((GenLayer)(obj)));
            obj = new GenLayerAddMushroomIsland(5L, ((GenLayer)(obj)));
            sbyte    byte0 = 4;
            GenLayer obj1  = obj;

            obj1 = GenLayerZoom.Func_35515_a(1000L, ((GenLayer)(obj1)), 0);
            obj1 = new GenLayerRiverInit(100L, ((GenLayer)(obj1)));
            obj1 = GenLayerZoom.Func_35515_a(1000L, ((GenLayer)(obj1)), byte0 + 2);
            obj1 = new GenLayerRiver(1L, ((GenLayer)(obj1)));
            obj1 = new GenLayerSmooth(1000L, ((GenLayer)(obj1)));
            GenLayer obj2 = obj;

            obj2 = GenLayerZoom.Func_35515_a(1000L, ((GenLayer)(obj2)), 0);
            obj2 = new GenLayerBiome(200L, ((GenLayer)(obj2)), par2WorldType);
            obj2 = GenLayerZoom.Func_35515_a(1000L, ((GenLayer)(obj2)), 2);
            obj2 = new GenLayerHills(1000L, ((GenLayer)(obj2)));

            for (int i = 0; i < byte0; i++)
            {
                obj2 = new GenLayerZoom(1000 + i, ((GenLayer)(obj2)));

                if (i == 0)
                {
                    obj2 = new GenLayerAddIsland(3L, ((GenLayer)(obj2)));
                }

                if (i == 1)
                {
                    obj2 = new GenLayerShore(1000L, ((GenLayer)(obj2)));
                }

                if (i == 1)
                {
                    obj2 = new GenLayerSwampRivers(1000L, ((GenLayer)(obj2)));
                }
            }

            obj2 = new GenLayerSmooth(1000L, ((GenLayer)(obj2)));
            obj2 = new GenLayerRiverMix(100L, ((GenLayer)(obj2)), ((GenLayer)(obj1)));
            GenLayerRiverMix    genlayerrivermix    = ((GenLayerRiverMix)(obj2));
            GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, ((GenLayer)(obj2)));

            ((GenLayer)(obj2)).InitWorldGenSeed(par0);
            genlayervoronoizoom.InitWorldGenSeed(par0);
            return(new GenLayer[] { obj2, genlayervoronoizoom, genlayerrivermix });
        }
示例#11
0
 public WorldChunkManager(long seed)
     : base(seed)
 {
     biomeCache = new BiomeCache(this);
     GenLayer[] agenlayer = GenLayer.func_35497_a(Seed);
     biomeIndexLayer = agenlayer[1];
     temperatureLayer = agenlayer[2];
     rainfallLayer = agenlayer[3];
 }
示例#12
0
        public static GenLayer[] func_35497_a(long l)
        {
            GenLayer obj = new LayerIsland(1L);

            obj = new GenLayerZoomFuzzy(2000L, ((GenLayer)(obj)));
            obj = new GenLayerIsland(1L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2001L, ((GenLayer)(obj)));
            obj = new GenLayerIsland(2L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2002L, ((GenLayer)(obj)));
            obj = new GenLayerIsland(3L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2003L, ((GenLayer)(obj)));
            obj = new GenLayerIsland(3L, ((GenLayer)(obj)));
            obj = new GenLayerZoom(2004L, ((GenLayer)(obj)));
            obj = new GenLayerIsland(3L, ((GenLayer)(obj)));
            byte     byte0 = 4;
            GenLayer obj1  = obj;

            obj1 = GenLayerZoom.func_35515_a(1000L, ((GenLayer)(obj1)), 0);
            obj1 = new GenLayerRiverInit(100L, ((GenLayer)(obj1)));
            obj1 = GenLayerZoom.func_35515_a(1000L, ((GenLayer)(obj1)), byte0 + 2);
            obj1 = new GenLayerRiver(1L, ((GenLayer)(obj1)));
            obj1 = new GenLayerSmooth(1000L, ((GenLayer)(obj1)));
            GenLayer obj2 = obj;

            obj2 = GenLayerZoom.func_35515_a(1000L, ((GenLayer)(obj2)), 0);
            obj2 = new GenLayerVillageLandscape(200L, ((GenLayer)(obj2)));
            obj2 = GenLayerZoom.func_35515_a(1000L, ((GenLayer)(obj2)), 2);
            GenLayer obj3 = new GenLayerTemperature(((GenLayer)(obj2)));
            GenLayer obj4 = new GenLayerDownfall(((GenLayer)(obj2)));

            for (int i = 0; i < byte0; i++)
            {
                obj2 = new GenLayerZoom(1000 + i, ((GenLayer)(obj2)));
                if (i == 0)
                {
                    obj2 = new GenLayerIsland(3L, ((GenLayer)(obj2)));
                }
                obj3 = new GenLayerSmoothZoom(1000 + i, ((GenLayer)(obj3)));
                obj3 = new GenLayerTemperatureMix(((GenLayer)(obj3)), ((GenLayer)(obj2)), i);
                obj4 = new GenLayerSmoothZoom(1000 + i, ((GenLayer)(obj4)));
                obj4 = new GenLayerDownfallMix(((GenLayer)(obj4)), ((GenLayer)(obj2)), i);
            }

            obj2 = new GenLayerSmooth(1000L, ((GenLayer)(obj2)));
            obj2 = new GenLayerRiverMix(100L, ((GenLayer)(obj2)), ((GenLayer)(obj1)));
            obj3 = GenLayerSmoothZoom.func_35517_a(1000L, ((GenLayer)(obj3)), 2);
            obj4 = GenLayerSmoothZoom.func_35517_a(1000L, ((GenLayer)(obj4)), 2);
            GenLayerZoomVoronoi genlayerzoomvoronoi = new GenLayerZoomVoronoi(10L, ((GenLayer)(obj2)));

            ((GenLayer)(obj2)).func_35496_b(l);
            ((GenLayer)(obj3)).func_35496_b(l);
            ((GenLayer)(obj4)).func_35496_b(l);
            genlayerzoomvoronoi.func_35496_b(l);
            return(new GenLayer[] {
                obj2, genlayerzoomvoronoi, obj3, obj4
            });
        }
示例#13
0
 public WorldChunkManager(World world)
     : this()
 {
     GenLayer[] agenlayer = GenLayer.func_35019_a(world.seed);
     field_34907_a    = agenlayer[0];
     field_34906_b    = agenlayer[1];
     temperatureLayer = agenlayer[2];
     rainfallLayer    = agenlayer[3];
 }
示例#14
0
        public static GenLayer func_35517_a(long l, GenLayer genlayer, int i)
        {
            Object obj = genlayer;
            for (int j = 0; j < i; j++)
            {
                obj = new GenLayerSmoothZoom(l + (long)j, ((GenLayer)(obj)));
            }

            return ((GenLayer)(obj));
        }
示例#15
0
        public GenLayerBiome(long par1, GenLayer par3GenLayer, WorldType par4WorldType) : base(par1)
        {
            AllowedBiomes = (new BiomeGenBase[] { BiomeGenBase.Desert, BiomeGenBase.Forest, BiomeGenBase.ExtremeHills, BiomeGenBase.Swampland, BiomeGenBase.Plains, BiomeGenBase.Taiga, BiomeGenBase.Jungle });
            Parent        = par3GenLayer;

            if (par4WorldType == WorldType.DEFAULT_1_1)
            {
                AllowedBiomes = (new BiomeGenBase[] { BiomeGenBase.Desert, BiomeGenBase.Forest, BiomeGenBase.ExtremeHills, BiomeGenBase.Swampland, BiomeGenBase.Plains, BiomeGenBase.Taiga });
            }
        }
示例#16
0
    /**
     * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify
     */
    public static GenLayer magnify(long seed, GenLayer genLayer, int times)
    {
        GenLayer genlayer = genLayer;

        for (int i = 0; i < times; ++i)
        {
            genlayer = new GenLayerZoom(seed + (long)i, genlayer);
        }

        return(genlayer);
    }
示例#17
0
        public GenLayerBiome(long par1, GenLayer par3GenLayer/*, WorldType par4WorldType*/)
            : base(par1)
        {
            this.allowedBiomes = new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle };
            this.parent = par3GenLayer;

            /*if (par4WorldType == WorldType.DEFAULT_1_1)
            {
                this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
            }*/
        }
示例#18
0
        public GenLayerBiome(long par1, GenLayer par3GenLayer/*, WorldType par4WorldType*/)
            : base(par1)
        {
            this.allowedBiomes = new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle };
            this.parent = par3GenLayer;

            /*if (par4WorldType == WorldType.DEFAULT_1_1)
            {
                this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
            }*/
        }
示例#19
0
 public GenLayerSmooth(long l, GenLayer genlayer)
     : base(l)
 {
     base.parent = genlayer;
 }
 public GenLayerMushroomIsland(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#21
0
 public GenLayerAddSnow(long seed, GenLayer parentLayer) : base(seed)
 {
     parent = parentLayer;
 }
示例#22
0
 public GenLayerRiverInit(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
示例#23
0
 public GenLayerSwampRivers(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
示例#24
0
 public GenLayerAddSnow(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     parent = par3GenLayer;
 }
示例#25
0
 public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer)
     : base(par1)
 {
     field_35512_b = par3GenLayer;
     field_35513_c = par4GenLayer;
 }
示例#26
0
 public GenLayerRareBiome(long seed, GenLayer parentGenLayer) : base(seed)
 {
     parent = parentGenLayer;
 }
示例#27
0
 public GenLayerSmooth(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     base.parent = par3GenLayer;
 }
示例#28
0
 public GenLayerSwampRivers(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#29
0
 public GenLayerRiverInit(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
 public GenLayerAddIsland(long par1, GenLayer par3GenLayer) : base(par1)
 {
     Parent = par3GenLayer;
 }
示例#31
0
 public GenLayerRiverMix(long l, GenLayer genlayer, GenLayer genlayer1)
     : base(l)
 {
     field_35512_b = genlayer;
     field_35513_c = genlayer1;
 }
示例#32
0
 public GenLayerHills(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#33
0
 public GenLayerDownfall(GenLayer genlayer)
     : base(0L)
 {
     parent = genlayer;
 }
示例#34
0
 public GenLayerSmooth(long l, GenLayer genlayer)
     : base(l)
 {
     base.parent = genlayer;
 }
示例#35
0
 public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
 public GenLayerMushroomIsland(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#37
0
 public GenLayerRiver(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     base.parent = par3GenLayer;
 }
示例#38
0
 public GenLayerHills(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
示例#39
0
 public GenLayerShore(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     parent = par3GenLayer;
 }
示例#40
0
 public GenLayerSnow(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#41
0
 public GenLayerDownfall(GenLayer genlayer)
     : base(0L)
 {
     parent = genlayer;
 }
 public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     parent = par3GenLayer;
 }
 public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer) : base(par1)
 {
     Field_35512_b = par3GenLayer;
     Field_35513_c = par4GenLayer;
 }
示例#44
0
 public GenLayerZoomVoronoi(long l, GenLayer genlayer)
     : base(l)
 {
     base.parent = genlayer;
 }
示例#45
0
 public GenLayerSwampRivers(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
示例#46
0
 public GenLayerRiverMix(long l, GenLayer genlayer, GenLayer genlayer1)
     : base(l)
 {
     field_35512_b = genlayer;
     field_35513_c = genlayer1;
 }
示例#47
0
 public GenLayerRiverInit(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
示例#48
0
 public GenLayerRiver(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     base.parent = par3GenLayer;
 }
示例#49
0
 public GenLayerZoomFuzzy(long l, GenLayer genlayer)
     : base(l)
 {
     base.parent = genlayer;
 }
示例#50
0
 public GenLayerSmooth(long seed, GenLayer parentGenLayer) : base(seed)
 {
     parent = parentGenLayer;
 }
示例#51
0
 public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer)
     : base(par1)
 {
     this.biomePatternGeneratorChain = par3GenLayer;
     this.riverPatternGeneratorChain = par4GenLayer;
 }
示例#52
0
 public GenLayerSmooth(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     base.parent = par3GenLayer;
 }
示例#53
0
 public GenLayerSmoothZoom(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }
示例#54
0
 public GenLayerRiver(long l, GenLayer genlayer)
     : base(l)
 {
     base.parent = genlayer;
 }
示例#55
0
 public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer)
     : base(par1)
 {
     this.biomePatternGeneratorChain = par3GenLayer;
     this.riverPatternGeneratorChain = par4GenLayer;
 }
示例#56
0
 public GenLayerTemperature(GenLayer genlayer)
     : base(0L)
 {
     parent = genlayer;
 }
示例#57
0
 public GenLayerAddIsland(long par1, GenLayer par3GenLayer)
     : base(par1)
 {
     this.parent = par3GenLayer;
 }
 public GenLayerAddSnow(long par1, GenLayer par3GenLayer) : base(par1)
 {
     Parent = par3GenLayer;
 }
示例#59
0
 public GenLayerRiver(long seed, GenLayer parentGenLayer) : base(seed)
 {
     parent = parentGenLayer;
 }
示例#60
0
 public GenLayerSnow(long l, GenLayer genlayer)
     : base(l)
 {
     parent = genlayer;
 }