Skip to content

Commit

Permalink
support checking for igloos with basement
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubitect committed May 21, 2023
1 parent 960d5d6 commit f2c9630
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions finders.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion finders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2c9630

Please sign in to comment.