2019-11-02 16:59:44 +01:00
|
|
|
from .observer import MultiplexingObserver, LoggingObserver, JSObserver
|
2019-11-02 15:41:59 +01:00
|
|
|
|
|
|
|
global escape
|
|
|
|
from cgi import escape
|
|
|
|
def signFilter(poi):
|
|
|
|
if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign':
|
|
|
|
return "<pre>" + "\n".join(map(escape, [poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']])) + "</pre>"
|
|
|
|
|
|
|
|
global json
|
|
|
|
import json
|
|
|
|
def petFilter(poi):
|
|
|
|
if "CustomName" in poi:
|
|
|
|
custom_name = json.loads(poi['CustomName'])
|
|
|
|
if "text" in custom_name:
|
|
|
|
return custom_name["text"]
|
|
|
|
|
2019-11-03 23:38:31 +01:00
|
|
|
def playerIcons(poi):
|
|
|
|
if poi['id'] == 'Player':
|
|
|
|
poi['icon'] = "https://overviewer.org/avatar/%s" % poi['EntityId']
|
|
|
|
return "Last known location for %s" % poi['EntityId']
|
|
|
|
|
2019-11-02 15:41:59 +01:00
|
|
|
processes = 2
|
|
|
|
|
|
|
|
worlds["My world"] = "/var/lib/minecraft/world"
|
|
|
|
|
|
|
|
renders["Vue normale"] = {
|
|
|
|
"world": "My world",
|
|
|
|
"title": "Vue normale",
|
|
|
|
"texturepath": "@CLIENT_JAR@",
|
|
|
|
"rendermode": smooth_lighting,
|
|
|
|
'markers': [dict(name="All signs", filterFunction=signFilter),
|
2019-11-03 23:38:31 +01:00
|
|
|
dict(name="Pets", filterFunction=petFilter, icon="icons/marker_cat.png", createInfoWindow=False, checked=True),
|
|
|
|
dict(name="Position joueurs", filterFunction=playerIcons),],
|
2019-11-02 15:41:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cave_rendermode = [Base(), EdgeLines(), Cave(only_lit=True), DepthTinting()]
|
|
|
|
|
|
|
|
renders["Grottes"] = {
|
|
|
|
"world": "My world",
|
|
|
|
"title": "Grottes",
|
|
|
|
"texturepath": "@CLIENT_JAR@",
|
|
|
|
"rendermode": cave_rendermode,
|
|
|
|
}
|
|
|
|
|
|
|
|
outputdir = "/var/www/minecraft-overviewer"
|
|
|
|
|
2019-11-02 16:59:44 +01:00
|
|
|
observer = MultiplexingObserver(LoggingObserver(), JSObserver(outputdir))
|