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/GameRules/ConsoleGenerateStructure.cpp | |
| 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/GameRules/ConsoleGenerateStructure.cpp')
| -rw-r--r-- | Minecraft.Client/Common/GameRules/ConsoleGenerateStructure.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Minecraft.Client/Common/GameRules/ConsoleGenerateStructure.cpp b/Minecraft.Client/Common/GameRules/ConsoleGenerateStructure.cpp index f505ce7a..dd777682 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleGenerateStructure.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleGenerateStructure.cpp @@ -10,7 +10,7 @@ ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0) { m_x = m_y = m_z = 0; - boundingBox = NULL; + boundingBox = nullptr; orientation = Direction::NORTH; m_dimension = 0; } @@ -25,26 +25,26 @@ void ConsoleGenerateStructure::getChildren(vector<GameRuleDefinition *> *childre GameRuleDefinition *ConsoleGenerateStructure::addChild(ConsoleGameRules::EGameRuleType ruleType) { - GameRuleDefinition *rule = NULL; + GameRuleDefinition *rule = nullptr; if(ruleType == ConsoleGameRules::eGameRuleType_GenerateBox) { rule = new XboxStructureActionGenerateBox(); - m_actions.push_back((XboxStructureActionGenerateBox *)rule); + m_actions.push_back(static_cast<XboxStructureActionGenerateBox *>(rule)); } else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceBlock) { rule = new XboxStructureActionPlaceBlock(); - m_actions.push_back((XboxStructureActionPlaceBlock *)rule); + m_actions.push_back(static_cast<XboxStructureActionPlaceBlock *>(rule)); } else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceContainer) { rule = new XboxStructureActionPlaceContainer(); - m_actions.push_back((XboxStructureActionPlaceContainer *)rule); + m_actions.push_back(static_cast<XboxStructureActionPlaceContainer *>(rule)); } else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceSpawner) { rule = new XboxStructureActionPlaceSpawner(); - m_actions.push_back((XboxStructureActionPlaceSpawner *)rule); + m_actions.push_back(static_cast<XboxStructureActionPlaceSpawner *>(rule)); } else { @@ -112,7 +112,7 @@ void ConsoleGenerateStructure::addAttribute(const wstring &attributeName, const BoundingBox* ConsoleGenerateStructure::getBoundingBox() { - if(boundingBox == NULL) + if(boundingBox == nullptr) { // Find the max bounds int maxX, maxY, maxZ; @@ -139,25 +139,25 @@ bool ConsoleGenerateStructure::postProcess(Level *level, Random *random, Boundin { case ConsoleGameRules::eGameRuleType_GenerateBox: { - XboxStructureActionGenerateBox *genBox = (XboxStructureActionGenerateBox *)action; + XboxStructureActionGenerateBox *genBox = static_cast<XboxStructureActionGenerateBox *>(action); genBox->generateBoxInLevel(this,level,chunkBB); } break; case ConsoleGameRules::eGameRuleType_PlaceBlock: { - XboxStructureActionPlaceBlock *pPlaceBlock = (XboxStructureActionPlaceBlock *)action; + XboxStructureActionPlaceBlock *pPlaceBlock = static_cast<XboxStructureActionPlaceBlock *>(action); pPlaceBlock->placeBlockInLevel(this,level,chunkBB); } break; case ConsoleGameRules::eGameRuleType_PlaceContainer: { - XboxStructureActionPlaceContainer *pPlaceContainer = (XboxStructureActionPlaceContainer *)action; + XboxStructureActionPlaceContainer *pPlaceContainer = static_cast<XboxStructureActionPlaceContainer *>(action); pPlaceContainer->placeContainerInLevel(this,level,chunkBB); } break; case ConsoleGameRules::eGameRuleType_PlaceSpawner: { - XboxStructureActionPlaceSpawner *pPlaceSpawner = (XboxStructureActionPlaceSpawner *)action; + XboxStructureActionPlaceSpawner *pPlaceSpawner = static_cast<XboxStructureActionPlaceSpawner *>(action); pPlaceSpawner->placeSpawnerInLevel(this,level,chunkBB); } break; |
