refactor: decouple minecraft/ from app/ via IGameServices virtual interface

This commit is contained in:
MatthewBeshay
2026-04-06 16:14:25 +10:00
committed by Tropical
parent 7787015025
commit 5d9bcac156
246 changed files with 1897 additions and 2224 deletions

View File

@@ -1,6 +1,4 @@
#include "minecraft/GameServices.h"
#include "minecraft/util/DebugSettings.h"
#include "minecraft/GameHostOptions.h"
#include "minecraft/IGameServices.h"
#include "minecraft/util/Log.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.h"
@@ -18,7 +16,7 @@
#include <utility>
#include "platform/PlatformTypes.h"
#include "app/common/App_enums.h"
#include "minecraft/GameEnums.h"
#include "app/common/BuildVer/BuildVer.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/linux/LinuxGame.h"
@@ -371,7 +369,7 @@ ConsoleSaveFileSplit::ConsoleSaveFileSplit(
// Load a save from the game rules
bool bLevelGenBaseSave = false;
LevelGenerationOptions* levelGen = GameServices::getLevelGenerationOptions();
LevelGenerationOptions* levelGen = gameServices().getLevelGenerationOptions();
if (pvSaveData == nullptr && levelGen != nullptr &&
levelGen->requiresBaseSave()) {
pvSaveData = levelGen->getBaseSaveData(fileSize);
@@ -1367,9 +1365,9 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
hasSeed = true;
}
int iTextMetadataBytes = GameServices::createImageTextData(
int iTextMetadataBytes = gameServices().createImageTextData(
bTextMetadata, seed, hasSeed,
GameHostOptions::get(eGameHostOption_All),
gameServices().getGameHostOption(eGameHostOption_All),
Minecraft::GetInstance()->getCurrentTexturePackId());
// set the icon and save image
@@ -1388,8 +1386,8 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
return SaveSaveDataCallback(this, bRes);
});
#if !defined(_CONTENT_PACKAGE)
if (DebugSettings::isOn()) {
if (GameServices::getWriteSavesToFolderEnabled()) {
if (gameServices().debugSettingsOn()) {
if (gameServices().getWriteSavesToFolderEnabled()) {
DebugFlushToFile(compData, compLength + 8);
}
}