JLyne / LiveAtlas

A Dynmap, Squaremap, Pl3xmap and Overviewer frontend for the modern web
Apache License 2.0
342 stars 37 forks source link

Add support for ingame time in Pl3xMap with Pl3xMapTime addon #180

Open gbl opened 3 years ago

gbl commented 3 years ago

I made an addon for Pl3xMap that shows the current ingame time in an overlay. As LiveAtlas already supports showing the clock with Dynmap, would it be possible to show the clock with Pl3xMap as well if Pl3xMapTime is loaded?

The addon writes a worldtimes.json file to the directory where pl3xmap resides; so if, in your config, you have a server like this

                steve: {
                    label: 'Steve',
                    pl3xmap: 'http://giselcraft.guntram.de/steve/',
                }

you can check for the existance of http://giselcraft.guntram.de/steve/worldtimes.json to check if Pl3xMapTime is installed.

If it is, you'll get a json in the following format:

{
"times": {
        "world": {  "time": 59134189, "advancing": true },
        "world_nether": {  "time": 58040420, "advancing": true },
        "world_the_end": {  "time": 58040420, "advancing": true }
    }
}

where time is the current ingame time (from Spigot world.getFullTime()), and advancing determines if the clock should be advanced locally (gamerule doDaylightCycle is true).

If you need any more info, feel free to ask. I can try to implement it and send a PR myself, but I'm not good at javascript and even worse with typescript, so my code probably wouldn't meet your quality standards.

JLyne commented 2 years ago

Is this project still maintained? Would still like to add support for it if so.

gbl commented 2 years ago

In theory yes, though, Billy Galbreath (the owner of Pl3xmap) gave up on the project itself. It seems like some users have picked up, but I haven't kept in touch with the project. The maintaned fork seems to be at https://github.com/NeumimTo/Pl3xMap/blob/master/ADDONS_INTEGRATIONS.md, which still links to my addon.

According to https://tooomm.github.io/github-release-stats/?username=gbl&repository=pl3xmaptime, I've gotten 52 downloads, but no issues or "doesn't work" comments, so I'd assume it works for people so there's not much reason to maintain anything. But if newer versions of MC / PL3xmap need me to update my addon, I'll do so.