the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "LargeFeature.h"
3#include "StructureFeatureSavedData.h"
4
5class StructureStart;
6
7//#define ENABLE_STRUCTURE_SAVING
8
9class StructureFeature : public LargeFeature
10{
11public:
12 // 4J added - Maps to values in the game rules xml
13 enum EFeatureTypes
14 {
15 eFeature_Mineshaft,
16 eFeature_NetherBridge,
17 eFeature_Temples,
18 eFeature_Stronghold,
19 eFeature_Village,
20 };
21
22#ifdef ENABLE_STRUCTURE_SAVING
23private:
24 shared_ptr<StructureFeatureSavedData> savedData;
25#endif
26
27
28protected:
29 unordered_map<__int64, StructureStart *> cachedStructures;
30
31public:
32 StructureFeature();
33 ~StructureFeature();
34
35 virtual wstring getFeatureName() = 0;
36
37 virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks);
38
39 bool postProcess(Level *level, Random *random, int chunkX, int chunkZ);
40 bool isIntersection(int cellX, int cellZ);
41
42 bool isInsideFeature(int cellX, int cellY, int cellZ);
43
44protected:
45 StructureStart *getStructureAt(int cellX, int cellY, int cellZ);
46
47public:
48 bool isInsideBoundingFeature(int cellX, int cellY, int cellZ);
49 TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ);
50
51protected:
52 vector<TilePos> *getGuesstimatedFeaturePositions();
53
54private:
55 virtual void restoreSavedData(Level *level);
56 virtual void saveFeature(int chunkX, int chunkZ, StructureStart *feature);
57
58 /**
59 * Returns true if the given chunk coordinates should hold a structure
60 * source.
61 *
62 * @param x
63 * chunk x
64 * @param z
65 * chunk z
66 * @return
67 */
68protected:
69 virtual bool isFeatureChunk(int x, int z, bool bIsSuperflat=false) = 0;
70
71 /**
72 * Creates a new instance of a structure source at the given chunk
73 * coordinates.
74 *
75 * @param x
76 * chunk x
77 * @param z
78 * chunk z
79 * @return
80 */
81 virtual StructureStart *createStructureStart(int x, int z) = 0;
82};