1
0
forked from MTSR/mapserver
mapserver/mapblockaccessor/update.go
2021-10-12 07:44:07 +02:00

15 lines
319 B
Go

package mapblockaccessor
import (
"mapserver/coords"
"github.com/minetest-go/mapparser"
cache "github.com/patrickmn/go-cache"
)
func (a *MapBlockAccessor) Update(pos *coords.MapBlockCoords, mb *mapparser.MapBlock) {
key := getKey(pos)
cacheBlockCount.Inc()
a.blockcache.Set(key, mb, cache.DefaultExpiration)
}