diff options
| author | ModMaker101 <119018978+ModMaker101@users.noreply.github.com> | 2026-03-07 21:56:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-08 09:56:03 +0700 |
| commit | a9be52c41a02d207233199e98898fe7483d7e817 (patch) | |
| tree | 71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.World/CommonStats.cpp | |
| parent | 1be5faaea781402e7de06b263eeca4c688b7712c (diff) | |
Project modernization (#630)
* 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
Diffstat (limited to 'Minecraft.World/CommonStats.cpp')
| -rw-r--r-- | Minecraft.World/CommonStats.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Minecraft.World/CommonStats.cpp b/Minecraft.World/CommonStats.cpp index abef92aa..5ad0e35b 100644 --- a/Minecraft.World/CommonStats.cpp +++ b/Minecraft.World/CommonStats.cpp @@ -50,26 +50,26 @@ Stat* CommonStats::get_killsNetherZombiePigman() { return Stats::killsNetherZomb Stat *CommonStats::get_breedEntity(eINSTANCEOF mobType) { if (mobType == eTYPE_COW) return GenericStats::repopulation(); - else return NULL; + else return nullptr; } Stat *CommonStats::get_tamedEntity(eINSTANCEOF mobType) { if (mobType == eTYPE_OCELOT) return GenericStats::lionTamer(); else if (mobType == eTYPE_WOLF) return Stats::befriendsWolf; - else return NULL; + else return nullptr; } Stat *CommonStats::get_craftedEntity(eINSTANCEOF mobType) { if (mobType == eTYPE_VILLAGERGOLEM) return GenericStats::bodyGuard(); - else return NULL; + else return nullptr; } Stat *CommonStats::get_shearedEntity(eINSTANCEOF mobType) { if (mobType == eTYPE_SHEEP) return GenericStats::haveAShearfulDay(); - else return NULL; + else return nullptr; } Stat *CommonStats::get_totalBlocksMined() { return Stats::totalBlocksMined; } @@ -81,7 +81,7 @@ Stat* CommonStats::get_blocksPlaced(int blockId) #if (defined _EXTENDED_ACHIEVEMENTS) && (!defined _XBOX_ONE) return Stats::blocksPlaced[blockId]; #else - return NULL; + return nullptr; #endif } @@ -97,7 +97,7 @@ Stat *CommonStats::get_itemsCollected(int itemId, int itemAux) #endif if (itemId != Item::emerald_Id) return Stats::itemsCollected[itemId]; - else return NULL; + else return nullptr; } Stat *CommonStats::get_itemsCrafted(int itemId) { return Stats::itemsCrafted[itemId]; } @@ -111,7 +111,7 @@ Stat *CommonStats::get_itemsUsed(int itemId) if (itemId == Item::porkChop_cooked_Id) return Stats::blocksPlaced[itemId]; #endif - return NULL; + return nullptr; } Stat *CommonStats::get_itemsBought(int itemId) @@ -121,7 +121,7 @@ Stat *CommonStats::get_itemsBought(int itemId) // StatArray for Items Bought. if (itemId == Item::emerald_Id) return Stats::itemsCollected[itemId]; - else return NULL; + else return nullptr; } Stat *CommonStats::get_killsEnderdragon() { return Stats::killsEnderdragon; } @@ -133,7 +133,7 @@ Stat *CommonStats::get_enteredBiome(int biomeId) #if (defined _EXTENDED_ACHIEVEMENTS) && (!defined _XBOX_ONE) return Stats::biomesVisisted[biomeId]; #else - return NULL; + return nullptr; #endif } @@ -171,7 +171,7 @@ Stat *CommonStats::get_achievement(eAward achievementId) #ifndef _XBOX case eAward_snipeSkeleton: return (Stat *) Achievements::snipeSkeleton; case eAward_diamonds: return (Stat *) Achievements::diamonds; - case eAward_portal: return (Stat *) NULL; // TODO + case eAward_portal: return (Stat *) nullptr; // TODO case eAward_ghast: return (Stat *) Achievements::ghast; case eAward_blazeRod: return (Stat *) Achievements::blazeRod; case eAward_potion: return (Stat *) Achievements::potion; @@ -205,7 +205,7 @@ Stat *CommonStats::get_achievement(eAward achievementId) case eAward_lionTamer: return (Stat *) Achievements::lionTamer; #endif - default: return (Stat *) NULL; + default: return (Stat *) nullptr; } } @@ -286,7 +286,7 @@ byteArray CommonStats::getParam_noArgs() byteArray CommonStats::makeParam(int count) { - byteArray out( sizeof(int) ); + byteArray out( static_cast<unsigned int>(sizeof(int)) ); memcpy(out.data,&count,sizeof(int)); return out; } |
