15 foreach (XElement item
in from e
in projectNode.Element(
"Subsystems").Elements()
18 foreach (XElement item2
in from e
in item.Elements(
"Value")
26 foreach (XElement item3
in from e
in projectNode.Element(
"Subsystems").Elements()
29 foreach (XElement item4
in from e
in item3.Elements(
"Values")
32 foreach (XElement item5
in item4.Elements(
"Values")) {
33 foreach (XElement item6
in from e
in item5.Elements(
"Value")
42 foreach (XElement item7
in from e
in projectNode.Element(
"Subsystems").Elements()
45 foreach (XElement item8
in from e
in item7.Elements(
"Values")
48 foreach (XElement item9
in item8.Elements(
"Values")) {
49 foreach (XElement item10
in from e
in item9.Elements(
"Value")
58 foreach (XElement item11
in from e
in projectNode.Element(
"Subsystems").Elements()
61 foreach (XElement item12
in from e
in item11.Elements(
"Values")
64 foreach (XElement item13
in item12.Elements(
"Values")) {
65 foreach (XElement item14
in from e
in item13.Elements(
"Value")
74 foreach (XElement item15
in projectNode.Element(
"Entities").Elements()) {
75 foreach (XElement item16
in from e
in item15.Elements(
"Values")
78 foreach (XElement item17
in from e
in item16.Elements(
"Values")
81 foreach (XElement item18
in item17.Elements()) {
84 for (
int i = 0; i < array.Length; i++) {
93 string[] inventoryNames = [
"Inventory",
"CreativeInventory",
"CraftingTable",
"Chest",
"Furnace",
"Dispenser"];
94 foreach (XElement item19
in projectNode.Element(
"Entities").Elements()) {
95 foreach (XElement item20
in from e
in item19.Elements(
"Values")
98 foreach (XElement item21
in from e
in item20.Elements(
"Values")
101 foreach (XElement item22
in item21.Elements()) {
102 foreach (XElement item23
in from e
in item22.Elements(
"Value")
158 throw new InvalidOperationException($
"Not enough free space to convert world. {num / 1024 / 1024}MB required.");
162 byte[] array =
new byte[131072];
163 byte[] array2 =
new byte[262144];
164 for (
int i = 0; i < 65537; i++) {
169 stream2.Position = 12 * num2;
174 stream.Position = 12 * num2;
176 stream2.Position = 786444 + 132112L * index;
177 stream.Position = stream.Length;
180 stream2.ReadExactly(array, 0, 131072);
183 for (
int j = 0; j < 16; j++) {
184 for (
int k = 0; k < 16; k++) {
185 for (
int l = 0; l < 256; l++) {
189 array[4 * num3] | (array[4 * num3 + 1] << 8) | (array[4 * num3 + 2] << 16) | (array[4 * num3 + 3] << 24)
196 array2[4 * num4] = (byte)num5;
197 array2[4 * num4 + 1] = (byte)(num5 >> 8);
198 array2[4 * num4 + 2] = (byte)(num5 >> 16);
199 array2[4 * num4 + 3] = (byte)(num5 >> 24);
204 stream.Write(array2, 0, 262144);
205 stream2.ReadExactly(array, 0, 1024);
206 stream.Write(array, 0, 1024);
215 int contents = value & 0x3FF;
216 int light = (value >> 10) & 0xF;
217 int data = value >> 14;
219 return contents | (light << 10) | (data << 14);
223 if (contents == 30) {
226 if (contents == 34) {
229 if (contents == 32) {
232 if (contents == 35) {
235 if (contents == 33) {
238 if (contents == 170) {
241 if (contents == 122) {
244 if (contents == 123) {
static void MoveFile(string sourcePath, string destinationPath)
static IEnumerable< string > ListFileNames(string path)
static Stream OpenFile(string path, OpenFileMode openFileMode)
static string GetExtension(string path)
static string GetFileNameWithoutExtension(string path)
static long GetFileSize(string path)
static void DeleteFile(string path)
static string CombinePaths(params string[] paths)
static void ReadChunkHeader(Stream stream)
static void ReadTOCEntry(Stream stream, out int cx, out int cz, out int index)
static void WriteChunkHeader(Stream stream, int cx, int cz)
static void WriteTOCEntry(Stream stream, int cx, int cz, int index)
static void ConvertContentsLightData(ref int contents, ref int light, ref int data)
override string SourceVersion
void ConvertChunks(string directoryName)
override string TargetVersion
override void ConvertWorld(string directoryName)
static int ConvertValue(int value)
void ConvertProject(string directoryName)
override void ConvertProjectXml(XElement projectNode)
static void SetAttributeValue(XElement node, string attributeName, object value)
static object GetAttributeValue(XElement node, string attributeName, Type type)
static XElement LoadXmlFromStream(Stream stream, Encoding encoding, bool throwOnError)
static void SaveXmlToStream(XElement node, Stream stream, Encoding encoding, bool throwOnError)