Skip to content
Permalink
Browse files

Less ugly code

  • Loading branch information...
UnknownShadow200 committed Apr 1, 2018
1 parent b616f0a commit b5d9426f2e84a39f722e1a757a0c102bbe630d87
Showing with 7 additions and 12 deletions.
  1. +7 −12 fCraft/Network/Player.Networking.cs
@@ -1171,18 +1171,13 @@ bool LoginSequence()
Block maxLegal = supportsCustomBlocks ? Map.MaxCustomBlockType : Map.MaxLegalBlockType;
Logger.Log(LogType.Debug, "Player.JoinWorldNow: Sending compressed map to {0}.", Name);

using (LevelChunkStream dst = new LevelChunkStream(this)) {
Stream compressor = null;
try {
compressor = map.CompressMapHeader(this, dst);

if (supportsCustomBlocks && supportsBlockDefs) {
map.CompressMap(dst, compressor);
} else {
map.CompressAndConvertMap((byte)maxLegal, dst, compressor);
}
} finally {
if (compressor != null) compressor.Close();
using (LevelChunkStream dst = new LevelChunkStream(this))
using (Stream compressor = map.CompressMapHeader(this, dst))
{
if (supportsCustomBlocks && supportsBlockDefs) {
map.CompressMap(dst, compressor);
} else {
map.CompressAndConvertMap((byte)maxLegal, dst, compressor);
}
}
}

0 comments on commit b5d9426

Please sign in to comment.
You can’t perform that action at this time.