mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-05-31 10:27:09 +00:00
Prevent exit-without-saving loophole for hardcore players
Switch player to Adventure mode on death in hardcore mode, ban their XUID, and trigger a save action to prevent quitting without saving.
This commit is contained in:
@@ -568,6 +568,11 @@ void ServerPlayer::die(DamageSource *source)
|
||||
if (level->getLevelData()->isHardcore())
|
||||
{
|
||||
setGameMode(GameType::ADVENTURE);
|
||||
|
||||
// Ban this player's XUID and force-save so the host
|
||||
// cannot circumvent the death by quitting without saving.
|
||||
server->getPlayers()->banXuid(getOnlineXuid());
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_SaveGame);
|
||||
}
|
||||
|
||||
if (!level->getGameRules()->getBoolean(GameRules::RULE_KEEPINVENTORY))
|
||||
|
||||
Reference in New Issue
Block a user