2026-03-03 03:04:10 +08:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "net.minecraft.world.level.h"
|
|
|
|
|
#include "net.minecraft.world.level.tile.h"
|
|
|
|
|
#include "DaylightDetectorTileEntity.h"
|
|
|
|
|
|
|
|
|
|
DaylightDetectorTileEntity::DaylightDetectorTileEntity()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DaylightDetectorTileEntity::tick()
|
|
|
|
|
{
|
2026-03-07 21:12:22 -06:00
|
|
|
if (level != NULL && !level->isClientSide && (level->getGameTime() % SharedConstants::TICKS_PER_SECOND) == 0)
|
2026-03-03 03:04:10 +08:00
|
|
|
{
|
|
|
|
|
tile = getTile();
|
2026-03-07 21:12:22 -06:00
|
|
|
if (tile != NULL && dynamic_cast<DaylightDetectorTile *>(tile) != NULL)
|
2026-03-03 03:04:10 +08:00
|
|
|
{
|
2026-03-07 21:12:22 -06:00
|
|
|
((DaylightDetectorTile *) tile)->updateSignalStrength(level, x, y, z);
|
2026-03-03 03:04:10 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 4J Added
|
|
|
|
|
shared_ptr<TileEntity> DaylightDetectorTileEntity::clone()
|
|
|
|
|
{
|
2026-03-07 21:12:22 -06:00
|
|
|
shared_ptr<DaylightDetectorTileEntity> result = shared_ptr<DaylightDetectorTileEntity>( new DaylightDetectorTileEntity() );
|
2026-03-03 03:04:10 +08:00
|
|
|
TileEntity::clone(result);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|