Skip to content
This repository has been archived by the owner on Sep 8, 2018. It is now read-only.

Commit

Permalink
ArmorStand: remove ridiculous onUpdate
Browse files Browse the repository at this point in the history
Thx TeaSpoon for remember
  • Loading branch information
Enes5519 committed Mar 30, 2018
1 parent 226648f commit 2d0442e
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/pocketmine/entity/object/ArmorStand.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,9 @@ public function getPose() : int{
return $this->propertyManager->getInt(self::DATA_ARMOR_STAND_POSE);
}

public function onUpdate(int $currentTick): bool{
if(($hasUpdated = parent::onUpdate($currentTick))){
if($this->isAffectedByGravity()){
if($this->level->getBlock($this->getSide(Vector3::SIDE_DOWN)) === Item::AIR){
$this->applyGravity();
$this->level->broadcastLevelEvent($this, LevelEventPacket::EVENT_SOUND_ARMOR_STAND_FALL);
}
}
return true;
}

return $hasUpdated;
protected function applyGravity(){
$this->level->broadcastLevelEvent($this, LevelEventPacket::EVENT_SOUND_ARMOR_STAND_FALL);
parent::applyGravity();
}

public function saveNBT(){
Expand Down Expand Up @@ -273,8 +264,4 @@ public function getEquipmentSlot(Item $item) : int{
return -1; // mainhand
}
}

public function hasMovementUpdate() : bool{
return false;
}
}

0 comments on commit 2d0442e

Please sign in to comment.