Skip to content
Permalink
Browse files

Minorly optimise MCForge-Redux map importer

  • Loading branch information...
UnknownShadow200 committed May 24, 2018
1 parent 520a9bd commit 182e276d74d02e0fda0ca85937bb64d673924667
Showing with 4 additions and 6 deletions.
  1. +4 −6 fCraft/MapConversion/MapMCF.cs
@@ -29,14 +29,12 @@ public class MapMCF : MapMCSharp {
Map map = LoadHeaderInternal( gs );
map.Blocks = new byte[map.Volume];

int i = 0, lo, hi;
while ((lo = gs.ReadByte()) != -1) {
hi = gs.ReadByte();
int id = lo | (hi << 8);
int i = 0, id;
while ((id = gs.ReadByte()) != -1) {
gs.ReadByte(); // NOTE: This breaks the 5 block ids past 255, but I doubt they really had much use.

if (id <= (byte)Block.StoneBrick) map.Blocks[i] = (byte)id;
else map.Blocks[i] = Mapping[id & 0xFF];
// NOTE: This breaks the 5 block ids past 255, but I doubt they really had much use.
else map.Blocks[i] = Mapping[id];
i++;
}
return map;

0 comments on commit 182e276

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