From 32763937e2f3ca201a7e47315fd7a1f952209c12 Mon Sep 17 00:00:00 2001 From: starseed12345 <99209515+starseed12345@users.noreply.github.com> Date: Sat, 14 Mar 2026 12:54:52 +0100 Subject: [PATCH] Revert to original Stronghold I will keep the infinite world gen base like this so someone else can finish it off. I don't have the necessary skills to recode the entire codebase just for infinite terrain generation + correct structure placement --- Minecraft.World/ChunkSource.h | 1 + Minecraft.World/StrongholdFeature.cpp | 28 ++++++++------------------- Minecraft.World/StrongholdFeature.h | 7 ++----- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Minecraft.World/ChunkSource.h b/Minecraft.World/ChunkSource.h index f8fa73791..ffbb29efd 100644 --- a/Minecraft.World/ChunkSource.h +++ b/Minecraft.World/ChunkSource.h @@ -9,6 +9,7 @@ class TilePos; // 4J Stu - Our default map (at zoom level 3) is 1024x1024 blocks (or 64 chunks) //#define LEVEL_MAX_WIDTH (29999984 / 16) //1,874,999 chunks #define LEVEL_MAX_WIDTH (6 * 64) // Keep renderer sane + #define LEVEL_WIDTH_CLASSIC 54 #define LEVEL_WIDTH_SMALL 64 #define LEVEL_WIDTH_MEDIUM (3*64) diff --git a/Minecraft.World/StrongholdFeature.cpp b/Minecraft.World/StrongholdFeature.cpp index 14571c38f..83f05cf3f 100644 --- a/Minecraft.World/StrongholdFeature.cpp +++ b/Minecraft.World/StrongholdFeature.cpp @@ -33,17 +33,15 @@ void StrongholdFeature::staticCtor() void StrongholdFeature::_init() { - distance = 32; - spread = 3; + distance = 32; + spread = 3; - strongholdPos_length = 1; - - for (int i = 0; i < MAX_STRONGHOLDS; i++) - { - strongholdPos[i] = nullptr; - } - - isSpotSelected = false; + // 4J added initialisers + for (int i = 0; i < strongholdPos_length; i++) + { + strongholdPos[i] = nullptr; + } + isSpotSelected = false; } StrongholdFeature::StrongholdFeature() : StructureFeature() @@ -91,16 +89,6 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat) { if (!isSpotSelected) { -#ifdef _LARGE_WORLDS - if (level->dimension->getXZSize() >= LEVEL_WIDTH_INFINITE) - { - strongholdPos_length = 128; - } - else - { - strongholdPos_length = 1; - } -#endif Random random; random.setSeed(level->getSeed()); diff --git a/Minecraft.World/StrongholdFeature.h b/Minecraft.World/StrongholdFeature.h index 13c7e9083..57dc5e2df 100644 --- a/Minecraft.World/StrongholdFeature.h +++ b/Minecraft.World/StrongholdFeature.h @@ -29,11 +29,8 @@ private: static vector allowedBiomes; bool isSpotSelected; - //static const int strongholdPos_length = 1;// Java game has 3, but xbox game only has 1 because of the world size; // 4J added - //ChunkPos *strongholdPos[strongholdPos_length]; - static const int MAX_STRONGHOLDS = 128; - ChunkPos *strongholdPos[MAX_STRONGHOLDS]; - int strongholdPos_length; + static const int strongholdPos_length = 1;// Java game has 3, but xbox game only has 1 because of the world size; // 4J added + ChunkPos *strongholdPos[strongholdPos_length]; double distance; int spread;