Example #1
0
        public override Brush Construct(BrushArgs args)
        {
            int[]     count;
            BlockID[] toAffect = FrequencyBrush.GetBlocks(args, out count, P => false, null);

            if (toAffect == null)
            {
                return(null);
            }
            BlockID[] blocks = FrequencyBrush.Combine(toAffect, count);
            return(new RandomBrush(blocks));
        }
Example #2
0
        public override Brush Construct(BrushArgs args)
        {
            NoiseArgs n = default(NoiseArgs);

            // Constants borrowed from fCraft to match it
            n.Amplitude   = 1;
            n.Frequency   = 0.08f;
            n.Octaves     = 3;
            n.Seed        = int.MinValue;
            n.Persistence = 0.75f;
            n.Lacunarity  = 2;

            int[]     count;
            BlockID[] toAffect = FrequencyBrush.GetBlocks(args, out count,
                                                          Filter, arg => Handler(arg, args.Player, ref n));

            if (toAffect == null)
            {
                return(null);
            }
            return(new CloudyBrush(toAffect, count, n));
        }