Fix cascading worldgen caused by Oreberries (#275)

Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
Charsy89andMartin Robertz authored and GitHub committed 2026-06-07 16:28:31 +00:00
1 parent 035c6d69d4
commit ed248b2418
1 file changed
+12 -12
@@ -96,9 +96,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (PHConstruct.generateIronBush && random.nextInt(PHConstruct.ironBushRarity + 1) == 0) { if (PHConstruct.generateIronBush && random.nextInt(PHConstruct.ironBushRarity + 1) == 0) {
for (int i = 0; i < PHConstruct.ironBushDensity; i++) { for (int i = 0; i < PHConstruct.ironBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = PHConstruct.seaLevel - 32; yPos = PHConstruct.seaLevel - 32;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.seaLevel, 0); yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.seaLevel, 0);
if (yPos != -1) { if (yPos != -1) {
/* /*
@@ -111,9 +111,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
} }
if (PHConstruct.generateGoldBush && random.nextInt(PHConstruct.goldBushRarity + 1) == 0) { if (PHConstruct.generateGoldBush && random.nextInt(PHConstruct.goldBushRarity + 1) == 0) {
for (int i = 0; i < PHConstruct.goldBushDensity; i++) { for (int i = 0; i < PHConstruct.goldBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = 16; yPos = 16;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation(world, xPos, yPos, zPos, 32, 0); yPos = findAdequateLocation(world, xPos, yPos, zPos, 32, 0);
if (yPos != -1) { if (yPos != -1) {
/* /*
@@ -130,9 +130,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
// 0) // 0)
{ {
for (int i = 0; i < PHConstruct.copperBushDensity; i++) { for (int i = 0; i < PHConstruct.copperBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = (PHConstruct.copperBushMaxY + PHConstruct.copperBushMinY) / 2; yPos = (PHConstruct.copperBushMaxY + PHConstruct.copperBushMinY) / 2;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation( yPos = findAdequateLocation(
world, world,
xPos, xPos,
@@ -154,9 +154,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
// == 0) // == 0)
{ {
for (int i = 0; i < PHConstruct.tinBushDensity; i++) { for (int i = 0; i < PHConstruct.tinBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = (PHConstruct.tinBushMaxY + PHConstruct.tinBushMinY) / 2; yPos = (PHConstruct.tinBushMaxY + PHConstruct.tinBushMinY) / 2;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.tinBushMaxY, PHConstruct.tinBushMinY); yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.tinBushMaxY, PHConstruct.tinBushMinY);
if (yPos != -1) { if (yPos != -1) {
/* /*
@@ -173,9 +173,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
// 0) // 0)
{ {
for (int i = 0; i < PHConstruct.aluminumBushDensity; i++) { for (int i = 0; i < PHConstruct.aluminumBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = (PHConstruct.aluminumBushMaxY + PHConstruct.aluminumBushMinY) / 2; yPos = (PHConstruct.aluminumBushMaxY + PHConstruct.aluminumBushMinY) / 2;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation( yPos = findAdequateLocation(
world, world,
xPos, xPos,
@@ -194,9 +194,9 @@ public class TBaseWorldGenerator implements IWorldGenerator {
} }
if (PHConstruct.generateEssenceBush && random.nextInt(PHConstruct.essenceBushRarity + 1) == 0) { if (PHConstruct.generateEssenceBush && random.nextInt(PHConstruct.essenceBushRarity + 1) == 0) {
for (int i = 0; i < PHConstruct.silverBushDensity; i++) { for (int i = 0; i < PHConstruct.silverBushDensity; i++) {
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16) + 8;
yPos = PHConstruct.seaLevel - 16; yPos = PHConstruct.seaLevel - 16;
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16) + 8;
yPos = findAdequateLocation(world, xPos, yPos, zPos, 32, 0); yPos = findAdequateLocation(world, xPos, yPos, zPos, 32, 0);
if (yPos != -1) { if (yPos != -1) {
/* /*