Increased readability of block content extraction a tiny bit.

This commit is contained in:
Sascha L. Teichmann 2017-03-01 11:41:21 +01:00
parent 7fca02e45f
commit 08d32826dc

View File

@ -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