diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h')
| -rw-r--r-- | Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h new file mode 100644 index 00000000..21c42dea --- /dev/null +++ b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h @@ -0,0 +1,51 @@ +#pragma once +#include "GameRuleDefinition.h" +#include "ConsoleSchematicFile.h" + +class AABB; +class Vec3; +class LevelChunk; +class LevelGenerationOptions; +class GRFObject; + +class ApplySchematicRuleDefinition : public GameRuleDefinition +{ +private: + LevelGenerationOptions *m_levelGenOptions; + wstring m_schematicName; + ConsoleSchematicFile *m_schematic; + Vec3 *m_location; + AABB *m_locationBox; + ConsoleSchematicFile::ESchematicRotation m_rotation; + int m_dimension; + + __int64 m_totalBlocksChanged; + __int64 m_totalBlocksChangedLighting; + bool m_completed; + + void updateLocationBox(); +public: + ApplySchematicRuleDefinition(LevelGenerationOptions *levelGenOptions); + ~ApplySchematicRuleDefinition(); + + virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; } + + virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); + + void processSchematic(AABB *chunkBox, LevelChunk *chunk); + void processSchematicLighting(AABB *chunkBox, LevelChunk *chunk); + + bool checkIntersects(int x0, int y0, int z0, int x1, int y1, int z1); + int getMinY(); + + bool isComplete() { return m_completed; } + + wstring getSchematicName() { return m_schematicName; } + + /** 4J-JEV: + * This GameRuleDefinition contains limited game state. + * Reset any state to how it should be before a new game. + */ + void reset(); +};
\ No newline at end of file |
