From 08d32826dcedae3a0e7bccd8430ad696c5206b7c Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Wed, 1 Mar 2017 11:41:21 +0100 Subject: [PATCH] Increased readability of block content extraction a tiny bit. --- common/block.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/block.go b/common/block.go index 1f87478..fa342e3 100644 --- a/common/block.go +++ b/common/block.go @@ -290,10 +290,10 @@ func (db *DecodedBlock) Content(x, y, z int) (content int32, found bool) { pos <<= 1 content = int32(db.MapContent[pos])<<8 | int32(db.MapContent[pos+1]) case db.Version >= 20: - if db.MapContent[pos] <= 0x80 { - content = int32(db.MapContent[pos]) + if c := db.MapContent[pos]; c <= 0x80 { + content = int32(c) } else { - content = int32(db.MapContent[pos])<<4 | int32(db.MapContent[pos+0x2000])>>4 + content = int32(c)<<4 | int32(db.MapContent[pos+0x2000])>>4 } default: return