87 protected const DEFAULT_BREATH_TICKS = 300;
100 private const TAG_LEGACY_HEALTH =
"HealF";
101 private const TAG_HEALTH =
"Health";
102 private const TAG_BREATH_TICKS =
"Air";
103 private const TAG_ACTIVE_EFFECTS =
"ActiveEffects";
104 private const TAG_EFFECT_ID =
"Id";
105 private const TAG_EFFECT_DURATION =
"Duration";
106 private const TAG_EFFECT_AMPLIFIER =
"Amplifier";
107 private const TAG_EFFECT_SHOW_PARTICLES =
"ShowParticles";
108 private const TAG_EFFECT_AMBIENT =
"Ambient";
110 protected int $attackTime = 0;
112 public int $deadTicks = 0;
113 protected int $maxDeadTicks = 25;
115 protected float $jumpVelocity = 0.42;
121 protected bool $breathing =
true;
122 protected int $breathTicks = self::DEFAULT_BREATH_TICKS;
123 protected int $maxBreathTicks = self::DEFAULT_BREATH_TICKS;
127 protected Attribute $knockbackResistanceAttr;
130 protected bool $sprinting =
false;
131 protected bool $sneaking =
false;
132 protected bool $gliding =
false;
133 protected bool $swimming =
false;
135 private ?
int $frostWalkerLevel =
null;
141 abstract public function getName() : string;
147 protected function initEntity(
CompoundTag $nbt) : void{
148 parent::initEntity($nbt);
151 $this->effectManager->getEffectAddHooks()->add(
function() :
void{ $this->networkPropertiesDirty =
true; });
152 $this->effectManager->getEffectRemoveHooks()->add(
function() :
void{ $this->networkPropertiesDirty =
true; });
154 $this->armorInventory =
new ArmorInventory($this);
156 $this->armorInventory->getListeners()->add(CallbackInventoryListener::onAnyChange(fn() => NetworkBroadcastUtils::broadcastEntityEvent(
158 fn(EntityEventBroadcaster $broadcaster, array $recipients) => $broadcaster->onMobArmorChange($recipients, $this)
160 $this->armorInventory->getListeners()->add(
new CallbackInventoryListener(
161 onSlotChange:
function(Inventory $inventory,
int $slot) :
void{
162 if($slot === ArmorInventory::SLOT_FEET){
163 $this->frostWalkerLevel =
null;
166 onContentChange:
function() :
void{ $this->frostWalkerLevel =
null; }
169 $health = $this->getMaxHealth();
171 if(($healFTag = $nbt->
getTag(self::TAG_LEGACY_HEALTH)) instanceof FloatTag){
172 $health = $healFTag->getValue();
173 }elseif(($healthTag = $nbt->
getTag(self::TAG_HEALTH)) instanceof ShortTag){
174 $health = $healthTag->getValue();
175 }elseif($healthTag instanceof FloatTag){
176 $health = $healthTag->getValue();
179 $this->setHealth($health);
181 $this->setAirSupplyTicks($nbt->getShort(self::TAG_BREATH_TICKS, self::DEFAULT_BREATH_TICKS));
184 $activeEffectsTag = $nbt->
getListTag(self::TAG_ACTIVE_EFFECTS);
185 if($activeEffectsTag !==
null){
186 foreach($activeEffectsTag as $e){
187 $effect = EffectIdMap::getInstance()->fromId($e->getByte(self::TAG_EFFECT_ID));
188 if($effect ===
null){
192 $this->effectManager->add(
new EffectInstance(
194 $e->getInt(self::TAG_EFFECT_DURATION),
195 Binary::unsignByte($e->getByte(self::TAG_EFFECT_AMPLIFIER)),
196 $e->getByte(self::TAG_EFFECT_SHOW_PARTICLES, 1) !== 0,
197 $e->getByte(self::TAG_EFFECT_AMBIENT, 0) !== 0
203 protected function addAttributes() : void{
204 $this->attributeMap->add($this->healthAttr = AttributeFactory::getInstance()->mustGet(Attribute::HEALTH));
205 $this->attributeMap->add(AttributeFactory::getInstance()->mustGet(Attribute::FOLLOW_RANGE));
206 $this->attributeMap->add($this->knockbackResistanceAttr = AttributeFactory::getInstance()->mustGet(Attribute::KNOCKBACK_RESISTANCE));
207 $this->attributeMap->add($this->moveSpeedAttr = AttributeFactory::getInstance()->mustGet(Attribute::MOVEMENT_SPEED));
208 $this->attributeMap->add(AttributeFactory::getInstance()->mustGet(Attribute::ATTACK_DAMAGE));
209 $this->attributeMap->add($this->absorptionAttr = AttributeFactory::getInstance()->mustGet(Attribute::ABSORPTION));
216 return $this->nameTag !==
"" ? $this->nameTag : $this->getName();
220 $wasAlive = $this->isAlive();
221 parent::setHealth($amount);
222 $this->healthAttr->setValue(ceil($this->getHealth()),
true);
223 if($this->isAlive() && !$wasAlive){
228 public function getMaxHealth() : int{
229 return (int) $this->healthAttr->getMaxValue();
232 public function setMaxHealth(
int $amount) : void{
233 $this->healthAttr->setMaxValue($amount)->setDefaultValue($amount);
236 public function getAbsorption() : float{
237 return $this->absorptionAttr->getValue();
240 public function setAbsorption(
float $absorption) : void{
241 $this->absorptionAttr->setValue($absorption);
244 public function isSneaking() : bool{
245 return $this->sneaking;
248 public function setSneaking(
bool $value =
true) : void{
249 $this->sneaking = $value;
250 $this->networkPropertiesDirty =
true;
251 $this->recalculateSize();
254 public function isSprinting() : bool{
255 return $this->sprinting;
258 public function setSprinting(
bool $value =
true) : void{
259 if($value !== $this->isSprinting()){
260 $this->sprinting = $value;
261 $this->networkPropertiesDirty =
true;
262 $moveSpeed = $this->getMovementSpeed();
263 $this->setMovementSpeed($value ? ($moveSpeed * 1.3) : ($moveSpeed / 1.3));
264 $this->moveSpeedAttr->markSynchronized(
false);
268 public function isGliding() : bool{
269 return $this->gliding;
272 public function setGliding(
bool $value =
true) : void{
273 $this->gliding = $value;
274 $this->networkPropertiesDirty =
true;
275 $this->recalculateSize();
278 public function isSwimming() : bool{
279 return $this->swimming;
282 public function setSwimming(
bool $value =
true) : void{
283 $this->swimming = $value;
284 $this->networkPropertiesDirty =
true;
285 $this->recalculateSize();
288 private function recalculateSize() : void{
289 $size = $this->getInitialSizeInfo();
290 if($this->isSwimming() || $this->isGliding()){
291 $width = $size->getWidth();
292 $this->setSize((
new EntitySizeInfo($width, $width, $width * 0.9))->scale($this->getScale()));
293 }elseif($this->isSneaking()){
294 $this->setSize((
new EntitySizeInfo(3 / 4 * $size->getHeight(), $size->getWidth(), 3 / 4 * $size->getEyeHeight()))->scale($this->getScale()));
296 $this->setSize($size->scale($this->getScale()));
300 public function getMovementSpeed() : float{
301 return $this->moveSpeedAttr->getValue();
304 public function setMovementSpeed(
float $v,
bool $fit =
false) : void{
305 $this->moveSpeedAttr->setValue($v, $fit);
308 public function saveNBT() : CompoundTag{
309 $nbt = parent::saveNBT();
310 $nbt->
setFloat(self::TAG_HEALTH, $this->getHealth());
312 $nbt->
setShort(self::TAG_BREATH_TICKS, $this->getAirSupplyTicks());
314 if(count($this->effectManager->all()) > 0){
316 foreach($this->effectManager->all() as $effect){
317 $effects[] = CompoundTag::create()
318 ->setByte(self::TAG_EFFECT_ID, EffectIdMap::getInstance()->toId($effect->getType()))
319 ->setByte(self::TAG_EFFECT_AMPLIFIER, Binary::signByte($effect->getAmplifier()))
320 ->setInt(self::TAG_EFFECT_DURATION, $effect->getDuration())
321 ->setByte(self::TAG_EFFECT_AMBIENT, $effect->isAmbient() ? 1 : 0)
322 ->setByte(self::TAG_EFFECT_SHOW_PARTICLES, $effect->isVisible() ? 1 : 0);
325 $nbt->
setTag(self::TAG_ACTIVE_EFFECTS,
new ListTag($effects));
332 return $this->effectManager;
340 $this->applyConsumptionResults($consumable);
349 foreach($consumable->getAdditionalEffects() as $effect){
350 $this->effectManager->add($effect);
356 $consumable->onConsume($this);
363 return $this->jumpVelocity + ((($jumpBoost = $this->effectManager->get(
VanillaEffects::JUMP_BOOST())) !== null ? $jumpBoost->getEffectLevel() : 0) / 10);
371 $this->motion = $this->motion->withComponents(
null, $this->getJumpVelocity(),
null);
375 protected function calculateFallDamage(
float $fallDistance) : float{
376 return ceil($fallDistance - 3 - (($jumpBoost = $this->effectManager->get(VanillaEffects::JUMP_BOOST())) !== null ? $jumpBoost->getEffectLevel() : 0));
380 $fallBlockPos = $this->location->floor();
381 $fallBlock = $this->getWorld()->getBlock($fallBlockPos);
382 if(count($fallBlock->getCollisionBoxes()) === 0){
383 $fallBlockPos = $fallBlockPos->down();
384 $fallBlock = $this->getWorld()->getBlock($fallBlockPos);
386 $newVerticalVelocity = $fallBlock->onEntityLand($this);
388 $damage = $this->calculateFallDamage($this->fallDistance);
393 $this->broadcastSound($damage > 4 ?
397 }elseif($fallBlock->getTypeId() !== BlockTypeIds::AIR){
398 $this->broadcastSound(
new EntityLandSound($this, $fallBlock));
400 return $newVerticalVelocity;
410 foreach($this->armorInventory->getContents() as $item){
411 $total += $item->getDefensePoints();
422 foreach($this->armorInventory->getContents() as $item){
423 $result = max($result, $item->getEnchantmentLevel($enchantment));
429 public function getArmorInventory() : ArmorInventory{
430 return $this->armorInventory;
433 public function setOnFire(
int $seconds) : void{
434 parent::setOnFire($seconds - (int) min($seconds, $seconds * $this->getHighestArmorEnchantmentLevel(VanillaEnchantments::FIRE_PROTECTION()) * 0.15));
442 if($this->lastDamageCause !== null && $this->attackTime > 0){
443 if($this->lastDamageCause->getBaseDamage() >= $source->
getBaseDamage()){
446 $source->setModifier(-$this->lastDamageCause->getBaseDamage(), EntityDamageEvent::MODIFIER_PREVIOUS_DAMAGE_COOLDOWN);
448 if($source->canBeReducedByArmor()){
450 $source->setModifier(-$source->getFinalDamage() * $this->getArmorPoints() * 0.04, EntityDamageEvent::MODIFIER_ARMOR);
453 $cause = $source->getCause();
454 if(($resistance = $this->effectManager->get(VanillaEffects::RESISTANCE())) !==
null && $cause !== EntityDamageEvent::CAUSE_VOID && $cause !== EntityDamageEvent::CAUSE_SUICIDE){
455 $source->setModifier(-$source->getFinalDamage() * min(1, 0.2 * $resistance->getEffectLevel()), EntityDamageEvent::MODIFIER_RESISTANCE);
459 foreach($this->armorInventory->getContents() as $item){
460 if($item instanceof Armor){
461 $totalEpf += $item->getEnchantmentProtectionFactor($source);
464 $source->setModifier(-$source->getFinalDamage() * min(ceil(min($totalEpf, 25) * (mt_rand(50, 100) / 100)), 20) * 0.04, EntityDamageEvent::MODIFIER_ARMOR_ENCHANTMENTS);
466 $source->setModifier(-min($this->getAbsorption(), $source->getFinalDamage()), EntityDamageEvent::MODIFIER_ABSORPTION);
468 if($cause === EntityDamageEvent::CAUSE_FALLING_BLOCK && $this->armorInventory->getHelmet() instanceof Armor){
469 $source->setModifier(-($source->getFinalDamage() / 4), EntityDamageEvent::MODIFIER_ARMOR_HELMET);
479 $this->setAbsorption(max(0, $this->getAbsorption() + $source->getModifier(
EntityDamageEvent::MODIFIER_ABSORPTION)));
481 $this->damageArmor($source->getBaseDamage());
486 foreach($this->armorInventory->getContents() as $k => $item){
487 if($item instanceof Armor && ($thornsLevel = $item->getEnchantmentLevel(VanillaEnchantments::THORNS())) > 0){
488 if(mt_rand(0, 99) < $thornsLevel * 15){
489 $this->damageItem($item, 3);
490 $damage += ($thornsLevel > 10 ? $thornsLevel - 10 : 1 + mt_rand(0, 3));
492 $this->damageItem($item, 1);
495 $this->armorInventory->setItem($k, $item);
500 $attacker->attack(new EntityDamageByEntityEvent($this, $attacker, EntityDamageEvent::CAUSE_MAGIC, $damage));
503 if($source->getModifier(EntityDamageEvent::MODIFIER_ARMOR_HELMET) < 0){
504 $helmet = $this->armorInventory->getHelmet();
505 if($helmet instanceof Armor){
506 $finalDamage = $source->getFinalDamage();
507 $this->damageItem($helmet, (int) round($finalDamage * 4 + Utils::getRandomFloat() * $finalDamage * 2));
508 $this->armorInventory->setHelmet($helmet);
519 $durabilityRemoved = (int) max(floor($damage / 4), 1);
521 $armor = $this->armorInventory->getContents();
522 foreach($armor as $slotId => $item){
523 if($item instanceof
Armor){
524 $oldItem = clone $item;
525 $this->damageItem($item, $durabilityRemoved);
526 if(!$item->equalsExact($oldItem)){
527 $this->armorInventory->setItem($slotId, $item);
533 private function damageItem(Durable $item,
int $durabilityRemoved) : void{
534 $item->applyDamage($durabilityRemoved);
535 if($item->isBroken()){
536 $this->broadcastSound(new ItemBreakSound());
540 public function attack(EntityDamageEvent $source) : void{
541 if($this->noDamageTicks > 0 && $source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){
545 if($this->effectManager->has(VanillaEffects::FIRE_RESISTANCE()) && (
546 $source->getCause() === EntityDamageEvent::CAUSE_FIRE
547 || $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK
548 || $source->getCause() === EntityDamageEvent::CAUSE_LAVA
554 if($source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){
555 $this->applyDamageModifiers($source);
558 if($source instanceof EntityDamageByEntityEvent && (
559 $source->getCause() === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION ||
560 $source->getCause() === EntityDamageEvent::CAUSE_ENTITY_EXPLOSION)
564 $base = $source->getKnockBack();
565 $source->setKnockBack($base - min($base, $base * $this->getHighestArmorEnchantmentLevel(VanillaEnchantments::BLAST_PROTECTION()) * 0.15));
568 parent::attack($source);
570 if($source->isCancelled()){
574 if($this->attackTime <= 0){
577 $this->attackTime = $source->getAttackCooldown();
579 if($source instanceof EntityDamageByChildEntityEvent){
580 $e = $source->getChild();
582 $motion = $e->getMotion();
583 $this->knockBack($motion->x, $motion->z, $source->getKnockBack(), $source->getVerticalKnockBackLimit());
585 }elseif($source instanceof EntityDamageByEntityEvent){
586 $e = $source->getDamager();
588 $deltaX = $this->location->x - $e->location->x;
589 $deltaZ = $this->location->z - $e->location->z;
590 $this->knockBack($deltaX, $deltaZ, $source->getKnockBack(), $source->getVerticalKnockBackLimit());
594 if($this->isAlive()){
595 $this->doHitAnimation();
599 if($this->isAlive()){
600 $this->applyPostDamageEffects($source);
604 protected function doHitAnimation() : void{
605 $this->broadcastAnimation(new HurtAnimation($this));
608 public function knockBack(
float $x,
float $z,
float $force = self::DEFAULT_KNOCKBACK_FORCE, ?
float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : void{
609 $f = sqrt($x * $x + $z * $z);
613 if(mt_rand() / mt_getrandmax() > $this->knockbackResistanceAttr->getValue()){
616 $motionX = $this->motion->x / 2;
617 $motionY = $this->motion->y / 2;
618 $motionZ = $this->motion->z / 2;
619 $motionX += $x * $f * $force;
621 $motionZ += $z * $f * $force;
623 $verticalLimit ??= $force;
624 if($motionY > $verticalLimit){
625 $motionY = $verticalLimit;
628 $this->setMotion(
new Vector3($motionX, $motionY, $motionZ));
633 $ev = new
EntityDeathEvent($this, $this->getDrops(), $this->getXpDropAmount());
635 foreach($ev->getDrops() as $item){
636 $this->getWorld()->dropItem($this->location, $item);
640 $this->getWorld()->dropExperience($this->location, $ev->getXpDropAmount());
642 $this->startDeathAnimation();
646 if($this->deadTicks < $this->maxDeadTicks){
647 $this->deadTicks += $tickDiff;
648 if($this->deadTicks >= $this->maxDeadTicks){
649 $this->endDeathAnimation();
653 return $this->deadTicks >= $this->maxDeadTicks;
656 protected function startDeathAnimation() : void{
657 $this->broadcastAnimation(new DeathAnimation($this));
660 protected function endDeathAnimation() : void{
661 $this->despawnFromAll();
664 protected function entityBaseTick(
int $tickDiff = 1) : bool{
665 Timings::$livingEntityBaseTick->startTiming();
667 $hasUpdate = parent::entityBaseTick($tickDiff);
669 if($this->isAlive()){
670 if($this->effectManager->tick($tickDiff)){
674 if($this->isInsideOfSolid()){
676 $ev =
new EntityDamageEvent($this, EntityDamageEvent::CAUSE_SUFFOCATION, 1);
680 if($this->doAirSupplyTick($tickDiff)){
684 foreach($this->armorInventory->getContents() as $index => $item){
685 $oldItem = clone $item;
686 if($item->onTickWorn($this)){
688 if(!$item->equalsExact($oldItem)){
689 $this->armorInventory->setItem($index, $item);
695 if($this->attackTime > 0){
696 $this->attackTime -= $tickDiff;
699 Timings::$livingEntityBaseTick->stopTiming();
704 protected function move(
float $dx,
float $dy,
float $dz) : void{
705 $oldX = $this->location->x;
706 $oldZ = $this->location->z;
708 parent::move($dx, $dy, $dz);
710 $frostWalkerLevel = $this->getFrostWalkerLevel();
711 if($frostWalkerLevel > 0 && (abs($this->location->x - $oldX) > self::MOTION_THRESHOLD || abs($this->location->z - $oldZ) > self::MOTION_THRESHOLD)){
712 $this->applyFrostWalker($frostWalkerLevel);
716 protected function applyFrostWalker(
int $level) : void{
717 $radius = $level + 2;
718 $world = $this->getWorld();
720 $baseX = $this->location->getFloorX();
721 $y = $this->location->getFloorY() - 1;
722 $baseZ = $this->location->getFloorZ();
724 $frostedIce = VanillaBlocks::FROSTED_ICE();
725 for($x = $baseX - $radius; $x <= $baseX + $radius; $x++){
726 for($z = $baseZ - $radius; $z <= $baseZ + $radius; $z++){
727 $block = $world->getBlockAt($x, $y, $z);
729 !$block instanceof Water ||
730 !$block->isSource() ||
731 $world->getBlockAt($x, $y + 1, $z)->getTypeId() !== BlockTypeIds::AIR ||
732 count($world->getNearbyEntities(AxisAlignedBB::one()->offset($x, $y, $z))) !== 0
736 $world->setBlockAt($x, $y, $z, $frostedIce);
741 public function getFrostWalkerLevel() : int{
742 return $this->frostWalkerLevel ??= $this->armorInventory->getBoots()->
getEnchantmentLevel(VanillaEnchantments::FROST_WALKER());
749 $ticks = $this->getAirSupplyTicks();
751 if(!$this->canBreathe()){
752 $this->setBreathing(
false);
754 if(($respirationLevel = $this->armorInventory->getHelmet()->getEnchantmentLevel(VanillaEnchantments::RESPIRATION())) <= 0 ||
755 Utils::getRandomFloat() <= (1 / ($respirationLevel + 1))
760 $this->onAirExpired();
763 }elseif(!$this->isBreathing()){
764 if($ticks < ($max = $this->getMaxAirSupplyTicks())){
765 $ticks += $tickDiff * 5;
769 $this->setBreathing(
true);
773 if($ticks !== $oldTicks){
774 $this->setAirSupplyTicks($ticks);
777 return $ticks !== $oldTicks;
784 return $this->effectManager->has(
VanillaEffects::WATER_BREATHING()) || $this->effectManager->has(
VanillaEffects::CONDUIT_POWER()) || !$this->isUnderwater();
791 return $this->breathing;
799 $this->breathing = $value;
800 $this->networkPropertiesDirty =
true;
808 return $this->breathTicks;
815 $this->breathTicks = $ticks;
816 $this->networkPropertiesDirty =
true;
823 return $this->maxBreathTicks;
830 $this->maxBreathTicks = $ticks;
831 $this->networkPropertiesDirty =
true;
863 public function getLineOfSight(
int $maxDistance,
int $maxLength = 0, array $transparent = []) : array{
864 if($maxDistance > 120){
868 if(count($transparent) === 0){
875 foreach(VoxelRayTrace::inDirection($this->location->add(0, $this->size->getEyeHeight(), 0), $this->getDirectionVector(), $maxDistance) as $vector3){
876 $block = $this->getWorld()->getBlockAt($vector3->x, $vector3->y, $vector3->z);
877 $blocks[$nextIndex++] = $block;
879 if($maxLength !== 0 && count($blocks) > $maxLength){
880 array_shift($blocks);
884 $id = $block->getTypeId();
886 if($transparent ===
null){
887 if($id !== BlockTypeIds::AIR){
891 if(!isset($transparent[$id])){
905 $line = $this->getLineOfSight($maxDistance, 1, $transparent);
906 if(count($line) > 0){
907 return array_shift($line);
918 $horizontal = sqrt(($target->x - $this->location->x) ** 2 + ($target->z - $this->location->z) ** 2);
919 $vertical = $target->y - ($this->location->y + $this->getEyeHeight());
920 $pitch = -atan2($vertical, $horizontal) / M_PI * 180;
922 $xDist = $target->x - $this->location->x;
923 $zDist = $target->z - $this->location->z;
925 $yaw = atan2($zDist, $xDist) / M_PI * 180 - 90;
930 $this->setRotation($yaw, $pitch);
934 parent::sendSpawnPacket($player);
936 $networkSession = $player->getNetworkSession();
937 $networkSession->getEntityEventBroadcaster()->onMobArmorChange([$networkSession], $this);
941 parent::syncNetworkData($properties);
943 $visibleEffects = [];
944 foreach ($this->effectManager->all() as $effect) {
945 if (!$effect->isVisible() || !$effect->getType()->hasBubbles()) {
948 $visibleEffects[EffectIdMap::getInstance()->toId($effect->getType())] = $effect->isAmbient();
952 ksort($visibleEffects, SORT_NUMERIC);
955 $packedEffectsCount = 0;
956 foreach ($visibleEffects as $effectId => $isAmbient) {
957 $effectsData = ($effectsData << 7) |
958 (($effectId & 0x3f) << 1) |
959 ($isAmbient ? 1 : 0);
961 if (++$packedEffectsCount >= 8) {
965 $properties->setLong(EntityMetadataProperties::VISIBLE_MOB_EFFECTS, $effectsData);
967 $properties->setShort(EntityMetadataProperties::AIR, $this->breathTicks);
968 $properties->setShort(EntityMetadataProperties::MAX_AIR, $this->maxBreathTicks);
970 $properties->setGenericFlag(EntityMetadataFlags::BREATHING, $this->breathing);
971 $properties->setGenericFlag(EntityMetadataFlags::SNEAKING, $this->sneaking);
972 $properties->setGenericFlag(EntityMetadataFlags::SPRINTING, $this->sprinting);
973 $properties->setGenericFlag(EntityMetadataFlags::GLIDING, $this->gliding);
974 $properties->setGenericFlag(EntityMetadataFlags::SWIMMING, $this->swimming);
978 $this->armorInventory->removeAllViewers();
979 $this->effectManager->getEffectAddHooks()->clear();
980 $this->effectManager->getEffectRemoveHooks()->clear();
986 $this->armorInventory,
989 parent::destroyCycles();