Ruined Portal

Ruined portals are naturally generated damaged nether portals, which spawn in both the Nether and the Overworld.

Generation
Ruined portals generate in all biomes in both the Nether and the Overworld. They can spawn underground, underwater, or exposed to the air. If they generate underground, they will have air pockets around them. Natural terrain around ruined portals generates as netherrack. They will also generate a mass of netherrack underneath them.

Ruined portals that generate underground will generate at Y-level from 15 to, where is the highest block at the point of generation and  is the height of the ruined portal structure. This means the terrain will be higher, or at least level with the top of the structure.

Ruined portals that generate in mountains generate at y-level from 70 to.

Ruined portals that generate partially buried will generate at y-level, plus a random integer from 2 to 8. This means the structure will have 2 to 8 layers raised above the surface.

In the Nether, ruined portals with air pockets will generate from Y-level 32 to 100. Ruined portals without air pockets have a 50% chance to spawn from Y-level 27 to 29, and a 50% chance to spawn from Y-level 29 to 100.

Many blocks in ruined portals will be replaced upon generation. A ruined portal is in a "cold" biome if the temperature is less than 0.15.

Structure
Ruined portals generate incomplete portal frames composed of both obsidian and crying obsidian, despite crying obsidian not being a valid portal material (likely to give the portals an "aged" appearance). Some frames generate flat on the ground, as if they toppled over.

Ruined portals generate with a chest, which contain various golden items and items used to build portals such as obsidian and flint and steel.

A ruined portal generated in the Overworld is surrounded with structures made of stone, stone bricks, and iron bars; in the Nether it is surrounded by blackstone variants and chains.

If a ruined portal generates underwater, it may create downward bubble columns with nearby magma blocks.

Currently there are 13 variants: 10 normal size portals and 3 giant portals in varying states of decay.

$$, ruined portals can be generated by the player by loading or  with a structure block. These ruined portals will generate as stored, meaning they will not be modified as detailed in the Generation section above.

Portals
Note that some blocks will be replaced with others upon generation. A full list can be seen above.

Trivia

 * Using the partially buried generation, some ruined portal variants are short enough that they can generate completely on the surface.
 * Ruined portals are the only generated structure that can be found in more than one dimension.
 * All basic ruined portal structures contain enough obsidian to make a complete portal. However, there is often not enough in natural ruined portals as some obsidian is replaced with crying obsidian.
 * Underwater ruined portals are often visible from the water surface due to the many magma blocks; the downward bubble columns can also pose a hazard to boating. When encountered for the first time, they may also be revealed by a swath of broken kelp floating on the surface.