diff options
| author | ModMaker101 <119018978+ModMaker101@users.noreply.github.com> | 2026-03-08 19:08:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-08 18:08:36 -0500 |
| commit | 28614b922fb77149a54da1a87bebfbc98736f296 (patch) | |
| tree | 7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/Common/DLC/DLCGameRulesHeader.h | |
| parent | 88798b501d0cf6287b6f87acb2592676e3cec58d (diff) | |
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266
* Replaced every C-style cast with C++ ones
* Replaced every C-style cast with C++ ones
* Fixed boats falling and a TP glitch #266
* Updated NULL to nullptr and fixing some type issues
* Modernized and fixed a few bugs
- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.
* Fixing more conflicts
* Replace int loops with size_t and start work on overrides
* Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/Common/DLC/DLCGameRulesHeader.h')
| -rw-r--r-- | Minecraft.Client/Common/DLC/DLCGameRulesHeader.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h index 4521ae11..7409540d 100644 --- a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h +++ b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h @@ -14,29 +14,52 @@ private: 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;} + bool requiresTexturePack() override + {return m_bRequiresTexturePack;} + + UINT getRequiredTexturePackId() override + {return m_requiredTexturePackId;} + + wstring getDefaultSaveName() override + {return m_defaultSaveName;} + + LPCWSTR getWorldName() override + {return m_worldName.c_str();} + + LPCWSTR getDisplayName() override + {return m_displayName.c_str();} + + wstring getGrfPath() override + {return L"GameRules.grf";} + + void setRequiresTexturePack(bool x) override + {m_bRequiresTexturePack = x;} + + void setRequiredTexturePackId(UINT x) override + {m_requiredTexturePackId = x;} + + void setDefaultSaveName(const wstring &x) override + {m_defaultSaveName = x;} + + void setWorldName(const wstring & x) override + {m_worldName = x;} + + void setDisplayName(const wstring & x) override + {m_displayName = x;} + + void setGrfPath(const wstring & x) override + {m_grfPath = x;} LevelGenerationOptions *lgo; public: DLCGameRulesHeader(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + void addData(PBYTE pbData, DWORD dwBytes) override; + PBYTE getData(DWORD &dwBytes) override; void setGrfData(PBYTE fData, DWORD fSize, StringTable *); - virtual bool ready() { return m_hasData; } + bool ready() override + { return m_hasData; } };
\ No newline at end of file |
