1
0
forked from MTSR/mapserver

15 lines
317 B
Go
Raw Normal View History

2019-02-10 20:27:53 +01:00
package mapblockaccessor
import (
2023-12-29 16:00:11 +01:00
"mapserver/types"
2019-02-10 20:27:53 +01:00
2021-10-12 07:44:07 +02:00
"github.com/minetest-go/mapparser"
2019-02-10 20:27:53 +01:00
cache "github.com/patrickmn/go-cache"
)
2023-12-29 16:00:11 +01:00
func (a *MapBlockAccessor) Update(pos *types.MapBlockCoords, mb *mapparser.MapBlock) {
2019-02-10 20:27:53 +01:00
key := getKey(pos)
2019-03-13 10:41:37 +01:00
cacheBlockCount.Inc()
a.blockcache.Set(key, mb, cache.DefaultExpiration)
2019-02-10 20:27:53 +01:00
}