public override void ProcessSurface(MCUtils.World world, int x, int y, int z)
 {
     if (random.NextDouble() <= chance && world.IsAir(x, y + 1, z))
     {
         world.SetBlock(x, y + 1, z, "minecraft:torch");
     }
 }
예제 #2
0
 protected override void OnProcessSurface(MCUtils.World world, int x, int y, int z, int pass, float mask)
 {
     if (random.NextDouble() <= chance && world.IsAir(x, y + 1, z))
     {
         world.SetBlock(x, y + 1, z, "minecraft:torch");
     }
 }
예제 #3
0
 private void MakeLayer(MCUtils.World world, int x, int y, int z, string[] blocks)
 {
     for (int i = 0; i < blocks.Length; i++)
     {
         if (!string.IsNullOrWhiteSpace(blocks[i]) && !world.IsAir(x, y, z))
         {
             world.SetBlock(x, y - i, z, blocks[i]);
         }
     }
 }
 public override void ProcessBlock(MCUtils.World world, int x, int y, int z)
 {
     //Make flat bedrock
     if (y == 0)
     {
         if (world.IsDefaultBlock(x, 0, z))
         {
             world.SetBlock(x, 0, z, "minecraft:bedrock");
         }
     }
     //Fill the terrain with water up to the waterLevel
     if (y <= waterLevel)
     {
         if (world.IsAir(x, y, z))
         {
             world.SetBlock(x, y, z, "minecraft:water");
         }
     }
 }
예제 #5
0
        private bool PlaceTree(MCUtils.World world, int x, int y, int z)
        {
            var b = world.GetBlock(x, y - 1, z);

            if (b == null || !CanGrowPlant(b))
            {
                return(false);
            }
            int bareTrunkHeight = random.Next(1, 4);
            int w = treeRadius;

            if (!world.IsAir(x, y + 1, z))
            {
                return(false);
            }
            //if(IsObstructed(region, x, y+1, z, x, y+bareTrunkHeight, z) || IsObstructed(region, x-w, y+bareTrunkHeight, z-w, x+w, y+bareTrunkHeight+treeTopHeight, z+w)) return false;
            world.SetBlock(x, y - 1, z, "minecraft:dirt");
            for (int i = 0; i <= bareTrunkHeight; i++)
            {
                world.SetBlock(x, y + i, z, "minecraft:oak_log");
            }
            for (int ly = 0; ly < treeTopHeight; ly++)
            {
                for (int lz = 0; lz < 2 * treeRadius + 1; lz++)
                {
                    for (int lx = 0; lx < 2 * treeRadius + 1; lx++)
                    {
                        int palette = blueprintOakTreeTop[ly, lz, lx];
                        if (palette > 0)
                        {
                            string block = palette == 1 ? "minecraft:oak_log" : "minecraft:oak_leaves";
                            world.SetBlock(x + lx - treeRadius, y + ly + bareTrunkHeight + 1, z + lz - treeRadius, block);
                        }
                    }
                }
            }
            return(true);
        }