diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/StructureFeature.h | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/StructureFeature.h')
| -rw-r--r-- | Minecraft.World/StructureFeature.h | 70 |
1 files changed, 47 insertions, 23 deletions
diff --git a/Minecraft.World/StructureFeature.h b/Minecraft.World/StructureFeature.h index 642e6aad..ace5593d 100644 --- a/Minecraft.World/StructureFeature.h +++ b/Minecraft.World/StructureFeature.h @@ -1,7 +1,11 @@ #pragma once #include "LargeFeature.h" +#include "StructureFeatureSavedData.h" + class StructureStart; +//#define ENABLE_STRUCTURE_SAVING + class StructureFeature : public LargeFeature { public: @@ -15,44 +19,64 @@ public: eFeature_Village, }; +#ifdef ENABLE_STRUCTURE_SAVING +private: + shared_ptr<StructureFeatureSavedData> savedData; +#endif + + protected: unordered_map<__int64, StructureStart *> cachedStructures; public: + StructureFeature(); ~StructureFeature(); + virtual wstring getFeatureName() = 0; + virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); - bool postProcess(Level *level, Random *random, int chunkX, int chunkZ); - bool isIntersection(int cellX, int cellZ); + bool postProcess(Level *level, Random *random, int chunkX, int chunkZ); + bool isIntersection(int cellX, int cellZ); bool isInsideFeature(int cellX, int cellY, int cellZ); + +protected: + StructureStart *getStructureAt(int cellX, int cellY, int cellZ); + +public: + bool isInsideBoundingFeature(int cellX, int cellY, int cellZ); TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ); + protected: vector<TilePos> *getGuesstimatedFeaturePositions(); - /** - * Returns true if the given chunk coordinates should hold a structure - * source. - * - * @param x - * chunk x - * @param z - * chunk z - * @return - */ +private: + virtual void restoreSavedData(Level *level); + virtual void saveFeature(int chunkX, int chunkZ, StructureStart *feature); + + /** + * Returns true if the given chunk coordinates should hold a structure + * source. + * + * @param x + * chunk x + * @param z + * chunk z + * @return + */ protected: virtual bool isFeatureChunk(int x, int z, bool bIsSuperflat=false) = 0; - /** - * Creates a new instance of a structure source at the given chunk - * coordinates. - * - * @param x - * chunk x - * @param z - * chunk z - * @return - */ - virtual StructureStart *createStructureStart(int x, int z) = 0; + /** + * Creates a new instance of a structure source at the given chunk + * coordinates. + * + * @param x + * chunk x + * @param z + * chunk z + * @return + */ + virtual StructureStart *createStructureStart(int x, int z) = 0; }; |
