nixos-config/systems/LoutreOS/config-overviewer.py

42 lines
1.2 KiB
Python
Raw Normal View History

from .observer import MultiplexingObserver, LoggingObserver, JSObserver
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"]
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),
dict(name="Pets", filterFunction=petFilter, icon="icons/marker_cat.png", createInfoWindow=False, checked=True)],
}
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"
observer = MultiplexingObserver(LoggingObserver(), JSObserver(outputdir))