Final Update P2

This commit is contained in:
peytonplayz585 2023-07-31 19:14:10 -07:00
parent 66aadf368a
commit d71ebcd83f
3 changed files with 13 additions and 5 deletions

View File

@ -1130,7 +1130,9 @@ function nP_MinecraftMain_main($args) {
if ($ex2 !== null && $ex2 instanceof nPn_NBTTagCompound)
nPs_LevelStorageManager_levelStorage = $ex2;
}
if (!(nPs_LevelStorageManager_levelStorage.$tagMap !== null && nPs_LevelStorageManager_levelStorage.$tagMap.$elementCount))
if (nPs_LevelStorageManager_levelStorage.$tagMap === null)
nPs_LevelStorageManager_levelStorage = null;
else if (!nPs_LevelStorageManager_levelStorage.$tagMap.$elementCount)
nPs_LevelStorageManager_levelStorage = null;
$ex2 = nmc_Minecraft__init_(olo_WebGL_getCanvasWidth(), olo_WebGL_getCanvasHeight());
var$7 = new nmc_Session;
@ -4585,7 +4587,9 @@ function nPs_LevelStorageManager_saveLevelData() {
if ($rt_suspending()) {
break main;
}
if (!(nPs_LevelStorageManager_levelStorage.$tagMap !== null && nPs_LevelStorageManager_levelStorage.$tagMap.$elementCount))
if (nPs_LevelStorageManager_levelStorage.$tagMap === null)
nPs_LevelStorageManager_levelStorage = null;
else if (!nPs_LevelStorageManager_levelStorage.$tagMap.$elementCount)
nPs_LevelStorageManager_levelStorage = null;
return;
case 2:

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,9 @@ public class LevelStorageManager {
}
}
if(levelStorage.tagMap == null || levelStorage.tagMap.size() == 0) {
if(levelStorage.tagMap == null) {
levelStorage = null;
} else if(levelStorage.tagMap.size() == 0) {
levelStorage = null;
}
}
@ -34,7 +36,9 @@ public class LevelStorageManager {
ByteArrayOutputStream s = new ByteArrayOutputStream();
NBTBase.writeTag(levelStorage, new DataOutputStream(s));
GL11.writeFile("/saves/level1.dat", s.toByteArray());
if(levelStorage.tagMap == null || levelStorage.tagMap.size() == 0) {
if(levelStorage.tagMap == null) {
levelStorage = null;
} else if(levelStorage.tagMap.size() == 0) {
levelStorage = null;
}
}