fix: dedicated server (#67)

* fix: dedicated server

* prioritize item.h when building item mappings
This commit is contained in:
Fireblade 2026-05-14 06:27:56 -04:00 committed by GitHub
parent 60189f6ab6
commit f2193765d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 23 additions and 5 deletions

View file

@ -235,10 +235,14 @@ if(TARGET Minecraft.Server)
endif()
set(_item_map_inputs
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/Tile.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/Item.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/Tile.h"
)
if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
string(REPLACE ";" "\\;" _item_map_inputs "${_item_map_inputs}")
endif()
#neo: added ItemNameMap generation
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/generated/ItemNameMap.h"

View file

@ -946,7 +946,9 @@ void CMinecraftApp::InitGameSettings()
memset(pProfileSettings,0,sizeof(C_4JProfile::PROFILESETTINGS));
SetDefaultOptions(pProfileSettings,i);
Win64_LoadSettings(GameSettingsA[i]);
#ifndef MINECRAFT_SERVER_BUILD
ApplyGameSettingsChanged(i);
#endif
#elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__
C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i);
// 4J-PB - don't cause an options write to happen here

View file

@ -6,7 +6,7 @@
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\net.minecraft.stats.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.effect.h"
#include "..\..\MultiplayerLocalPlayer.h"
#include "..\..\MultiPlayerLocalPlayer.h"
#include "..\..\Minecraft.h"
#include "..\..\Options.h"
#include "..\..\EntityRenderDispatcher.h"

View file

@ -148,6 +148,7 @@ GameRenderer::GameRenderer(Minecraft *mc)
itemInHandRenderer = nullptr;
// 4J-PB - set up the local players iteminhand renderers here - needs to be done with lighting enabled so that the render geometry gets compiled correctly
#ifndef MINECRAFT_SERVER_BUILD
glEnable(GL_LIGHTING);
mc->localitemInHandRenderers[0] = new ItemInHandRenderer(mc);//itemInHandRenderer;
mc->localitemInHandRenderers[1] = new ItemInHandRenderer(mc);
@ -170,7 +171,9 @@ GameRenderer::GameRenderer(Minecraft *mc)
for(int i=0;i<NUM_LIGHT_TEXTURES;i++)
lightPixels[i] = intArray(16*16);
#endif
#endif
#ifndef MINECRAFT_SERVER_BUILD
#ifdef MULTITHREAD_ENABLE
m_updateEvents = new C4JThread::EventArray(eUpdateEventCount, C4JThread::EventArray::e_modeAutoClear);
m_updateEvents->Set(eUpdateEventIsFinished);
@ -183,6 +186,7 @@ GameRenderer::GameRenderer(Minecraft *mc)
m_updateThread->SetProcessor(CPU_CORE_CHUNK_UPDATE);
m_updateThread->Run();
#endif
#endif
}
// 4J Stu Added to go with 1.8.2 change

View file

@ -2017,7 +2017,11 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
QueryPerformanceCounter(&asAfterRules);
#endif
#ifdef MINECRAFT_SERVER_BUILD
levels[0]->saveToDisc(nullptr, true);
#else
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, true);
#endif
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
QueryPerformanceCounter(&asAfterFlush);

View file

@ -84,6 +84,10 @@ do_cmake_configure() {
-imsvc $winsdk/sdk/include/um \
-imsvc $winsdk/sdk/include/shared"
if [[ "$BUILD_TYPE" == "Debug" ]]; then
c_flags="$c_flags -w"
fi
local linker_flags="\
-libpath:$winsdk/crt/lib/x86_64 \
-libpath:$winsdk/sdk/lib/um/x86_64 \
@ -155,7 +159,7 @@ write_client_launcher() {
#!/usr/bin/env bash
set -euo pipefail
GAME_DIR="$INSTALL_DIR/client"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/minecraft-lce-client}"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/neoLegacy/client}"
export WINEARCH=win64
export WINEPREFIX="\${WINEPREFIX:-\$HOME/.local/share/minecraft-lce-client-prefix}"
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
@ -183,7 +187,7 @@ set -euo pipefail
GAME_DIR="$INSTALL_DIR/server"
SERVER_PORT="\${MC_PORT:-25565}"
SERVER_BIND_IP="\${MC_BIND:-0.0.0.0}"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/minecraft-lce-server}"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/neoLegacy/server}"
export WINEARCH=win64
export WINEPREFIX="\${WINEPREFIX:-\$HOME/.local/share/minecraft-lce-server-prefix}"
export WINEDLLOVERRIDES="winemenubuilder.exe=d;winedbg.exe=d"
@ -226,7 +230,7 @@ set -euo pipefail
GAME_DIR="$INSTALL_DIR/fourkit"
SERVER_PORT="\${MC_PORT:-25565}"
SERVER_BIND_IP="\${MC_BIND:-0.0.0.0}"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/minecraft-lce-fourkit}"
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/neoLegacy/fourkit}"
export WINEARCH=win64
export WINEPREFIX="\${WINEPREFIX:-\$HOME/.local/share/minecraft-lce-fourkit-prefix}"
export WINEDLLOVERRIDES="winemenubuilder.exe=d;winedbg.exe=d"