diff --git a/Minecraft.Client/Rendering/LevelRenderer.cpp b/Minecraft.Client/Rendering/LevelRenderer.cpp index 927a8b71f..d970c3f3b 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.cpp +++ b/Minecraft.Client/Rendering/LevelRenderer.cpp @@ -2482,7 +2482,7 @@ void LevelRenderer::renderHitOutline(std::shared_ptr player, AABB bb = Tile::tiles[tileId] ->getTileAABB(level[iPad], h->x, h->y, h->z) - ->grow(ss, ss, ss) + .grow(ss, ss, ss) .move(-xo, -yo, -zo); render(&bb); diff --git a/Minecraft.World/Blocks/CactusTile.cpp b/Minecraft.World/Blocks/CactusTile.cpp index 43aaa0062..229c52e6a 100644 --- a/Minecraft.World/Blocks/CactusTile.cpp +++ b/Minecraft.World/Blocks/CactusTile.cpp @@ -38,9 +38,9 @@ std::optional CactusTile::getAABB(Level* level, int x, int y, int z) { return AABB{x + r, static_cast(y), z + r, x + 1 - r, y + 1 - r, z + 1 - r}; } -AABB* CactusTile::getTileAABB(Level* level, int x, int y, int z) { +AABB CactusTile::getTileAABB(Level* level, int x, int y, int z) { float r = 1 / 16.0f; - return AABB::newTemp(x + r, y, z + r, x + 1 - r, y + 1, z + 1 - r); + return AABB(x + r, y, z + r, x + 1 - r, y + 1, z + 1 - r); } Icon* CactusTile::getTexture(int face, int data) { diff --git a/Minecraft.World/Blocks/CactusTile.h b/Minecraft.World/Blocks/CactusTile.h index ef0cf69f9..c35dc18a2 100644 --- a/Minecraft.World/Blocks/CactusTile.h +++ b/Minecraft.World/Blocks/CactusTile.h @@ -21,7 +21,7 @@ protected: public: virtual void tick(Level* level, int x, int y, int z, Random* random); virtual std::optional getAABB(Level* level, int x, int y, int z); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual Icon* getTexture(int face, int data); virtual bool isCubeShaped(); virtual bool isSolidRender(bool isServerLevel = false); diff --git a/Minecraft.World/Blocks/CakeTile.cpp b/Minecraft.World/Blocks/CakeTile.cpp index f35919594..53e2e41e3 100644 --- a/Minecraft.World/Blocks/CakeTile.cpp +++ b/Minecraft.World/Blocks/CakeTile.cpp @@ -42,12 +42,12 @@ std::optional CakeTile::getAABB(Level* level, int x, int y, int z) { return AABB{x + r2, static_cast(y), z + r, x + 1 - r, y + h - r, z + 1 - r}; } -AABB* CakeTile::getTileAABB(Level* level, int x, int y, int z) { +AABB CakeTile::getTileAABB(Level* level, int x, int y, int z) { int d = level->getData(x, y, z); float r = 1 / 16.0f; float r2 = (1 + d * 2) / 16.0f; float h = 8 / 16.0f; - return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r); + return AABB(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r); } Icon* CakeTile::getTexture(int face, int data) { diff --git a/Minecraft.World/Blocks/CakeTile.h b/Minecraft.World/Blocks/CakeTile.h index ebd33baf2..b2f2a3655 100644 --- a/Minecraft.World/Blocks/CakeTile.h +++ b/Minecraft.World/Blocks/CakeTile.h @@ -25,7 +25,7 @@ protected: TileEntity>()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); virtual std::optional getAABB(Level* level, int x, int y, int z); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual Icon* getTexture(int face, int data); //@Override void registerIcons(IconRegister* iconRegister); diff --git a/Minecraft.World/Blocks/CocoaTile.cpp b/Minecraft.World/Blocks/CocoaTile.cpp index 6250508a8..73449170d 100644 --- a/Minecraft.World/Blocks/CocoaTile.cpp +++ b/Minecraft.World/Blocks/CocoaTile.cpp @@ -62,7 +62,7 @@ std::optional CocoaTile::getAABB(Level* level, int x, int y, int z) { return DirectionalTile::getAABB(level, x, y, z); } -AABB* CocoaTile::getTileAABB(Level* level, int x, int y, int z) { +AABB CocoaTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); return DirectionalTile::getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/CocoaTile.h b/Minecraft.World/Blocks/CocoaTile.h index 7ff5c81ee..ff8c02c6f 100644 --- a/Minecraft.World/Blocks/CocoaTile.h +++ b/Minecraft.World/Blocks/CocoaTile.h @@ -23,7 +23,7 @@ public: virtual bool isCubeShaped(); virtual bool isSolidRender(bool isServerLevel = false); virtual std::optional getAABB(Level* level, int x, int y, int z); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void updateShape(LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = diff --git a/Minecraft.World/Blocks/DoorTile.cpp b/Minecraft.World/Blocks/DoorTile.cpp index df461bb6b..1c2692370 100644 --- a/Minecraft.World/Blocks/DoorTile.cpp +++ b/Minecraft.World/Blocks/DoorTile.cpp @@ -85,10 +85,9 @@ bool DoorTile::isCubeShaped() { return false; } int DoorTile::getRenderShape() { return Tile::SHAPE_DOOR; } -AABB* DoorTile::getTileAABB(Level* level, int x, int y, int z) { +AABB DoorTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); - AABB* retval = Tile::getTileAABB(level, x, y, z); - return retval; + return Tile::getTileAABB(level, x, y, z); } std::optional DoorTile::getAABB(Level* level, int x, int y, int z) { diff --git a/Minecraft.World/Blocks/DoorTile.h b/Minecraft.World/Blocks/DoorTile.h index 339775515..3f844a27d 100644 --- a/Minecraft.World/Blocks/DoorTile.h +++ b/Minecraft.World/Blocks/DoorTile.h @@ -40,7 +40,7 @@ public: virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual int getRenderShape(); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual std::optional getAABB(Level* level, int x, int y, int z); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, diff --git a/Minecraft.World/Blocks/LadderTile.cpp b/Minecraft.World/Blocks/LadderTile.cpp index f95650843..06b016284 100644 --- a/Minecraft.World/Blocks/LadderTile.cpp +++ b/Minecraft.World/Blocks/LadderTile.cpp @@ -11,7 +11,7 @@ std::optional LadderTile::getAABB(Level* level, int x, int y, int z) { return Tile::getAABB(level, x, y, z); } -AABB* LadderTile::getTileAABB(Level* level, int x, int y, int z) { +AABB LadderTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); return Tile::getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/LadderTile.h b/Minecraft.World/Blocks/LadderTile.h index 133c01230..9bde7712d 100644 --- a/Minecraft.World/Blocks/LadderTile.h +++ b/Minecraft.World/Blocks/LadderTile.h @@ -12,7 +12,7 @@ protected: public: virtual std::optional getAABB(Level* level, int x, int y, int z); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr< diff --git a/Minecraft.World/Blocks/SignTile.cpp b/Minecraft.World/Blocks/SignTile.cpp index 2004f9e4a..7a62f9248 100644 --- a/Minecraft.World/Blocks/SignTile.cpp +++ b/Minecraft.World/Blocks/SignTile.cpp @@ -27,7 +27,7 @@ void SignTile::updateDefaultShape() { std::optional SignTile::getAABB(Level* level, int x, int y, int z) { return std::nullopt; } -AABB* SignTile::getTileAABB(Level* level, int x, int y, int z) { +AABB SignTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); return BaseEntityTile::getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/SignTile.h b/Minecraft.World/Blocks/SignTile.h index 9e4c009d2..952b5e1cc 100644 --- a/Minecraft.World/Blocks/SignTile.h +++ b/Minecraft.World/Blocks/SignTile.h @@ -21,7 +21,7 @@ public: Icon* getTexture(int face, int data); virtual void updateDefaultShape(); std::optional getAABB(Level* level, int x, int y, int z); - AABB* getTileAABB(Level* level, int x, int y, int z); + AABB getTileAABB(Level* level, int x, int y, int z); void updateShape(LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = diff --git a/Minecraft.World/Blocks/StairTile.cpp b/Minecraft.World/Blocks/StairTile.cpp index 2990ada14..244c58895 100644 --- a/Minecraft.World/Blocks/StairTile.cpp +++ b/Minecraft.World/Blocks/StairTile.cpp @@ -326,7 +326,7 @@ Icon* StairTile::getTexture(int face, int data) { int StairTile::getTickDelay(Level* level) { return base->getTickDelay(level); } -AABB* StairTile::getTileAABB(Level* level, int x, int y, int z) { +AABB StairTile::getTileAABB(Level* level, int x, int y, int z) { return base->getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/StairTile.h b/Minecraft.World/Blocks/StairTile.h index 23d906835..690b52bd2 100644 --- a/Minecraft.World/Blocks/StairTile.h +++ b/Minecraft.World/Blocks/StairTile.h @@ -65,7 +65,7 @@ public: virtual int getRenderLayer(); virtual Icon* getTexture(int face, int data); virtual int getTickDelay(Level* level); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void handleEntityInside(Level* level, int x, int y, int z, std::shared_ptr e, Vec3* current); virtual bool mayPick(); diff --git a/Minecraft.World/Blocks/Tile.cpp b/Minecraft.World/Blocks/Tile.cpp index 66d58c632..d12283e69 100644 --- a/Minecraft.World/Blocks/Tile.cpp +++ b/Minecraft.World/Blocks/Tile.cpp @@ -2005,11 +2005,11 @@ Icon* Tile::getTexture(int face, int data) { return icon; } Icon* Tile::getTexture(int face) { return getTexture(face, 0); } -AABB* Tile::getTileAABB(Level* level, int x, int y, int z) { +AABB Tile::getTileAABB(Level* level, int x, int y, int z) { ThreadStorage* tls = m_tlsShape; // 4J Stu - Added this so that the TLS shape is correct for this tile if (tls->tileId != this->id) updateDefaultShape(); - return AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, + return AABB(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1); } diff --git a/Minecraft.World/Blocks/Tile.h b/Minecraft.World/Blocks/Tile.h index 4346f6d26..2b94b9ffe 100644 --- a/Minecraft.World/Blocks/Tile.h +++ b/Minecraft.World/Blocks/Tile.h @@ -631,7 +631,7 @@ public: virtual Icon* getTexture(LevelSource* level, int x, int y, int z, int face); virtual Icon* getTexture(int face, int data); virtual Icon* getTexture(int face); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, AABBList* boxes, std::shared_ptr source); virtual std::optional getAABB(Level* level, int x, int y, int z); diff --git a/Minecraft.World/Blocks/TorchTile.cpp b/Minecraft.World/Blocks/TorchTile.cpp index 556370789..4932ff4fc 100644 --- a/Minecraft.World/Blocks/TorchTile.cpp +++ b/Minecraft.World/Blocks/TorchTile.cpp @@ -12,7 +12,7 @@ TorchTile::TorchTile(int id) : Tile(id, Material::decoration, false) { std::optional TorchTile::getAABB(Level* level, int x, int y, int z) { return std::nullopt; } -AABB* TorchTile::getTileAABB(Level* level, int x, int y, int z) { +AABB TorchTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); return Tile::getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/TorchTile.h b/Minecraft.World/Blocks/TorchTile.h index 3f7d0a4d1..525f851cc 100644 --- a/Minecraft.World/Blocks/TorchTile.h +++ b/Minecraft.World/Blocks/TorchTile.h @@ -13,7 +13,7 @@ protected: public: virtual std::optional getAABB(Level* level, int x, int y, int z); - virtual AABB* getTileAABB(Level* level, int x, int y, int z); + virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr< diff --git a/Minecraft.World/Blocks/TrapDoorTile.cpp b/Minecraft.World/Blocks/TrapDoorTile.cpp index bca1ce813..7a6e46e5a 100644 --- a/Minecraft.World/Blocks/TrapDoorTile.cpp +++ b/Minecraft.World/Blocks/TrapDoorTile.cpp @@ -25,7 +25,7 @@ bool TrapDoorTile::isPathfindable(LevelSource* level, int x, int y, int z) { int TrapDoorTile::getRenderShape() { return Tile::SHAPE_BLOCK; } -AABB* TrapDoorTile::getTileAABB(Level* level, int x, int y, int z) { +AABB TrapDoorTile::getTileAABB(Level* level, int x, int y, int z) { updateShape(level, x, y, z); return Tile::getTileAABB(level, x, y, z); } diff --git a/Minecraft.World/Blocks/TrapDoorTile.h b/Minecraft.World/Blocks/TrapDoorTile.h index 9765b61c6..8ef150568 100644 --- a/Minecraft.World/Blocks/TrapDoorTile.h +++ b/Minecraft.World/Blocks/TrapDoorTile.h @@ -37,7 +37,7 @@ public: int getRenderShape(); public: - AABB* getTileAABB(Level* level, int x, int y, int z); + AABB getTileAABB(Level* level, int x, int y, int z); public: std::optional getAABB(Level* level, int x, int y, int z);