mirror of
https://github.com/Cubitect/cubiomes.git
synced 2025-09-22 11:04:57 -04:00
Mineshafts for pre-1.13
This commit is contained in:
parent
cb66b41328
commit
3b65b4bbf7
22
finders.c
22
finders.c
@ -225,7 +225,7 @@ int getStructurePos(int structureType, int mc, uint64_t seed, int regX, int regZ
|
|||||||
case Mineshaft:
|
case Mineshaft:
|
||||||
pos->x = (int)( ((uint32_t)regX << 4) );
|
pos->x = (int)( ((uint32_t)regX << 4) );
|
||||||
pos->z = (int)( ((uint32_t)regZ << 4) );
|
pos->z = (int)( ((uint32_t)regZ << 4) );
|
||||||
return isMineshaftChunk(seed, regX, regZ);
|
return isMineshaftChunk(mc, seed, regX, regZ);
|
||||||
|
|
||||||
case Fortress:
|
case Fortress:
|
||||||
if (mc < MC_1_16) {
|
if (mc < MC_1_16) {
|
||||||
@ -261,15 +261,27 @@ int getStructurePos(int structureType, int mc, uint64_t seed, int regX, int regZ
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isMineshaftChunk(uint64_t seed, int chunkX, int chunkZ)
|
|
||||||
|
int isMineshaftChunk(int mc, uint64_t seed, int chunkX, int chunkZ)
|
||||||
{
|
{
|
||||||
uint64_t s;
|
uint64_t s;
|
||||||
setSeed(&s, seed);
|
setSeed(&s, seed);
|
||||||
uint64_t i = nextLong(&s);
|
uint64_t i = nextLong(&s);
|
||||||
uint64_t j = nextLong(&s);
|
uint64_t j = nextLong(&s);
|
||||||
s = chunkX * i ^ chunkZ * j ^ seed;
|
setSeed(&s, chunkX * i ^ chunkZ * j ^ seed);
|
||||||
setSeed(&s, s);
|
if (mc >= MC_1_13)
|
||||||
return nextDouble(&s) < 0.004;
|
{
|
||||||
|
return nextDouble(&s) < 0.004;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int d = chunkX;
|
||||||
|
if (-chunkX > d) d = -chunkX;
|
||||||
|
if (+chunkZ > d) d = +chunkZ;
|
||||||
|
if (-chunkZ > d) d = -chunkZ;
|
||||||
|
skipNextN(&s, 1);
|
||||||
|
return nextDouble(&s) < 0.004 && nextInt(&s, 80) < d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ Pos getLargeStructureChunkInRegion(StructureConfig config, uint64_t seed, int re
|
|||||||
* The placement and biome check within a valid chunk is at block position (9,9)
|
* The placement and biome check within a valid chunk is at block position (9,9)
|
||||||
* or at (2,2) with layer scale=4 from 1.16 onwards.
|
* or at (2,2) with layer scale=4 from 1.16 onwards.
|
||||||
*/
|
*/
|
||||||
int isMineshaftChunk(uint64_t seed, int chunkX, int chunkZ);
|
int isMineshaftChunk(int mc, uint64_t seed, int chunkX, int chunkZ);
|
||||||
|
|
||||||
// not exacly a structure
|
// not exacly a structure
|
||||||
static inline __attribute__((const))
|
static inline __attribute__((const))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user