mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Clean up handling of armour sync
This commit is contained in:
@ -48,6 +48,7 @@ use pocketmine\network\mcpe\protocol\ClientboundPacket;
|
||||
use pocketmine\network\mcpe\protocol\DisconnectPacket;
|
||||
use pocketmine\network\mcpe\protocol\InventoryContentPacket;
|
||||
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobEffectPacket;
|
||||
use pocketmine\network\mcpe\protocol\ModalFormRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
|
||||
@ -817,6 +818,13 @@ class NetworkSession{
|
||||
}
|
||||
}
|
||||
|
||||
public function onMobArmorChange(Living $mob) : void{
|
||||
$pk = new MobArmorEquipmentPacket();
|
||||
$pk->entityRuntimeId = $mob->getId();
|
||||
$pk->slots = $mob->getArmorInventory()->getContents(true); //beware this order might change in the future
|
||||
$this->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
public function tick() : bool{
|
||||
if($this->handler instanceof LoginSessionHandler){
|
||||
if(time() >= $this->connectTime + 10){
|
||||
|
Reference in New Issue
Block a user