mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-18 04:13:00 +00:00
added marvelcocode's pr
https://github.com/smartcmd/MinecraftConsoles/pull/1169
This commit is contained in:
parent
a83579edca
commit
f255035afd
|
|
@ -200,11 +200,17 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
|
|||
|
||||
header.ReadHeader( pvSaveMem, plat );
|
||||
|
||||
if (bLevelGenBaseSave)
|
||||
{
|
||||
header.AddFile(L"region_format_16");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the first 8 bytes that reference the header
|
||||
header.WriteHeader( pvSaveMem );
|
||||
|
||||
header.AddFile(L"region_format_16");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,8 @@ bool RegionFileCache::useSplitSaves(ESavePlatform platform)
|
|||
{
|
||||
case SAVE_FILE_PLATFORM_XBONE:
|
||||
case SAVE_FILE_PLATFORM_PS4:
|
||||
return true;
|
||||
case SAVE_FILE_PLATFORM_WIN64:
|
||||
{
|
||||
LevelGenerationOptions* lgo = app.getLevelGenerationOptions();
|
||||
return (lgo != nullptr && lgo->isFromDLC());
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
};
|
||||
|
|
@ -35,7 +31,12 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst
|
|||
File file;
|
||||
if(useSplitSaves(saveFile->getSavePlatform()))
|
||||
{
|
||||
file = File( prefix + wstring(L"r.") + std::to_wstring(chunkX>>4) + L"." + std::to_wstring(chunkZ>>4) + L".mcr" );
|
||||
bool isNew = saveFile->doesFileExist(ConsoleSavePath(L"region_format_16"));
|
||||
|
||||
if (isNew)
|
||||
file = File(prefix + wstring(L"r.") + std::to_wstring(chunkX >> 4) + L"." + std::to_wstring(chunkZ >> 4) + L".mcr");
|
||||
else
|
||||
file = File(prefix + wstring(L"r.") + std::to_wstring(chunkX >> 5) + L"." + std::to_wstring(chunkZ >> 5) + L".mcr");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -95,7 +96,8 @@ int RegionFileCache::_getSizeDelta(ConsoleSaveFile *saveFile, const wstring &pre
|
|||
DataInputStream *RegionFileCache::_getChunkDataInputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ)
|
||||
{
|
||||
RegionFile* r = _getRegionFile(saveFile, prefix, chunkX, chunkZ);
|
||||
if(useSplitSaves(saveFile->getSavePlatform()))
|
||||
bool isNew = saveFile->doesFileExist(ConsoleSavePath(L"region_format_16"));
|
||||
if (useSplitSaves(saveFile->getSavePlatform()) && isNew)
|
||||
{
|
||||
return r->getChunkDataInputStream(chunkX & 15, chunkZ & 15);
|
||||
}
|
||||
|
|
@ -109,7 +111,8 @@ DataInputStream *RegionFileCache::_getChunkDataInputStream(ConsoleSaveFile *save
|
|||
DataOutputStream *RegionFileCache::_getChunkDataOutputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ)
|
||||
{
|
||||
RegionFile* r = _getRegionFile(saveFile, prefix, chunkX, chunkZ);
|
||||
if(useSplitSaves(saveFile->getSavePlatform()))
|
||||
bool isNew = saveFile->doesFileExist(ConsoleSavePath(L"region_format_16"));
|
||||
if (useSplitSaves(saveFile->getSavePlatform()) && isNew)
|
||||
{
|
||||
return r->getChunkDataOutputStream(chunkX & 15, chunkZ & 15);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue