diff --git a/server/mapobject/digilinelcd.go b/server/mapobject/digilinelcd.go new file mode 100644 index 0000000..2a43971 --- /dev/null +++ b/server/mapobject/digilinelcd.go @@ -0,0 +1,18 @@ +package mapobject + +import ( + "mapserver/mapblockparser" + "mapserver/mapobjectdb" +) + +type DigilineLcdBlock struct{} + +func (this *DigilineLcdBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject { + md := block.Metadata.GetMetadata(x, y, z) + + o := mapobjectdb.NewMapObject(&block.Pos, x, y, z, "digilinelcd") + o.Attributes["text"] = md["text"] + o.Attributes["channel"] = md["channel"] + + return o +} diff --git a/server/mapobject/setup.go b/server/mapobject/setup.go index dc885d1..cf60545 100644 --- a/server/mapobject/setup.go +++ b/server/mapobject/setup.go @@ -64,15 +64,27 @@ func Setup(ctx *app.App) { objectlisteners: make(map[string]MapObjectListener), } + //mapserver stuff l.AddMapObject("mapserver:poi", &PoiBlock{}) l.AddMapObject("mapserver:train", &TrainBlock{}) + + //travelnet l.AddMapObject("travelnet:travelnet", &TravelnetBlock{}) + + //protections l.AddMapObject("protector:protect", &ProtectorBlock{}) l.AddMapObject("protector:protect2", &ProtectorBlock{}) + + //builtin l.AddMapObject("bones:bones", &BonesBlock{}) + + //technic l.AddMapObject("technic:quarry", &QuarryBlock{}) l.AddMapObject("technic:hv_nuclear_reactor_core_active", &NuclearReactorBlock{}) l.AddMapObject("technic:admin_anchor", &TechnicAnchorBlock{}) + //digilines + l.AddMapObject("digilines:lcd", &DigilineLcdBlock{}) + ctx.BlockAccessor.Eventbus.AddListener(&l) }