From 01b5946218059a84f3156078ad26b424af185271 Mon Sep 17 00:00:00 2001 From: olebeck <31539311+olebeck@users.noreply.github.com> Date: Fri, 14 Oct 2022 18:33:56 +0200 Subject: [PATCH] fix trying to read blocks above world --- subcommands/capture.go | 5 ----- subcommands/world/chunk_render.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/subcommands/capture.go b/subcommands/capture.go index a62f4db..efdee8b 100644 --- a/subcommands/capture.go +++ b/subcommands/capture.go @@ -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{}) } diff --git a/subcommands/world/chunk_render.go b/subcommands/world/chunk_render.go index 5960628..fa1265a 100644 --- a/subcommands/world/chunk_render.go +++ b/subcommands/world/chunk_render.go @@ -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 {