aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MineShaftFeature.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/MineShaftFeature.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/MineShaftFeature.cpp')
-rw-r--r--Minecraft.World/MineShaftFeature.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Minecraft.World/MineShaftFeature.cpp b/Minecraft.World/MineShaftFeature.cpp
new file mode 100644
index 00000000..ac4d0c3f
--- /dev/null
+++ b/Minecraft.World/MineShaftFeature.cpp
@@ -0,0 +1,23 @@
+#include "stdafx.h"
+#include "net.minecraft.world.level.levelgen.structure.h"
+#include "JavaMath.h"
+
+bool MineShaftFeature::isFeatureChunk(int x, int z, bool bIsSuperflat)
+{
+ bool forcePlacement = false;
+ LevelGenerationOptions *levelGenOptions = app.getLevelGenerationOptions();
+ if( levelGenOptions != NULL )
+ {
+ forcePlacement = levelGenOptions->isFeatureChunk(x,z,eFeature_Mineshaft);
+ }
+
+ return forcePlacement || (random->nextInt(100) == 0 && random->nextInt(80) < max(abs(x), abs(z)));
+}
+
+StructureStart *MineShaftFeature::createStructureStart(int x, int z)
+{
+ // 4J added
+ app.AddTerrainFeaturePosition(eTerrainFeature_Mineshaft,x,z);
+
+ return new MineShaftStart(level, random, x, z);
+} \ No newline at end of file