1- package com .ljyloo .PE2PC ;
1+ package com .ljyloo .MCMapFormatConverter ;
22
33import org .apache .commons .io .filefilter .SuffixFileFilter ;
44import org .iq80 .leveldb .*;
1616import java .util .Iterator ;
1717import 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