mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 08:03:41 +00:00
26 lines
908 B
C++
26 lines
908 B
C++
#include "../../Platform/stdafx.h"
|
|
#include "../../Headers/net.minecraft.world.level.h"
|
|
#include "../../Headers/net.minecraft.world.level.tile.h"
|
|
#include "DaylightDetectorTileEntity.h"
|
|
|
|
DaylightDetectorTileEntity::DaylightDetectorTileEntity() {}
|
|
|
|
void DaylightDetectorTileEntity::tick() {
|
|
if (level != NULL && !level->isClientSide &&
|
|
(level->getGameTime() % SharedConstants::TICKS_PER_SECOND) == 0) {
|
|
tile = getTile();
|
|
if (tile != NULL && dynamic_cast<DaylightDetectorTile*>(tile) != NULL) {
|
|
((DaylightDetectorTile*)tile)->updateSignalStrength(level, x, y, z);
|
|
}
|
|
}
|
|
}
|
|
|
|
// 4J Added
|
|
std::shared_ptr<TileEntity> DaylightDetectorTileEntity::clone() {
|
|
std::shared_ptr<DaylightDetectorTileEntity> result =
|
|
std::shared_ptr<DaylightDetectorTileEntity>(
|
|
new DaylightDetectorTileEntity());
|
|
TileEntity::clone(result);
|
|
|
|
return result;
|
|
} |