mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 23:02:04 -04:00
Fix compile errors
This commit is contained in:
parent
f1c14cf613
commit
b52848530d
@ -245,9 +245,11 @@ namespace MCGalaxy.Commands {
|
|||||||
|
|
||||||
public void FromOfflineLevel(string name) {
|
public void FromOfflineLevel(string name) {
|
||||||
this.Name = name;
|
this.Name = name;
|
||||||
LvlImporter.LoadDimensions(LevelInfo.LevelPath(name),
|
string path = LevelInfo.LevelPath(name);
|
||||||
out Width, out Height, out Length);
|
Vec3U16 dims = IMapImporter.Formats[0].ReadDimensions(path);
|
||||||
string path = LevelInfo.FindPropertiesFile(name);
|
Width = dims.X; Height = dims.Y; Length = dims.Z;
|
||||||
|
|
||||||
|
path = LevelInfo.FindPropertiesFile(name);
|
||||||
if (path != null)
|
if (path != null)
|
||||||
PropertiesFile.Read(path, ParseProperty, '=');
|
PropertiesFile.Read(path, ParseProperty, '=');
|
||||||
if (Authors == null) Authors = "";
|
if (Authors == null) Authors = "";
|
||||||
|
@ -44,7 +44,6 @@ namespace MCGalaxy.DB {
|
|||||||
void DumpRow(IDataReader reader) {
|
void DumpRow(IDataReader reader) {
|
||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
stream = File.Create("blockdefs/" + mapName + ".dump");
|
stream = File.Create("blockdefs/" + mapName + ".dump");
|
||||||
Vec3U16 dims = L
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string user = reader.GetString(0);
|
string user = reader.GetString(0);
|
||||||
|
@ -24,6 +24,10 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
|
|
||||||
public override string Extension { get { return ".cw"; } }
|
public override string Extension { get { return ".cw"; } }
|
||||||
|
|
||||||
|
public override Vec3U16 ReadDimensions(Stream src) {
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
public override Level Read(Stream src, string name, bool metadata) {
|
public override Level Read(Stream src, string name, bool metadata) {
|
||||||
NbtFile file = new NbtFile();
|
NbtFile file = new NbtFile();
|
||||||
file.LoadFromStream(src);
|
file.LoadFromStream(src);
|
||||||
|
@ -41,6 +41,10 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
|
|
||||||
public override string Extension { get { return ".dat"; } }
|
public override string Extension { get { return ".dat"; } }
|
||||||
|
|
||||||
|
public override Vec3U16 ReadDimensions(Stream src) {
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
public override Level Read(Stream src, string name, bool metadata) {
|
public override Level Read(Stream src, string name, bool metadata) {
|
||||||
byte[] temp = new byte[8];
|
byte[] temp = new byte[8];
|
||||||
Level lvl = new Level(name, 0, 0, 0);
|
Level lvl = new Level(name, 0, 0, 0);
|
||||||
|
@ -61,7 +61,6 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Vec3U16 ReadDimensions(BinaryReader reader) {
|
static Vec3U16 ReadDimensions(BinaryReader reader) {
|
||||||
BinaryReader reader = new BinaryReader(src);
|
|
||||||
if (reader.ReadInt32() != 0x0FC2AF40 || reader.ReadByte() != 13) {
|
if (reader.ReadInt32() != 0x0FC2AF40 || reader.ReadByte() != 13) {
|
||||||
throw new InvalidDataException( "Unexpected constant in .fcm file" );
|
throw new InvalidDataException( "Unexpected constant in .fcm file" );
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
public override Vec3U16 ReadDimensions(Stream src) {
|
public override Vec3U16 ReadDimensions(Stream src) {
|
||||||
using (Stream gs = new GZipStream(src, CompressionMode.Decompress, true)) {
|
using (Stream gs = new GZipStream(src, CompressionMode.Decompress, true)) {
|
||||||
byte[] header = new byte[16];
|
byte[] header = new byte[16];
|
||||||
return ReadHeader(gs, header);
|
return ReadHeader(header, gs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,15 +30,20 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
/// <summary> Reads the data for a level from a file containing data encoded in this format. </summary>
|
/// <summary> Reads the data for a level from a file containing data encoded in this format. </summary>
|
||||||
/// <param name="metadata"> Whether metadata should be loaded. </param>
|
/// <param name="metadata"> Whether metadata should be loaded. </param>
|
||||||
public Level Read(string path, string name, bool metadata) {
|
public Level Read(string path, string name, bool metadata) {
|
||||||
using (FileStream fs = File.OpenRead(path)) {
|
using (FileStream fs = File.OpenRead(path))
|
||||||
return Read(fs, name, metadata);
|
return Read(fs, name, metadata);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Reads the data for a level from a file containing data encoded in this format. </summary>
|
/// <summary> Reads the data for a level from a file containing data encoded in this format. </summary>
|
||||||
/// <param name="metadata"> Whether metadata should be loaded. </param>
|
/// <param name="metadata"> Whether metadata should be loaded. </param>
|
||||||
public abstract Level Read(Stream src, string name, bool metadata);
|
public abstract Level Read(Stream src, string name, bool metadata);
|
||||||
|
|
||||||
|
/// <summary> Reads the dimensions for a level from a file containing data encoded in this format. </summary>
|
||||||
|
public Vec3U16 ReadDimensions(string path) {
|
||||||
|
using (FileStream fs = File.OpenRead(path))
|
||||||
|
return ReadDimensions(fs);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary> Reads the dimensions for a level from a file containing data encoded in this format. </summary>
|
/// <summary> Reads the dimensions for a level from a file containing data encoded in this format. </summary>
|
||||||
public abstract Vec3U16 ReadDimensions(Stream src);
|
public abstract Vec3U16 ReadDimensions(Stream src);
|
||||||
|
|
||||||
|
@ -49,9 +49,8 @@ namespace MCGalaxy.Undo {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ushort width, height, length;
|
Vec3U16 dims = IMapImporter.Formats[0].ReadDimensions(LevelInfo.LevelPath(uP.mapName));
|
||||||
LvlImporter.LoadDimensions(LevelInfo.LevelPath(uP.mapName), out width, out height, out length);
|
node.Width = dims.X; node.Height = dims.Y; node.Length = dims.Z;
|
||||||
node.Width = width; node.Height = height; node.Length = length;
|
|
||||||
WriteChunkEntries(w, last.Entries, entriesPos);
|
WriteChunkEntries(w, last.Entries, entriesPos);
|
||||||
node.MapName = uP.mapName;
|
node.MapName = uP.mapName;
|
||||||
last = WriteEmptyChunk(w, node, time, ref entriesPos);
|
last = WriteEmptyChunk(w, node, time, ref entriesPos);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user