From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/MineShaftFeature.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Minecraft.World/MineShaftFeature.cpp (limited to 'Minecraft.World/MineShaftFeature.cpp') 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 -- cgit v1.2.3