forked from MTSR/mapserver
digilines lcd
This commit is contained in:
parent
ecaa385fb0
commit
8b27a7e61f
18
server/mapobject/digilinelcd.go
Normal file
18
server/mapobject/digilinelcd.go
Normal 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
|
||||
}
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user