diff --git a/mapblockrenderer/renderer.go b/mapblockrenderer/renderer.go index c3c0e13..72b923d 100644 --- a/mapblockrenderer/renderer.go +++ b/mapblockrenderer/renderer.go @@ -140,7 +140,7 @@ func (r *MapBlockRenderer) Render(pos1, pos2 *coords.MapBlockCoords) (*image.NRG c := r.colors.GetColor(nodeName) hasfullpalette := nodeName == "unifiedbricks:brickblock" - if hasfullpalette { + if hasfullpalette && r.fullpalette != nil { param2 := mb.GetParam2(x, y, z) c = r.fullpalette.GetColor(param2) } diff --git a/tilerenderer/renderer_test.go b/tilerenderer/renderer_test.go index 97f70ff..7d16a22 100644 --- a/tilerenderer/renderer_test.go +++ b/tilerenderer/renderer_test.go @@ -2,7 +2,6 @@ package tilerenderer import ( "bytes" - "github.com/sirupsen/logrus" "io/ioutil" "mapserver/colormapping" "mapserver/coords" @@ -15,6 +14,8 @@ import ( "os" "testing" "time" + + "github.com/sirupsen/logrus" ) func TestTileRender(t *testing.T) { @@ -45,7 +46,7 @@ func TestTileRender(t *testing.T) { t.Fatal(err) } - r := mapblockrenderer.NewMapBlockRenderer(cache, c) + r := mapblockrenderer.NewMapBlockRenderer(cache, c, nil) tiletmpdir, err := ioutil.TempDir("", "TestTileRenderTiles.*.sqlite") defer os.RemoveAll(tiletmpdir)