mirror of
				https://bitbucket.org/s_l_teichmann/mtsatellite
				synced 2025-10-31 08:05:27 +01:00 
			
		
		
		
	Dont store air only information in decoded block. This can be found out pretty easy by analysing the other fields if needed.
This commit is contained in:
		| @@ -44,11 +44,10 @@ type ( | ||||
|  | ||||
| 	DecodedBlock struct { | ||||
| 		Version     byte | ||||
| 		Transparent bool | ||||
| 		MapContent  []byte | ||||
| 		AirId       int32 | ||||
| 		IgnoreId    int32 | ||||
| 		AirOnly     bool | ||||
| 		Transparent bool | ||||
| 		IndexMap    map[int32]int32 | ||||
| 	} | ||||
| ) | ||||
| @@ -140,7 +139,6 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error) | ||||
|  | ||||
| 	airId, ignoreId := int32(-1), int32(-1) | ||||
| 	indexMap := make(map[int32]int32) | ||||
| 	var airOnly bool | ||||
| 	var transparent bool | ||||
| 	if version >= 22 { | ||||
| 		offset++ | ||||
| @@ -169,21 +167,23 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error) | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		airOnly = airId != -1 && len(indexMap) == 0 | ||||
| 	} | ||||
|  | ||||
| 	db = &DecodedBlock{ | ||||
| 		Version:     version, | ||||
| 		Transparent: transparent, | ||||
| 		MapContent:  mapContent, | ||||
| 		AirId:       airId, | ||||
| 		IgnoreId:    ignoreId, | ||||
| 		AirOnly:     airOnly, | ||||
| 		Transparent: transparent, | ||||
| 		IndexMap:    indexMap} | ||||
|  | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func (db *DecodedBlock) AirOnly() bool { | ||||
| 	return db.AirId != -1 && len(db.IndexMap) == 0 | ||||
| } | ||||
|  | ||||
| func (db *DecodedBlock) Content(x, y, z int) (content int32, found bool) { | ||||
| 	pos := z<<8 + y<<4 + x | ||||
|  | ||||
|   | ||||
| @@ -215,7 +215,7 @@ func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	if db.AirOnly { | ||||
| 	if db.AirOnly() { | ||||
| 		r.RejectedBlocks++ | ||||
| 		return | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user