the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 98 lines 2.5 kB view raw
1#pragma once 2using namespace std; 3 4#include "ChunkSource.h" 5 6class ProgressListener; 7class LargeFeature; 8class StrongholdFeature; 9class VillageFeature; 10class MineShaftFeature; 11class PerlinNoise; 12class RandomScatteredLargeFeature; 13 14class RandomLevelSource : public ChunkSource 15{ 16public: 17 static const double SNOW_CUTOFF; 18 static const double SNOW_SCALE; 19 static const bool FLOATING_ISLANDS = false; 20 static const int CHUNK_HEIGHT = 8; 21 static const int CHUNK_WIDTH = 4; 22 23private: 24 Random *random; 25 Random *pprandom; // 4J - added 26 27 PerlinNoise *lperlinNoise1; 28 PerlinNoise *lperlinNoise2; 29 PerlinNoise *perlinNoise1; 30 PerlinNoise *perlinNoise3; 31 32public: 33 PerlinNoise *scaleNoise; 34 PerlinNoise *depthNoise; 35 36private: 37 PerlinNoise *floatingIslandScale; 38 PerlinNoise *floatingIslandNoise; 39 40public: 41 PerlinNoise *forestNoise; 42 43private: 44 Level *level; 45 const bool generateStructures; 46 47 floatArray pows; 48 49public: 50 RandomLevelSource(Level *level, __int64 seed, bool generateStructures); 51 ~RandomLevelSource(); 52 53public: 54#ifdef _LARGE_WORLDS 55 int getMinDistanceToEdge(int xxx, int zzz, int worldSize, float falloffStart); 56 57#endif 58 float getHeightFalloff(int xxx, int zzz, int* pEMin); 59 void prepareHeights(int xOffs, int zOffs, byteArray blocks); 60 61public: 62 void buildSurfaces(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes); 63 64private: 65 LargeFeature *caveFeature; 66 StrongholdFeature *strongholdFeature; 67 VillageFeature *villageFeature; 68 MineShaftFeature *mineShaftFeature; 69 RandomScatteredLargeFeature *scatteredFeature; 70 LargeFeature *canyonFeature; 71private: 72 virtual LevelChunk *create(int x, int z); 73 74public: 75 virtual LevelChunk *getChunk(int xOffs, int zOffs); 76 virtual void lightChunk(LevelChunk *lc); // 4J added 77 78private: 79 doubleArray getHeights(doubleArray buffer, int x, int y, int z, int xSize, int ySize, int zSize, BiomeArray& biomes); 80 81public: 82 virtual bool hasChunk(int x, int y); 83 84private: 85 void calcWaterDepths(ChunkSource *parent, int xt, int zt); 86 87public: 88 virtual void postProcess(ChunkSource *parent, int xt, int zt); 89 virtual bool save(bool force, ProgressListener *progressListener); 90 virtual bool tick(); 91 virtual bool shouldSave(); 92 virtual wstring gatherStats(); 93 94public: 95 virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z); 96 virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); 97 virtual void recreateLogicStructuresForChunk(int chunkX, int chunkZ); 98};