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; }
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 GenLayerDownfallMix(GenLayer genlayer, GenLayer genlayer1, int i) : base(0L) { parent = genlayer1; field_35507_b = genlayer; field_35508_c = i; }
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 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]; }
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 }); }
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]; }
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 }); }
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]; }
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)); }
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 }); } }
/** * 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); }
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}; }*/ }
public GenLayerSmooth(long l, GenLayer genlayer) : base(l) { base.parent = genlayer; }
public GenLayerMushroomIsland(long l, GenLayer genlayer) : base(l) { parent = genlayer; }
public GenLayerAddSnow(long seed, GenLayer parentLayer) : base(seed) { parent = parentLayer; }
public GenLayerRiverInit(long par1, GenLayer par3GenLayer) : base(par1) { this.parent = par3GenLayer; }
public GenLayerSwampRivers(long par1, GenLayer par3GenLayer) : base(par1) { this.parent = par3GenLayer; }
public GenLayerAddSnow(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; }
public GenLayerRareBiome(long seed, GenLayer parentGenLayer) : base(seed) { parent = parentGenLayer; }
public GenLayerSmooth(long par1, GenLayer par3GenLayer) : base(par1) { base.parent = par3GenLayer; }
public GenLayerSwampRivers(long l, GenLayer genlayer) : base(l) { parent = genlayer; }
public GenLayerRiverInit(long l, GenLayer genlayer) : base(l) { parent = genlayer; }
public GenLayerAddIsland(long par1, GenLayer par3GenLayer) : base(par1) { Parent = par3GenLayer; }
public GenLayerRiverMix(long l, GenLayer genlayer, GenLayer genlayer1) : base(l) { field_35512_b = genlayer; field_35513_c = genlayer1; }
public GenLayerHills(long l, GenLayer genlayer) : base(l) { parent = genlayer; }
public GenLayerDownfall(GenLayer genlayer) : base(0L) { parent = genlayer; }
public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer) : base(par1) { this.parent = par3GenLayer; }
public GenLayerRiver(long par1, GenLayer par3GenLayer) : base(par1) { base.parent = par3GenLayer; }
public GenLayerHills(long par1, GenLayer par3GenLayer) : base(par1) { this.parent = par3GenLayer; }
public GenLayerShore(long par1, GenLayer par3GenLayer) : base(par1) { parent = par3GenLayer; }
public GenLayerSnow(long l, GenLayer genlayer) : base(l) { 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; }
public GenLayerZoomVoronoi(long l, GenLayer genlayer) : base(l) { base.parent = genlayer; }
public GenLayerZoomFuzzy(long l, GenLayer genlayer) : base(l) { base.parent = genlayer; }
public GenLayerSmooth(long seed, GenLayer parentGenLayer) : base(seed) { parent = parentGenLayer; }
public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer) : base(par1) { this.biomePatternGeneratorChain = par3GenLayer; this.riverPatternGeneratorChain = par4GenLayer; }
public GenLayerSmoothZoom(long l, GenLayer genlayer) : base(l) { parent = genlayer; }
public GenLayerRiver(long l, GenLayer genlayer) : base(l) { base.parent = genlayer; }
public GenLayerTemperature(GenLayer genlayer) : base(0L) { parent = genlayer; }
public GenLayerAddIsland(long par1, GenLayer par3GenLayer) : base(par1) { this.parent = par3GenLayer; }
public GenLayerAddSnow(long par1, GenLayer par3GenLayer) : base(par1) { Parent = par3GenLayer; }
public GenLayerRiver(long seed, GenLayer parentGenLayer) : base(seed) { parent = parentGenLayer; }