mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-27 14:36:30 +01:00
QoL: port many commands from Java
setblock fill seed xp gamemode spectator summon effect difficulty spawnpoint setworldspawn kick enchant
This commit is contained in:
1 parent
b3e518a78e
commit
e3f9d90c5d
12 files changed
+3119
-104
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user