mirror of
https://github.com/BluTac10/Xbox-Neo.git
synced 2026-05-31 15:24:38 +00:00
added marvelcocode's pr
https://github.com/smartcmd/MinecraftConsoles/pull/1169
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user