Updated cubiomes and structures for 1.18.

This commit is contained in:
Cubitect 2021-11-28 12:43:35 +01:00
parent 40019c560b
commit c113d3d731
7 changed files with 93 additions and 45 deletions

@ -1 +1 @@
Subproject commit 71ca41e171749799978f3473a052427c9b9f9c96
Subproject commit 18a16f800033771898f884eac8d3e62bc776f433

View File

@ -55,7 +55,6 @@ SOURCES += \
HEADERS += \
$$CUPATH/finders.h \
$$CUPATH/generator.h \
$$CUPATH/javarnd.h \
$$CUPATH/layers.h \
$$CUPATH/util.h \
src/aboutdialog.h \

View File

@ -5,7 +5,7 @@
#define VERS_MAJOR 1
#define VERS_MINOR 11
#define VERS_PATCH -1 // negative patch number designates a development version
#define VERS_PATCH 0 // negative patch number designates a development version
// returns +1 if newer, -1 if older and 0 if equal
inline int cmpVers(int major, int minor, int patch)

View File

@ -26,7 +26,16 @@
</property>
<widget class="QFrame" name="controlFrame">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -39,10 +48,17 @@
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="lineY"/>
<widget class="QLineEdit" name="lineY">
<property name="toolTip">
<string>Show map for this y-level</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelY">
<property name="toolTip">
<string>Show map for this y-level</string>
</property>
<property name="text">
<string>Y:</string>
</property>
@ -229,7 +245,16 @@
<string>Search</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@ -275,8 +300,8 @@ QToolButton {
<rect>
<x>0</x>
<y>0</y>
<width>1233</width>
<height>676</height>
<width>1232</width>
<height>669</height>
</rect>
</property>
<property name="sizePolicy">
@ -601,7 +626,16 @@ QSplitter {
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@ -668,7 +702,7 @@ QToolButton:checked {
<x>0</x>
<y>0</y>
<width>1280</width>
<height>23</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuMap">

View File

@ -51,24 +51,31 @@ void getStructs(std::vector<VarPos> *out, const StructureConfig sconf,
if (p.x >= x0 && p.x < x1 && p.z >= z0 && p.z < z1)
{
int id = isViableStructurePos(sconf.structType, &g, p.x, p.z);
if (id && sconf.structType == End_City)
int id = isViableStructurePos(sconf.structType, &g, p.x, p.z, 0);
if (!id)
continue;
if (sconf.structType == End_City)
{
SurfaceNoise sn;
initSurfaceNoiseEnd(&sn, wi.seed);
id = isViableEndCityTerrain(&g.en, &sn, p.x, p.z);
if (!id)
continue;
}
else if (g.mc >= MC_1_18)
{
if (!isViableStructureTerrain(sconf.structType, &g, p.x, p.z))
continue;
}
if (id)
VarPos vp = { p, 0 };
if (sconf.structType == Village)
{
VarPos vp = { p, 0 };
if (sconf.structType == Village)
{
VillageType vt = getVillageType(wi.mc, wi.seed, p.x, p.z, id);
vp.variant = vt.abandoned;
}
out->push_back(vp);
VillageType vt = getVillageType(wi.mc, wi.seed, p.x, p.z, id);
vp.variant = vt.abandoned;
}
out->push_back(vp);
}
}
}
@ -810,14 +817,6 @@ void QWorld::draw(QPainter& painter, int vw, int vh, qreal focusx, qreal focusz,
painter.drawPixmapFragments(frags.data(), frags.size(), icons[D_STRONGHOLD]);
}
for (int li = lvb.size()-1; li >= 0; --li)
{
Level& l = lvb[li];
if (li == activelv || li == activelv+1)
l.update(cachedbiomes, bx0, bz0, bx1, bz1);
else
l.update(cachedbiomes, 0, 0, 0, 0);
}
for (int sopt = D_DESERT; sopt < D_SPAWN; sopt++)
{
Level& l = lvs[sopt];
@ -826,6 +825,14 @@ void QWorld::draw(QPainter& painter, int vw, int vh, qreal focusx, qreal focusz,
else if (activelv > l.viewlv+1)
l.update(cachedstruct, 0, 0, 0, 0);
}
for (int li = lvb.size()-1; li >= 0; --li)
{
Level& l = lvb[li];
if (li == activelv || li == activelv+1)
l.update(cachedbiomes, bx0, bz0, bx1, bz1);
else
l.update(cachedbiomes, 0, 0, 0, 0);
}
// start the spawn and stronghold worker thread if this is the first run
if (spawn == NULL)

View File

@ -467,7 +467,7 @@ L_qm_any:
continue;
}
gen->init4Dim(finfo.dim);
if (!isViableStructurePos(st, &gen->g, pc.x, pc.z))
if (!isViableStructurePos(st, &gen->g, pc.x, pc.z, 0))
continue;
if (st == End_City)
{
@ -476,6 +476,11 @@ L_qm_any:
&gen->g.en, &gen->sn, pc.x, pc.z))
continue;
}
else if (gen->mc >= MC_1_18)
{
if (!isViableStructureTerrain(st, &gen->g, pc.x, pc.z))
continue;
}
xt += pc.x;
zt += pc.z;
n++;
@ -793,10 +798,10 @@ void findQuadStructs(int styp, Generator *g, QVector<QuadInfo> *out)
getStructurePos(styp, g->mc, g->seed, qr.x+0, qr.z+1, qs+1);
getStructurePos(styp, g->mc, g->seed, qr.x+1, qr.z+0, qs+2);
getStructurePos(styp, g->mc, g->seed, qr.x+1, qr.z+1, qs+3);
if (isViableStructurePos(styp, g, qs[0].x, qs[0].z) &&
isViableStructurePos(styp, g, qs[1].x, qs[1].z) &&
isViableStructurePos(styp, g, qs[2].x, qs[2].z) &&
isViableStructurePos(styp, g, qs[3].x, qs[3].z))
if (isViableStructurePos(styp, g, qs[0].x, qs[0].z, 0) &&
isViableStructurePos(styp, g, qs[1].x, qs[1].z, 0) &&
isViableStructurePos(styp, g, qs[2].x, qs[2].z, 0) &&
isViableStructurePos(styp, g, qs[3].x, qs[3].z, 0))
{
QuadInfo qinfo;
for (int j = 0; j < 4; j++)
@ -827,10 +832,10 @@ void findQuadStructs(int styp, Generator *g, QVector<QuadInfo> *out)
getStructurePos(styp, g->mc, g->seed, qr.x+0, qr.z+1, qs+1);
getStructurePos(styp, g->mc, g->seed, qr.x+1, qr.z+0, qs+2);
getStructurePos(styp, g->mc, g->seed, qr.x+1, qr.z+1, qs+3);
if (isViableStructurePos(styp, g, qs[0].x, qs[0].z) &&
isViableStructurePos(styp, g, qs[1].x, qs[1].z) &&
isViableStructurePos(styp, g, qs[2].x, qs[2].z) &&
isViableStructurePos(styp, g, qs[3].x, qs[3].z))
if (isViableStructurePos(styp, g, qs[0].x, qs[0].z, 0) &&
isViableStructurePos(styp, g, qs[1].x, qs[1].z, 0) &&
isViableStructurePos(styp, g, qs[2].x, qs[2].z, 0) &&
isViableStructurePos(styp, g, qs[3].x, qs[3].z, 0))
{
QuadInfo qinfo;
for (int j = 0; j < 4; j++)

View File

@ -300,25 +300,25 @@ static const struct FilterList
"Nether biomes after voronoi scaling to 1:1."
};
list[F_BIOME_NETHER_4] = FilterInfo{
CAT_NETHER, 0, 1, 1, 0, 0, 4, 0, MC_1_16, MC_NEWEST, -1, 1, disp++,
CAT_NETHER, 0, 1, 1, 0, 0, 4, 0, MC_1_16, MC_NEWEST, -1, 0, disp++,
":icons/nether.png",
"Nether biome filter 1:4",
"Nether biomes with normal noise sampling at scale 1:4."
};
list[F_BIOME_NETHER_16] = FilterInfo{
CAT_NETHER, 0, 1, 1, 0, 0, 16, 0, MC_1_16, MC_NEWEST, -1, 1, disp++,
CAT_NETHER, 0, 1, 1, 0, 0, 16, 0, MC_1_16, MC_NEWEST, -1, 0, disp++,
":icons/nether.png",
"Nether biome filter 1:16",
"Nether biomes, but only sampled at scale 1:16."
};
list[F_BIOME_NETHER_64] = FilterInfo{
CAT_NETHER, 0, 1, 1, 0, 0, 64, 0, MC_1_16, MC_NEWEST, -1, 1, disp++,
CAT_NETHER, 0, 1, 1, 0, 0, 64, 0, MC_1_16, MC_NEWEST, -1, 0, disp++,
":icons/nether.png",
"Nether biome filter 1:64",
"Nether biomes, but only sampled at scale 1:64."
};
list[F_BIOME_NETHER_256] = FilterInfo{
CAT_NETHER, 0, 1, 1, 0, 0, 256, 0, MC_1_16, MC_NEWEST, -1, 1, disp++,
CAT_NETHER, 0, 1, 1, 0, 0, 256, 0, MC_1_16, MC_NEWEST, -1, 0, disp++,
":icons/nether.png",
"Nether biome filter 1:256",
"Nether biomes, but only sampled at scale 1:256."
@ -388,14 +388,16 @@ static const struct FilterList
CAT_STRUCT, 1, 1, 1, 0, Desert_Pyramid, 1, 1, MC_1_3, MC_NEWEST, 0, 0, disp++,
":icons/desert.png",
"Desert pyramid",
""
"In version 1.18, desert pyramids depend on surface height and may fail to "
"generate near caves/aquifers, rivers and oceans."
};
list[F_JUNGLE] = FilterInfo{
CAT_STRUCT, 1, 1, 1, 0, Jungle_Pyramid, 1, 1, MC_1_3, MC_NEWEST, 0, 0, disp++,
CAT_STRUCT, 1, 1, 1, 0, Jungle_Temple, 1, 1, MC_1_3, MC_NEWEST, 0, 0, disp++,
":icons/jungle.png",
"Jungle temple",
""
"In version 1.18, jungle temples depend on surface height and may fail to "
"generate near caves/aquifers, rivers and oceans."
};
list[F_HUT] = FilterInfo{
@ -423,7 +425,8 @@ static const struct FilterList
CAT_STRUCT, 1, 1, 1, 0, Mansion, 1, 1, MC_1_11, MC_NEWEST, 0, 0, disp++,
":icons/mansion.png",
"Woodland mansion",
""
"In version 1.18, mansions depend on surface height and may fail to "
"generate near caves/aquifers, rivers and oceans."
};
list[F_RUINS] = FilterInfo{