1
0
forked from MTSR/mapserver
mapserver/mapblockaccessor/update.go
2023-12-29 16:00:11 +01:00

15 lines
317 B
Go

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