TimeLib

TimeLib

Data pack

Get the real life date & time tick-perfectly and efficiently!

Server LibraryUtility

2,792 downloads
26 followers
Follow Save
TimeLib has been archived. TimeLib will not receive any further updates unless the author decides to unarchive the project.
Filter versions...
Filter channels...

Bugfixes:

  • Fixed a bug that caused TimeLib not to work at all (A typo when trying to call the tick function)

IMPORTANT NOTICE

Despite being declared as Lantern Load compatible, that had not been the case in older releases. From now on, you can use the Lantern Load conventions to check whether TimeLib is installed and what version. Details in the changelog below.

Additions:

  • Added Lantern Load compatibility
    • If you follow the conventions, you can check whether TimeLib is installed (#TimeLib load.status is 1) and what version (Check #TimeLib.Version load.status)
    • You can also specifically check if multiple incompatible versions of TimeLib are installed at the same time (#TimeLib.VersionError load.status is 1)
    • The #TimeLib.Version load.status version is now 1
  • TimeLib now stops functioning and throws errors if multiple incompatible versions are installed simultaneously
    • This extends to the utility functions, which will fail
  • TimeLib now stops functioning and throws errors upon executing utility functions if it has been uninstalled by running the timelib:uninstall function

(!) The version compatibility checks are not compatible with releases 2.2.0 and earlier.

(!) To counteract potential problems with datapacks trying to access TimeLib while it's uninstalled (before upgrading to a newer release), future releases of TimeLib will provide an "upgrade" feature that automatically detects what version was installed prior. Because this depends on the newly implemented version feature, it will only work with releases 2.3.0 and newer.

âš  BREAKING CHANGES

This version contains breaking changes. Make sure you uninstall the previous version and check if the breaking changes affect your datapack.

Breaking changes:

  • Renamed #TimeLib TimeLib.PausedTicks to #TimeLib.PausedTicks TimeLib

Additions:

  • During the date_changed event, the number of days that have passed can be retrieved from #TimeLib.PassedDays TimeLib
  • During the daytime_changed event, the number of seconds that have passed (not capped to a single day) can be retrieved from #TimeLib.PassedSeconds TimeLib

âš  BREAKING CHANGES

This version contains breaking changes. Make sure you uninstall the previous version and check if the breaking changes affect your datapack.

Breaking changes:

  • Changed the data structure of timelib:date and timelib:output

Additions:

  • The tickrate can now be retrieved from the TimeLib.Tickrate scoreboard
  • Added a game_unpaused function tag that runs whenever the game is unpaused (from singleplayer or /tick unfreeze)
    • You can get the number of paused ticks from the TimeLib.PausedTicks scoreboard

Changes:

  • timelib:output now contains the daytime as well
  • timelib:output and timelib:date now additionally contain a stringified form of the month with leading zeros
  • Added more information regarding leftover data in the uninstall function
  • Changed some tellraw formatting

Bugfixes:

  • Fixed a wrong comment in the "How to" section of unix_timestamp_to_date

âš  COMPLETE REWRITE

This version is not compatible with previous ones. Make sure you uninstall the previous version.

Changes:

  • TimeLib now natively supports lag, different tick rates & pausing due to refreshing the time every tick
    • The RealtimeTracking and SavingsTimeChecks settings have been removed
  • Added a timelib:daytime data storage containing stringified versions (with leading 0s) of the daytime
  • Added event tags for #timelib:date_changed and #timelib:daytime_changed which get called whenever the date or daytime changes respectively
    • The #timelib:time_updated event tag has been removed
    • They do not get called on datapack reloads
  • The get_date utility has been renamed to unix_timestamp_to_date
    • It now fails if the input is invalid
    • The unix timestamp is now correctly in the UTC timezone
  • Rewrote the setting descriptions
  • Removed the compatibility issue with the Constant scoreboard objective
  • Moved the forceloaded blocks outside the world border to prevent survival interference
  • Various optimizations and improvements

Bugfixes:

  • Fixed 1.21.5 not working properly (TimeLib v1.3.0)
  • Fixed a short time desync on first join
  • Fixed TimeLib giving the wrong time on first load

Bugfixes:

  • Fixed the init function not loading properly, causing the Data Pack to break in 1.21-1.21.4

Note: This release is equivalent to v1.3.0, please refer to that version's changelog.

BREAKING CHANGES

This version contains a breaking change. Make sure to run the uninstall function if you have an older version installed, so that the data storage is updated properly.

Additions:

  • Added a link to the Modrinth and GitHub pages on reload

Changes:

  • Reduced the filesize and data storage size (Breaking)
  • The day in the data storages is now always stored as a string
  • Fixed the version number in the tellraw commands

Additions:

  • Added a new data storage (timelib:output) that contains additional output for "util/get_date":
    • Day value as a string, with 0 prefix
    • WeekDay String (Long & Short)
    • Month String (Long & Short)

Changes:

  • Improved the "util/get_date" description
  • The day in the data storages is now always stored as a string

Additions:

  • Added a new data storage (timelib:date) that contains:
    • Day value as a string, with 0 prefix
    • WeekDay String (Long & Short)
    • Month String (Long & Short)
  • Added a new function tag (#timelib:time_updated) that gets run whenever timelib updated the time or the date changes
  • Added a new setting to disable the reload messages

Changes:

  • Moved the "load" and "init" functions to the zprivate folder to make it clear they're not meant to be run by users
  • Updated to 1.21
  • Updated to 1.20.5 & Item Components (Not backwards compatible!)
  • TimeLib now refreshes as soon as it can, instead of after 1 second when reloading
  • Fixed a bug where reloading shortly before a second, minute or hour passed would desync the timer for a moment
  • Made the command in the command blocks shorter
  • Added "minecraft:" prefix where possible for consistency

Bugfixes:

  • Fixed a logic error in the Timezone Offset that made it impossible to go backwards on the date
  • The same error prohibited timezone offsets from being bigger than 24h, or smaller than -24h

Bugfixes:

  • Fixed Timezone Offset not working properly when set to a negative value

Bugfixes:

  • Fixed Timezone Offset not working properly

Project members

SilicatYT

Owner

Details

Licensed MIT
Published 2 years ago
Updated 3 months ago