From ac157f223256dad3a5c529c3f98e158fcba29f1c Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Fri, 8 Apr 2016 11:54:09 +0800 Subject: [PATCH] Added Armor::getCustomColor --- src/pocketmine/item/Armor.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pocketmine/item/Armor.php b/src/pocketmine/item/Armor.php index 6aa7827..fb3e982 100644 --- a/src/pocketmine/item/Armor.php +++ b/src/pocketmine/item/Armor.php @@ -46,6 +46,15 @@ abstract class Armor extends Item{ $this->setCompoundTag($tag); } + public function getCustomColor(){ + if(!$this->hasCompoundTag()) return null; + $tag = $this->getNamedTag(); + if(isset($tag->customColor)){ + return $tag["customColor"]; + } + return null; + } + public function clearCustomColor(){ if(!$this->hasCompoundTag()) return; $tag = $this->getNamedTag();