Update #32 - Fixed some bugs in the client

This commit is contained in:
lax1dude
2024-05-30 21:42:11 -07:00
parent 6ea4ffe62d
commit aeb63fcd41
23 changed files with 214 additions and 52 deletions

View File

@ -74,13 +74,17 @@ public class WorldConverterMCA {
if (f.isDirectory()) continue;
String lowerName = f.getName().toLowerCase();
if (!(lowerName.endsWith(".dat") || lowerName.endsWith(".dat_old") || lowerName.endsWith(".mca") || lowerName.endsWith(".mcr") || lowerName.endsWith(".bmp"))) continue;
EaglerOutputStream baos = new EaglerOutputStream();
int len;
while ((len = zis.read(bb)) != -1) {
baos.write(bb, 0, len);
byte[] b;
int sz = (int)f.getSize();
if(sz >= 0) {
b = new byte[sz];
int j = 0, k;
while(j < b.length && (k = zis.read(b, j, b.length - j)) != -1) {
j += k;
}
}else {
b = EaglerInputStream.inputStreamToBytes(zis);
}
baos.close();
byte[] b = baos.toByteArray();
String fileName = f.getName().substring(folderPrefixOffset);
if (fileName.equals("level.dat") || fileName.equals("level.dat_old")) {
NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b));