public static void CropMaceWorld(frmMace frmLogForm) { // thank you to Surrogard <*****@*****.**> for providing a linux friendly version of this code: Directory.CreateDirectory("macecopy".ToMinecraftSaveDirectory()); BetaWorld bwCopy = BetaWorld.Create("macecopy".ToMinecraftSaveDirectory()); BetaChunkManager cmCopy = bwCopy.GetChunkManager(); BetaWorld bwCrop = BetaWorld.Open("macemaster".ToMinecraftSaveDirectory()); BetaChunkManager cmCrop = bwCrop.GetChunkManager(); foreach (ChunkRef chunk in cmCrop) { if (chunk.X >= -7 && chunk.X <= 11 && chunk.Z >= 0 && chunk.Z <= 11) { Debug.WriteLine("Copying chunk " + chunk.X + "," + chunk.Z); cmCopy.SetChunk(chunk.X, chunk.Z, chunk.GetChunkRef()); } cmCopy.Save(); } bwCopy.Level.GameType = GameType.CREATIVE; cmCopy.Save(); bwCopy.Save(); if (Environment.OSVersion.Platform == PlatformID.Win32NT) { Process.Start("explorer.exe", @"/select," + "macecopy".ToMinecraftSaveDirectory() + "\\level.dat"); } }
public static void CropMaceWorld(frmMace frmLogForm) { // thank you to Surrogard <*****@*****.**> for providing a linux friendly version of this code: Directory.CreateDirectory(Utils.GetMinecraftSavesDirectory("macecopy")); BetaWorld bwCopy = BetaWorld.Create(Utils.GetMinecraftSavesDirectory("macecopy")); BetaChunkManager cmCopy = bwCopy.GetChunkManager(); BetaWorld bwCrop = BetaWorld.Open(Utils.GetMinecraftSavesDirectory("mace")); BetaChunkManager cmCrop = bwCrop.GetChunkManager(); foreach (ChunkRef chunk in cmCrop) { if (chunk.X >= 0 && chunk.X <= 7 && chunk.Z >= 0 && chunk.Z <= 10) { Debug.WriteLine("Copying chunk " + chunk.X + "," + chunk.Z); cmCopy.SetChunk(chunk.X, chunk.Z, chunk.GetChunkRef()); } } cmCopy.Save(); bwCopy.Save(); }