1
0
forked from MTSR/mapserver

digilines lcd

This commit is contained in:
NatureFreshMilk 2019-01-29 08:03:49 +01:00
parent ecaa385fb0
commit 8b27a7e61f
2 changed files with 30 additions and 0 deletions

View File

@ -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
}

View File

@ -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)
}