Skip to content

Commit f5e9a97

Browse files
committed
Change stupid class name and update README
1 parent 86102f1 commit f5e9a97

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.mca

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ https://mojang.com/2012/02/new-minecraft-map-format-anvil/
2424
## Example:
2525

2626
`java -jar Converter.jar /home/ljyloo/LevelDB /home/ljyloo/Anvil 0`
27+
28+
## Attention:
29+
30+
This is an experimental project, it's highly recommended that you should backup your data before converting. Any data corruption caused by this program should be responsible for yourself.

src/com/ljyloo/PE2PC/PE2PC.java renamed to src/com/ljyloo/MCMapFormatConverter/MapFormatConverter.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ljyloo.PE2PC;
1+
package com.ljyloo.MCMapFormatConverter;
22

33
import org.apache.commons.io.filefilter.SuffixFileFilter;
44
import org.iq80.leveldb.*;
@@ -16,7 +16,7 @@
1616
import java.util.Iterator;
1717
import java.util.Map.Entry;
1818

19-
public class PE2PC {
19+
public class MapFormatConverter {
2020
private final static int DATALAYER_BITS = 7;
2121
private final static int BLOCKDATA_BYTES = 32768;
2222
private final static int METADATA_BYTES = 16384;
@@ -50,7 +50,7 @@ public static void main(String[] args) throws IOException {
5050
try {
5151
checkFolder(args[0], type);
5252
} catch (Exception e) {
53-
System.err.println("Failed to check folder \"" + args[0] + "\". Problem: " + e.getMessage());
53+
System.err.println("Failed to check folder \"" + args[0] + "\" 's validation. Problem: " + e.getMessage());
5454
System.out.println("\n");
5555
printUsageAndExit();
5656
}
@@ -127,6 +127,7 @@ private static void checkFolder(String path, int type) throws IOException {
127127

128128
}
129129

130+
130131
private static void printUsageAndExit() {
131132
System.out.println("Map converter for Minecraft:Pocket Edition, from format \"LevelDB\" to \"Anvil\", or from format \"Anvil\" to \"LevelDB\". (c) ljyloo 2015");
132133
System.out.println("");
@@ -302,10 +303,11 @@ public static void levelDB2Anvil(File src, File des) throws IOException{
302303
}
303304

304305
public static void anvilToLevelDB(File src, File des) throws IOException{
306+
DB db = null;
305307

306308
}
307309

308-
public static String byte2s(byte[] b, boolean ignoreTooLong){
310+
private static String byte2s(byte[] b, boolean ignoreTooLong){
309311
String s = "0x";
310312
int length = b.length;
311313
boolean tooLong = false;
@@ -321,7 +323,7 @@ public static String byte2s(byte[] b, boolean ignoreTooLong){
321323
return s;
322324
}
323325

324-
public static byte[] intToByteArray(int i){
326+
private static byte[] intToByteArray(int i){
325327
byte[] result = new byte[4];
326328
result[0] = (byte)((i >> 24) & 0xFF);
327329
result[1] = (byte)((i >> 16) & 0xFF);
@@ -330,7 +332,7 @@ public static byte[] intToByteArray(int i){
330332
return result;
331333
}
332334

333-
public static int byteArrayToInt(byte[] bytes){
335+
private static int byteArrayToInt(byte[] bytes){
334336
int value= 0;
335337
for (int i = 0; i < 4; i++){
336338
int shift = (4 - 1 - i) * 8;
@@ -339,7 +341,7 @@ public static int byteArrayToInt(byte[] bytes){
339341
return value;
340342
}
341343

342-
public static class LevelDBChunk{
344+
private static class LevelDBChunk{
343345
public OldDataLayer blockLight;
344346
public OldDataLayer skyLight;
345347
public OldDataLayer data;

0 commit comments

Comments
 (0)