mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 14:43:36 +00:00
# Conflicts: # Minecraft.Client/Network/PlayerChunkMap.cpp # Minecraft.Client/Network/PlayerList.cpp # Minecraft.Client/Network/ServerChunkCache.cpp # Minecraft.Client/Platform/Common/Consoles_App.cpp # Minecraft.Client/Platform/Common/DLC/DLCManager.cpp # Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp # Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp # Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp # Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp # Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp # Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp # Minecraft.Client/Platform/Common/UI/UIController.cpp # Minecraft.Client/Platform/Common/UI/UIController.h # Minecraft.Client/Platform/Extrax64Stubs.cpp # Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h # Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h # Minecraft.Client/Player/EntityTracker.cpp # Minecraft.Client/Player/ServerPlayer.cpp # Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp # Minecraft.Client/Textures/Packs/DLCTexturePack.cpp # Minecraft.Client/Textures/Stitching/StitchedTexture.cpp # Minecraft.Client/Textures/Stitching/TextureMap.cpp # Minecraft.Client/Textures/Textures.cpp # Minecraft.World/Blocks/NotGateTile.cpp # Minecraft.World/Blocks/PressurePlateTile.cpp # Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp # Minecraft.World/Enchantments/EnchantmentHelper.cpp # Minecraft.World/Entities/HangingEntity.cpp # Minecraft.World/Entities/LeashFenceKnotEntity.cpp # Minecraft.World/Entities/LivingEntity.cpp # Minecraft.World/Entities/Mobs/Boat.cpp # Minecraft.World/Entities/Mobs/Minecart.cpp # Minecraft.World/Entities/Mobs/Witch.cpp # Minecraft.World/Entities/SyncedEntityData.cpp # Minecraft.World/Items/LeashItem.cpp # Minecraft.World/Items/PotionItem.cpp # Minecraft.World/Level/BaseMobSpawner.cpp # Minecraft.World/Level/CustomLevelSource.cpp # Minecraft.World/Level/Level.cpp # Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp # Minecraft.World/Level/Storage/McRegionLevelStorage.cpp # Minecraft.World/Level/Storage/RegionFileCache.cpp # Minecraft.World/Player/Player.cpp # Minecraft.World/WorldGen/Biomes/BiomeCache.cpp # Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp # Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp
137 lines
4.3 KiB
C++
137 lines
4.3 KiB
C++
#include "../../../Minecraft.World/Platform/stdafx.h"
|
|
#include "../Common/Consoles_App.h"
|
|
#include "../../Player/User.h"
|
|
#include "../../Minecraft.h"
|
|
#include "../../MinecraftServer.h"
|
|
#include "../../Network/PlayerList.h"
|
|
#include "../../Player/ServerPlayer.h"
|
|
#include "../../../Minecraft.World/Level/Level.h"
|
|
#include "../../../Minecraft.World/Level/Storage/LevelSettings.h"
|
|
#include "../../../Minecraft.World/WorldGen/Biomes/BiomeSource.h"
|
|
#include "../../../Minecraft.World/Level/Storage/LevelType.h"
|
|
#include "Windows64_App.h"
|
|
|
|
CConsoleMinecraftApp app;
|
|
|
|
#define CONTEXT_GAME_STATE 0
|
|
|
|
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
|
|
{
|
|
}
|
|
|
|
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId)
|
|
{
|
|
ProfileManager.SetRichPresenceContextValue(iPad,CONTEXT_GAME_STATE,contextId);
|
|
}
|
|
|
|
void CConsoleMinecraftApp::StoreLaunchData()
|
|
{
|
|
}
|
|
void CConsoleMinecraftApp::ExitGame()
|
|
{
|
|
}
|
|
void CConsoleMinecraftApp::FatalLoadError()
|
|
{
|
|
}
|
|
|
|
void CConsoleMinecraftApp::CaptureSaveThumbnail()
|
|
{
|
|
}
|
|
void CConsoleMinecraftApp::GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize)
|
|
{
|
|
}
|
|
void CConsoleMinecraftApp::ReleaseSaveThumbnail()
|
|
{
|
|
}
|
|
|
|
void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize)
|
|
{
|
|
}
|
|
|
|
void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|
{
|
|
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit
|
|
|
|
app.setLevelGenerationOptions(nullptr);
|
|
|
|
// From CScene_Main::RunPlayGame
|
|
Minecraft *pMinecraft=Minecraft::GetInstance();
|
|
app.ReleaseSaveThumbnail();
|
|
ProfileManager.SetLockedProfile(0);
|
|
pMinecraft->user->name = L"Windows";
|
|
app.ApplyGameSettingsChanged(0);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameJoinLoad::OnInit
|
|
MinecraftServer::resetFlags();
|
|
|
|
// From CScene_MultiGameJoinLoad::OnNotifyPressEx
|
|
app.SetTutorialMode( false );
|
|
app.SetCorruptSaveDeleted(false);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
|
|
|
app.ClearTerrainFeaturePosition();
|
|
std::wstring wWorldName = L"TestWorld";
|
|
|
|
StorageManager.ResetSaveData();
|
|
StorageManager.SetSaveTitle(wWorldName.c_str());
|
|
|
|
bool isFlat = false;
|
|
int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
|
|
|
|
NetworkGameInitData *param = new NetworkGameInitData();
|
|
param->seed = seedValue;
|
|
param->saveData = nullptr;
|
|
|
|
app.SetGameHostOption(eGameHostOption_Difficulty,0);
|
|
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0);
|
|
app.SetGameHostOption(eGameHostOption_Gamertags,1);
|
|
app.SetGameHostOption(eGameHostOption_BedrockFog,1);
|
|
|
|
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId() ); // LevelSettings::GAMETYPE_SURVIVAL
|
|
app.SetGameHostOption(eGameHostOption_LevelType, 0 );
|
|
app.SetGameHostOption(eGameHostOption_Structures, 1 );
|
|
app.SetGameHostOption(eGameHostOption_BonusChest, 0 );
|
|
|
|
app.SetGameHostOption(eGameHostOption_PvP, 1);
|
|
app.SetGameHostOption(eGameHostOption_TrustPlayers, 1 );
|
|
app.SetGameHostOption(eGameHostOption_FireSpreads, 1 );
|
|
app.SetGameHostOption(eGameHostOption_TNT, 1 );
|
|
app.SetGameHostOption(eGameHostOption_HostCanFly, 1);
|
|
app.SetGameHostOption(eGameHostOption_HostCanChangeHunger, 1);
|
|
app.SetGameHostOption(eGameHostOption_HostCanBeInvisible, 1 );
|
|
|
|
param->settings = app.GetGameHostOption( eGameHostOption_All );
|
|
|
|
g_NetworkManager.FakeLocalPlayerJoined();
|
|
|
|
LoadingInputParams *loadingParams = new LoadingInputParams();
|
|
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
|
|
loadingParams->lpParam = param;
|
|
|
|
// Reset the autosave time
|
|
app.SetAutosaveTimerTime();
|
|
|
|
C4JThread* thread = new C4JThread(loadingParams->func, loadingParams->lpParam, "RunNetworkGame");
|
|
thread->Run();
|
|
}
|
|
|
|
int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
|
|
{
|
|
}
|