Provides a clock and sun/moon dial widget to show the current time and "date" on an SMP world.
On startup and occasionally afterwards, the widget retrieves the current number of clicks (the 'Time' value from level.dat) from the server. It calculates the "date" based on converted wall-clock seconds since the epoch, where a wall-clock second is 72 seconds on a minecraft world. Between updates from the server, the time, date, and dial are updated using the browser's clock.
This widget uses and depends on the following files that are not part of this distribution:
- jQueryRotate.js by Wilq32 (Pawel Witkowski) available from http://code.google.com/p/jqueryrotate/ (no need to download, linked to from google site)
- nbt.class.php by Justin Martian available from https://github.com/TheFrozenFire/PHP-NBT-Decoder-Encoder
Additionally, you will have to have php installed on your server.
download the distribution:
unzip all files in your map's HTML directory; this directory must also contain the nbt.class.php file listed above under requirements
edit your map's html file (e.g. index.html) and add the following
Any HTML map:
in the <head> section (you can skip the first line if jQuery is already there):
in the <body> section right after the <div> containing the map:
<div id="mcdial" class="mcdial"> <img src="mask.png" id="mask"> <img src="dial.png" id="dial"> <div id="date" class="datetime">DATE</div> <div id="time" class="datetime">TIME</div> <div id="debug" class="datetime" style="visibility: hidden;"> </div> <div id="sdcredits" class="datetime"> <a class="sdlink" href="https://github.com/sunkid/minecraft-sundial">minecraft sundial</a> </div> </div>
Supported mapping tools:
Check the util/ directory for supported tools and patches
edit getServerTime.php script to point to your world's level.dat file
test getServerTime.php by running:
the output should look something like this:
open your modified map from a browser and you should see the sundial in the top right corner.
This software is copyright by sunkid <email@example.com> and is distributed under a dual license:
- Non-Commercial Use:
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- Commercial Use:
- Please contact firstname.lastname@example.org