minecart tnt fix

This commit is contained in:
Lord_Cambion 2026-03-28 14:44:56 +01:00
parent a282314267
commit 6fe251b2ec
3 changed files with 5 additions and 4 deletions

View file

@ -595,6 +595,7 @@ void ServerPlayer::die(DamageSource *source)
bool ServerPlayer::hurt(DamageSource *dmgSource, float dmg)
{
if (isInvulnerable()) return false;
if (gameMode == nullptr||gameMode->isCreative()) return false;
// 4J: Not relevant to console servers
// Allow falldamage on dedicated pvpservers -- so people cannot cheat their way out of 'fall traps'

View file

@ -56,11 +56,10 @@ bool ServerPlayerGameMode::isSurvival()
return gameModeForPlayer->isSurvival();
}
bool ServerPlayerGameMode::isCreative()
{
return gameModeForPlayer->isCreative();
bool ServerPlayerGameMode::isCreative() {
if (!this || !gameModeForPlayer) return false;
return gameModeForPlayer->isCreative();
}
void ServerPlayerGameMode::updateGameMode(GameType *gameType)
{
if (gameModeForPlayer == GameType::NOT_SET)

View file

@ -1384,6 +1384,7 @@ void Player::setDefaultHeadHeight()
bool Player::hurt(DamageSource *source, float dmg)
{
if (isInvulnerable()) return false;
if ( hasInvulnerablePrivilege() || (abilities.invulnerable && !source->isBypassInvul()) ) return false;
// 4J-JEV: Fix for PSVita: #3987 - [IN GAME] The user can take damage/die, when attempting to re-enter fly mode when falling from a height.