@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user