Skip to content

Commit

Permalink
work out what missing 0.13 dat field is.. it's not spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Oct 18, 2021
1 parent cd31921 commit 24f396a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions MCGalaxy/Levels/IO/Importers/DatImporter.cs
Expand Up @@ -70,29 +70,20 @@ public sealed class DatImporter : IMapImporter
}


#region V1 parser
static Level ReadFormat1(Level lvl, DatReader r) {
string name = r.ReadUtf8();
string auth = r.ReadUtf8();

// TODO what even are these 8 bytes
r.ReadInt64();
/*lvl.spawnx = (ushort)(r.ReadUInt16() >> 5);
lvl.spawnz = (ushort)(r.ReadUInt16() >> 5);
lvl.spawny = (ushort)(r.ReadUInt16() >> 5);
lvl.rotx = r.ReadUInt8();
lvl.roty = r.ReadUInt8();*/
r.ReadInt64(); // created timestamp (currentTimeMillis)
// no spawn in 0.13, you always spawn in a random place

lvl.Width = r.ReadUInt16();
lvl.Length = r.ReadUInt16();
lvl.Height = r.ReadUInt16();
lvl.blocks = r.ReadBytes(lvl.Width * lvl.Height * lvl.Length);
return lvl;
}
#endregion



#region V2 parser
static Level ReadFormat2(Level lvl, DatReader r) {
if (r.ReadUInt16() != 0xACED) throw new InvalidDataException("Invalid stream magic");
if (r.ReadUInt16() != 0x0005) throw new InvalidDataException("Invalid stream version");
Expand Down Expand Up @@ -327,6 +318,5 @@ class JFieldDesc {
ReadContent(r, typeCode);
}
}
#endregion
}
}

0 comments on commit 24f396a

Please sign in to comment.