fix trying to read blocks above world

This commit is contained in:
olebeck 2022-10-14 18:33:56 +02:00
parent 12f6a11683
commit 01b5946218
2 changed files with 1 additions and 6 deletions

View File

@ -18,11 +18,6 @@ import (
"github.com/sirupsen/logrus"
)
var (
SrcIp_client = net.IPv4(127, 0, 0, 1)
SrcIp_server = net.IPv4(243, 0, 0, 2)
)
func init() {
utils.RegisterCommand(&CaptureCMD{})
}

View File

@ -52,7 +52,7 @@ func chunkGetColorAt(c *chunk.Chunk, x uint8, y int16, z uint8) color.RGBA {
p := cube.Pos{int(x), int(y), int(z)}
have_up := false
p.Side(cube.FaceUp).Neighbours(func(neighbour cube.Pos) {
if neighbour.X() < 0 || neighbour.X() >= 16 || neighbour.Z() < 0 || neighbour.Z() >= 16 {
if neighbour.X() < 0 || neighbour.X() >= 16 || neighbour.Z() < 0 || neighbour.Z() >= 16 || neighbour.Y() > c.Range().Max() {
return
}
if !have_up {