QoL: port many commands from Java

setblock
fill
seed
xp
gamemode spectator
summon
effect
difficulty
spawnpoint
setworldspawn
kick
enchant
This commit is contained in:
Anaël committed 2026-10-23 01:08:47 +02:00
1 parent b3e518a78e
commit e3f9d90c5d
12 files changed
+3119 -104

No files matched your search

+11 -5
View File
@@ -1982,8 +1982,11 @@ void ServerPlayer::restoreFrom(shared_ptr<Player> oldPlayer, bool restoreAll)
void ServerPlayer::onEffectAdded(MobEffectInstance *effect)
{
Player::onEffectAdded(effect);
connection->send(std::make_shared<UpdateMobEffectPacket>(entityId, effect));
if (this->connection != nullptr)
{
Player::onEffectAdded(effect);
connection->send(std::make_shared<UpdateMobEffectPacket>(entityId, effect));
}
}
@@ -1996,8 +1999,11 @@ void ServerPlayer::onEffectUpdated(MobEffectInstance *effect, bool doRefreshAttr
void ServerPlayer::onEffectRemoved(MobEffectInstance *effect)
{
Player::onEffectRemoved(effect);
connection->send(std::make_shared<RemoveMobEffectPacket>(entityId, effect));
if (this->connection != nullptr)
{
Player::onEffectRemoved(effect);
this->connection->send(std::make_shared<RemoveMobEffectPacket>(this->entityId, effect));
}
}
void ServerPlayer::teleportTo(double x, double y, double z)
@@ -2146,4 +2152,4 @@ bool ServerPlayer::isSpectator()
return false;
}
return gameMode->getGameType() == GameType::SPECTATOR;
}
}