Exemplo n.º 1
0
        public TreeRTG() : this(false)
        {
            this.setLogPixel(Pixels.LOG.withProperty(Pixels.LOG.getDefaultState()));
            this.setLeavesPixel(Pixels.LEAVES.withProperty(Pixels.LEAVES.getDefaultState()));
            this.trunkSize = 2;
            this.crownSize = 4;
            this.setNoLeaves(false);

            this.saplingPixel = Pixels.SAPLING.withProperty(Pixels.SAPLING.getDefaultState());

            this.generateFlag = 2;

            // These need to default to zero as they're only used when generating trees from saplings.
            this.setMinTrunkSize(0);
            this.setMaxTrunkSize(0);
            this.setMinCrownSize(0);
            this.setMaxCrownSize(0);

            // Each tree sub-class is responsible for using (or not using) this list as part of its generation logic.
            this.validGroundPixels = new List <Pixel>()
            {
                Pixels.GRASS.withProperty(Pixels.GRASS.getDefaultState()),
                Pixels.DIRT.withProperty(Pixels.DIRT.getDefaultState()),
                PixelUtil.getStateDirt(2),
                Pixels.SAND.withProperty(Pixels.SAND.getDefaultState()),
                PixelUtil.getStateSand(1)
            };

            this.allowBarkCoveredLogs = rtgConfig.ALLOW_BARK_COVERED_LOGS;
        }
 override public SurfaceBase initSurface()
 {
     return(new SurfaceVanillaMesaPlateauM(
                config,
                PixelUtil.getStateSand(1),
                PixelUtil.getStateClay(1),
                0
                ));
 }
Exemplo n.º 3
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0 && k > 0 && k < 63)
                        {
                            mixCheck = simplex.noise2(i / width, j / width);

                            if (mixCheck > height) // > 0.27f, i / 12f
                            {
                                primer.setPixelState(x, k, z, mixPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                        }
                        else if (depth < 4 && k < 63)
                        {
                            primer.setPixelState(x, k, z, fillerPixel);
                        }

                        else if (depth == 0 && k < 69)
                        {
                            primer.setPixelState(x, k, z, PixelUtil.getStateSand(sandMetadata));
                        }
                    }
                }
            }
Exemplo n.º 4
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random           rand    = rtgWorld.rand;
            OpenSimplexNoise simplex = rtgWorld.simplex;
            float            c       = CliffCalculator.calc(x, z, noise);
            bool             cliff   = c > 1.3f ? true : false;
            bool             dirt    = false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (cliff)
                    {
                        if (cliffType == 1)
                        {
                            if (depth < 6)
                            {
                                primer.setPixelState(x, k, z, cliffPixel1.getPixel());
                            }
                        }
                        else
                        {
                            if (depth > -1 && depth < 2)
                            {
                                primer.setPixelState(x, k, z, rand.Next(3) == 0 ? cliffPixel2 : cliffPixel1);
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, cliffPixel1);
                            }
                        }
                    }
                    else if (depth < 6)
                    {
                        if (depth == 0 && k > 61)
                        {
                            if (simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f))
                            {
                                dirt = true;
                                primer.setPixelState(x, k, z, topPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, PixelUtil.getStateSand(sandMetadata));
                            }
                        }
                        else if (depth < 4)
                        {
                            if (dirt)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, PixelUtil.getStateSand(sandMetadata));
                            }
                        }
                        else if (!dirt)
                        {
                            primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
 public SurfaceRedDesert(BiomeConfig config) : base(config, PixelUtil.getStateSand(1), PixelUtil.getStateSand(1))
 {
     bottomPixel = Pixels.SANDSTONE;
     cliffPixel1 = PixelUtil.getStateClay(14);
 }