the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 94 lines 2.8 kB view raw
1#pragma once 2 3#include "Biome.h" 4class ProgressListener; 5class TilePos; 6 7// The maximum number of chunks that we can store 8#ifdef _LARGE_WORLDS 9// 4J Stu - Our default map (at zoom level 3) is 1024x1024 blocks (or 64 chunks) 10#define LEVEL_MAX_WIDTH (5*64) //(6*54) 11 12#define LEVEL_WIDTH_CLASSIC 54 13#define LEVEL_WIDTH_SMALL 64 14#define LEVEL_WIDTH_MEDIUM (3*64) 15#define LEVEL_WIDTH_LARGE (5*64) 16 17#else 18#define LEVEL_MAX_WIDTH 54 19#endif 20#define LEVEL_MIN_WIDTH 54 21#define LEVEL_LEGACY_WIDTH 54 22 23 24 25// Scale was 8 in the Java game, but that would make our nether tiny 26// Every 1 block you move in the nether maps to HELL_LEVEL_SCALE blocks in the overworld 27#ifdef _LARGE_WORLDS 28#define HELL_LEVEL_MAX_SCALE 8 29 30#define HELL_LEVEL_SCALE_CLASSIC 3 31#define HELL_LEVEL_SCALE_SMALL 3 32#define HELL_LEVEL_SCALE_MEDIUM 6 33#define HELL_LEVEL_SCALE_LARGE 8 34 35#else 36#define HELL_LEVEL_MAX_SCALE 3 37#endif 38#define HELL_LEVEL_MIN_SCALE 3 39#define HELL_LEVEL_LEGACY_SCALE 3 40 41#define HELL_LEVEL_MAX_WIDTH (LEVEL_MAX_WIDTH / HELL_LEVEL_MAX_SCALE) 42#define HELL_LEVEL_MIN_WIDTH 18 43 44#define END_LEVEL_SCALE 3 45// 4J Stu - Fix the size of the end for all platforms 46// 54 / 3 = 18 47#define END_LEVEL_MAX_WIDTH 18 48#define END_LEVEL_MIN_WIDTH 18 49//#define END_LEVEL_MAX_WIDTH (LEVEL_MAX_WIDTH / END_LEVEL_SCALE) 50 51class ChunkSource 52{ 53public: 54 // 4J Added so that we can store the maximum dimensions of this world 55 int m_XZSize; 56#ifdef _LARGE_WORLDS 57 bool m_classicEdgeMoat; 58 bool m_smallEdgeMoat; 59 bool m_mediumEdgeMoat; 60#endif 61 62public: 63 virtual ~ChunkSource() {} 64 65 virtual bool hasChunk(int x, int y) = 0; 66 virtual bool reallyHasChunk(int x, int y) { return hasChunk(x,y); } // 4J added 67 virtual LevelChunk *getChunk(int x, int z) = 0; 68 virtual void lightChunk(LevelChunk *lc) {} // 4J added 69 virtual LevelChunk *create(int x, int z) = 0; 70 virtual void postProcess(ChunkSource *parent, int x, int z) = 0; 71 virtual bool saveAllEntities() { return false; } // 4J Added 72 virtual bool save(bool force, ProgressListener *progressListener) = 0; 73 virtual bool tick() = 0; 74 virtual bool shouldSave() = 0; 75 76 virtual LevelChunk **getCache() { return NULL; } // 4J added 77 virtual void dataReceived(int x, int z) {} // 4J added 78 79 /** 80 * Returns some stats that are rendered when the user holds F3. 81 */ 82 virtual wstring gatherStats() = 0; 83 84 virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z) = 0; 85 virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) = 0; 86 87 /** 88 * Recreates "logic structures" for a chunk that has been loaded from disk. 89 * For example, fortress bridges in the Nether. 90 */ 91 virtual void recreateLogicStructuresForChunk(int chunkX, int chunkZ) = 0; 92 93 // virtual void flushSave() = 0; // 4J removed 94};