mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Fix .cw files saving/loading custom blocks with max fog density when fog density is supposed to be none.
This commit is contained in:
parent
4ffa029fa9
commit
d097af1cb0
@ -173,7 +173,8 @@ namespace ClassicalSharp.Map {
|
||||
FastColour col = info.FogColour[id];
|
||||
nbt.Write( NbtTagType.Int8Array );
|
||||
nbt.Write( "Fog" ); nbt.WriteInt32( 4 );
|
||||
nbt.WriteUInt8( (byte)(128 * info.FogDensity[id] - 1) );
|
||||
byte fog = (byte)(128 * info.FogDensity[id] - 1);
|
||||
nbt.WriteUInt8( info.FogDensity[id] == 0 ? (byte)0 : fog );
|
||||
nbt.WriteUInt8( col.R ); nbt.WriteUInt8( col.G ); nbt.WriteUInt8( col.B );
|
||||
|
||||
Vector3 min = info.MinBB[id], max = info.MaxBB[id];
|
||||
|
@ -155,6 +155,8 @@ namespace ClassicalSharp.Map {
|
||||
|
||||
data = (byte[])compound["Fog"].Value;
|
||||
info.FogDensity[id] = (data[0] + 1) / 128f;
|
||||
// Fix for older ClassicalSharp versions which saved wrong fog density value
|
||||
if( data[0] == 0xFF ) info.FogDensity[id] = 0;
|
||||
info.FogColour[id] = new FastColour( data[1], data[2], data[3] );
|
||||
|
||||
data = (byte[])compound["Coords"].Value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user