diff --git a/finders.c b/finders.c index 83f6a6e..90315a7 100644 --- a/finders.c +++ b/finders.c @@ -113,6 +113,16 @@ Pos getStructurePos(StructureConfig config, int64_t seed, int regX, int regZ, in if (valid) *valid = 1; } } + else if (config.properties == CHUNK_STRUCT) + { + pos.x = (regX << 4) + 9; + pos.z = (regZ << 4) + 9; + if (valid) + { + if (config.structType == Treasure) + *valid = isTreasureChunk(seed, regX, regZ); + } + } return pos; } @@ -1337,8 +1347,7 @@ int isViableFeatureBiome(int mc, int structureType, int biomeID) case Treasure: if (mc < MC_1_13) return 0; - return (biomeID == beach || biomeID == snowy_beach || - biomeID == stone_shore || biomeID == mushroom_field_shore); + return biomeID == beach || biomeID == snowy_beach; case Monument: if (mc < MC_1_8) return 0; @@ -1452,6 +1461,10 @@ static int mapViableBiome(const Layer * l, int * out, int x, int z, int w, int h if (biomeID == snowy_tundra || biomeID == snowy_taiga) return 0; break; + case Treasure: + if (isOceanic(biomeID)) + return 0; + break; case Ocean_Ruin: case Shipwreck: case Monument: @@ -1497,6 +1510,7 @@ static int mapViableShore(const Layer * l, int * out, int x, int z, int w, int h case Village: case Monument: case Mansion: + case Treasure: if (isViableFeatureBiome(mc, styp, biomeID)) return 0; break; diff --git a/finders.h b/finders.h index f563a4e..365f808 100644 --- a/finders.h +++ b/finders.h @@ -90,7 +90,7 @@ static const StructureConfig MANSION_CONFIG = { 10387319, 80, 60, Mansion static const StructureConfig RUINED_PORTAL_CONFIG = { 34222645, 40, 25, Ruined_Portal, 0}; // overworld variant // structures that check each chunk individually -static const StructureConfig TREASURE_CONFIG = { 10387320, 1, 0, Treasure, CHUNK_STRUCT}; +static const StructureConfig TREASURE_CONFIG = { 10387320, 1, 1, Treasure, CHUNK_STRUCT}; //============================================================================== // Biome Tables