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/TileEntity.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/TileEntity.cpp')
| -rw-r--r-- | Minecraft.World/TileEntity.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/TileEntity.cpp b/Minecraft.World/TileEntity.cpp index 1eb9cab2..1fff44bb 100644 --- a/Minecraft.World/TileEntity.cpp +++ b/Minecraft.World/TileEntity.cpp @@ -46,11 +46,11 @@ void TileEntity::setId(tileEntityCreateFn createFn, eINSTANCEOF clas, wstring id TileEntity::TileEntity() { - level = NULL; + level = nullptr; x = y = z = 0; remove = false; data = -1; - tile = NULL; + tile = nullptr; renderRemoveStage = e_RenderRemoveStageKeep; } @@ -66,7 +66,7 @@ void TileEntity::setLevel(Level *level) bool TileEntity::hasLevel() { - return level != NULL; + return level != nullptr; } void TileEntity::load(CompoundTag *tag) @@ -101,7 +101,7 @@ shared_ptr<TileEntity> TileEntity::loadStatic(CompoundTag *tag) auto it = idCreateMap.find(tag->getString(L"id")); if (it != idCreateMap.end()) entity = shared_ptr<TileEntity>(it->second()); - if (entity != NULL) + if (entity != nullptr) { entity->load(tag); } @@ -129,11 +129,11 @@ void TileEntity::setData(int data, int updateFlags) void TileEntity::setChanged() { - if (level != NULL) + if (level != nullptr) { data = level->getData(x, y, z); level->tileEntityChanged(x, y, z, shared_from_this()); - if (getTile() != NULL) level->updateNeighbourForOutputSignal(x, y, z, getTile()->id); + if (getTile() != nullptr) level->updateNeighbourForOutputSignal(x, y, z, getTile()->id); } } @@ -152,7 +152,7 @@ double TileEntity::getViewDistance() Tile *TileEntity::getTile() { - if( tile == NULL ) tile = Tile::tiles[level->getTile(x, y, z)]; + if( tile == nullptr ) tile = Tile::tiles[level->getTile(x, y, z)]; return tile; } @@ -183,7 +183,7 @@ bool TileEntity::triggerEvent(int b0, int b1) void TileEntity::clearCache() { - tile = NULL; + tile = nullptr; data = -1; } |
