From 2d8395f70e31d8ea0819d1660a70a0fcc0e71937 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 7 Aug 2017 16:09:10 +0100 Subject: [PATCH] Absorption should be a float. Fixed #1071 --- src/pocketmine/entity/Entity.php | 4 ++-- src/pocketmine/entity/Living.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 31a85fc63..0e1aa9924 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -910,11 +910,11 @@ abstract class Entity extends Location implements Metadatable{ } } - public function getAbsorption() : int{ + public function getAbsorption() : float{ return 0; } - public function setAbsorption(int $absorption){ + public function setAbsorption(float $absorption){ } diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 3f7c9e7f8..2d13a0918 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -120,11 +120,11 @@ abstract class Living extends Entity implements Damageable{ $this->attributeMap->getAttribute(Attribute::HEALTH)->setMaxValue($amount); } - public function getAbsorption() : int{ - return (int) $this->attributeMap->getAttribute(Attribute::ABSORPTION)->getValue(); + public function getAbsorption() : float{ + return $this->attributeMap->getAttribute(Attribute::ABSORPTION)->getValue(); } - public function setAbsorption(int $absorption){ + public function setAbsorption(float $absorption){ $this->attributeMap->getAttribute(Attribute::ABSORPTION)->setValue($absorption); }