diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
| commit | 119bff351450ea16ffda550b6e0f67379b29f708 (patch) | |
| tree | d9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/HalfSlabTile.cpp | |
| parent | 8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff) | |
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/HalfSlabTile.cpp')
| -rw-r--r-- | Minecraft.World/HalfSlabTile.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/Minecraft.World/HalfSlabTile.cpp b/Minecraft.World/HalfSlabTile.cpp index 9bbcbedb..ed3969c1 100644 --- a/Minecraft.World/HalfSlabTile.cpp +++ b/Minecraft.World/HalfSlabTile.cpp @@ -22,56 +22,56 @@ HalfSlabTile::HalfSlabTile(int id, bool fullSize, Material *material) : Tile(id, { this->fullSize = fullSize; - if (fullSize) + if (fullSize) { solid[id] = true; - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } setLightBlock(255); } -void HalfSlabTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param +void HalfSlabTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param { - if (fullSize) + if (fullSize) { setShape(0, 0, 0, 1, 1, 1); - } - else + } + else { bool upper = (level->getData(x, y, z) & TOP_SLOT_BIT) != 0; - if (upper) + if (upper) { setShape(0, 0.5f, 0, 1, 1, 1); - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } } } -void HalfSlabTile::updateDefaultShape() +void HalfSlabTile::updateDefaultShape() { - if (fullSize) + if (fullSize) { setShape(0, 0, 0, 1, 1, 1); - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } } -void HalfSlabTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr<Entity> source) +void HalfSlabTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source) { updateShape(level, x, y, z); Tile::addAABBs(level, x, y, z, box, boxes, source); } -bool HalfSlabTile::isSolidRender(bool isServerLevel) +bool HalfSlabTile::isSolidRender(bool isServerLevel) { return fullSize; } @@ -87,30 +87,30 @@ int HalfSlabTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, in return itemValue; } -int HalfSlabTile::getResourceCount(Random *random) +int HalfSlabTile::getResourceCount(Random *random) { - if (fullSize) + if (fullSize) { return 2; } return 1; } -int HalfSlabTile::getSpawnResourcesAuxValue(int data) +int HalfSlabTile::getSpawnResourcesAuxValue(int data) { return data & TYPE_MASK; } -bool HalfSlabTile::isCubeShaped() +bool HalfSlabTile::isCubeShaped() { return fullSize; } -bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) +bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) { if (fullSize) return Tile::shouldRenderFace(level, x, y, z, face); - if (face != Facing::UP && face != Facing::DOWN && !Tile::shouldRenderFace(level, x, y, z, face)) + if (face != Facing::UP && face != Facing::DOWN && !Tile::shouldRenderFace(level, x, y, z, face)) { return false; } @@ -121,13 +121,13 @@ bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int oz += Facing::STEP_Z[Facing::OPPOSITE_FACING[face]]; boolean isUpper = (level->getData(ox, oy, oz) & TOP_SLOT_BIT) != 0; - if (isUpper) + if (isUpper) { if (face == Facing::DOWN) return true; if (face == Facing::UP && Tile::shouldRenderFace(level, x, y, z, face)) return true; return !(isHalfSlab(level->getTile(x, y, z)) && (level->getData(x, y, z) & TOP_SLOT_BIT) != 0); - } - else + } + else { if (face == Facing::UP) return true; if (face == Facing::DOWN && Tile::shouldRenderFace(level, x, y, z, face)) return true; @@ -135,7 +135,7 @@ bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int } } -bool HalfSlabTile::isHalfSlab(int tileId) +bool HalfSlabTile::isHalfSlab(int tileId) { return tileId == Tile::stoneSlabHalf_Id || tileId == Tile::woodSlabHalf_Id; } |
