From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/Common/DLC/DLCGameRulesHeader.h | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Minecraft.Client/Common/DLC/DLCGameRulesHeader.h (limited to 'Minecraft.Client/Common/DLC/DLCGameRulesHeader.h') diff --git a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h new file mode 100644 index 00000000..4521ae11 --- /dev/null +++ b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h @@ -0,0 +1,42 @@ +#pragma once + +#include "DLCGameRules.h" +#include "..\GameRules\LevelGenerationOptions.h" + +class DLCGameRulesHeader : public DLCGameRules, public JustGrSource +{ +private: + + // GR-Header + PBYTE m_pbData; + DWORD m_dwBytes; + + bool m_hasData; + +public: + virtual bool requiresTexturePack() {return m_bRequiresTexturePack;} + virtual UINT getRequiredTexturePackId() {return m_requiredTexturePackId;} + virtual wstring getDefaultSaveName() {return m_defaultSaveName;} + virtual LPCWSTR getWorldName() {return m_worldName.c_str();} + virtual LPCWSTR getDisplayName() {return m_displayName.c_str();} + virtual wstring getGrfPath() {return L"GameRules.grf";} + + virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;} + virtual void setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;} + virtual void setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;} + virtual void setWorldName(const wstring & x) {m_worldName = x;} + virtual void setDisplayName(const wstring & x) {m_displayName = x;} + virtual void setGrfPath(const wstring & x) {m_grfPath = x;} + + LevelGenerationOptions *lgo; + +public: + DLCGameRulesHeader(const wstring &path); + + virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual PBYTE getData(DWORD &dwBytes); + + void setGrfData(PBYTE fData, DWORD fSize, StringTable *); + + virtual bool ready() { return m_hasData; } +}; \ No newline at end of file -- cgit v1.2.3