Board Thread:LotR Mod Technical Support/@comment-30921003-20170107225558/@comment-30921003-20170109220341

Hi folks, Thanks for the responses - I've put together some xml code to show the approximate Middle Earth time.

The logic/assumptions behind it: 1 second = 20 ticks in 'vanilla' Minecraft (MC). 1 second = 40 ticks in Middle Earth (ME). Therefore 1 ME day = 2 MC days. New days in both dimensions start around 6am.

The basic formula is: ME Hour = 6 + (MC Hour-6)/2

Here's the code: Day day 2                0            ,                         6                                 mctimeh 6                            2                      6                                        mctimeh 6                                    2                             12                         12.5                         0.5                      0            :                         mctimem 2                     6                                            mctimeh 6                                        2                                 1                             0                         0                         30                      0            (                             daytime                 $eDay                 $8Night                         time$f)

Copy the code your InGameInfo.xml file to show the info highlighted in red on the screenshot below:



It's a 12 hour clock, and the code includes the day/night indicator so you can work out if it's AM/PM.

Note that the day shown reflects the number of days you've been in Middle Earth, not the Shire Reckoning date. It's calculated as half the number of days that have passed in 'regular' minecraft. Unfortunately the implementation isn't perfect - there's no 'round down' equivalent in the InGameInfo mod, so I've had to try and adjust the hours and seconds by 0.5 to get the rounding I want, and it's not 100% accurate. There's also no way (that I could see) to force a number to be displayed as 2 digits, so seconds < 9 look a bit odd.

That said, it's definitely good enough for me to use for now, and there's a chance I might go back to it to see if I can refine it further. Comments/suggestions and improvements are more than welcome in the meantime!

As a related aside, there's little point having entities showing, as the mod only recognises vanilla mobs.

Anyway, hope this helps anyone else who uses this mod - Samwise, if you find a place for this info to live, let me know and I can update :)