support checking for igloos with basement

This commit is contained in:
Cubitect 2023-05-21 14:48:07 +02:00
parent 960d5d64b6
commit f2c96306c7
2 changed files with 21 additions and 1 deletions

View File

@ -1950,6 +1950,25 @@ int getVariant(StructureVariant *r, int structType, int mc, uint64_t seed,
r->sx = r->sz = 58;
return 1;
case Igloo:
if (mc <= MC_1_12)
{
setSeed(&rng, getPopulationSeed(mc, seed, (x>>4) - 1, (z>>4) - 1));
}
r->rotation = nextInt(&rng, 4);
r->basement = nextDouble(&rng) < 0.5;
r->size = nextInt(&rng, 8) + 4;
sx = 7; sy = 5; sz = 8;
r->sy = sy;
switch (r->rotation)
{ // orientation: 0:north, 1:east, 2:south, 3:west
case 0: r->rotation = 0; r->mirror = 0; r->sx = sx; r->sz = sz; break;
case 1: r->rotation = 1; r->mirror = 0; r->sx = sz; r->sz = sx; break;
case 2: r->rotation = 0; r->mirror = 1; r->sx = sx; r->sz = sz; break;
case 3: r->rotation = 1; r->mirror = 1; r->sx = sz; r->sz = sx; break;
}
return 1;
case Desert_Pyramid:
sx = 21; sy = 15; sz = 21;
goto L_rotate_temple;

View File

@ -85,8 +85,9 @@ STRUCT(StructureVariant)
uint8_t giant :1; // giant portal variant
uint8_t underground :1; // underground portal
uint8_t airpocket :1; // portal with air pocket
uint8_t basement :1; // igloo with basement
uint8_t cracked :1; // geode with crack
uint8_t size; // geode size
uint8_t size; // geode size | igloo middel pieces
uint8_t start; // starting piece index
short biome; // biome variant
uint8_t rotation; // 0:0, 1:cw90, 2:cw180, 3:cw270=ccw90