fix incorrect power calculation of daylight sensor

This commit is contained in:
Dylan K. Taylor 2019-07-31 15:44:53 +01:00
parent bf5519b0cf
commit b4c55a8c37

View File

@ -107,7 +107,7 @@ class DaylightSensor extends Transparent{
} }
$sunAngle = $this->world->getSunAnglePercentage(); $sunAngle = $this->world->getSunAnglePercentage();
return max(0, (int) round(15 * cos(($sunAngle + ((($sunAngle < 0.5 ? 0 : 1) - $sunAngle) / 5)) * 2 * M_PI))); return max(0, (int) round($lightLevel * cos(($sunAngle + ((($sunAngle < 0.5 ? 0 : 1) - $sunAngle) / 5)) * 2 * M_PI)));
} }
//TODO //TODO