mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
This commit is contained in:
@@ -44,8 +44,11 @@ class Armor extends Durable{
|
||||
|
||||
protected ?Color $customColor = null;
|
||||
|
||||
public function __construct(ItemIdentifier $identifier, string $name, ArmorTypeInfo $info){
|
||||
parent::__construct($identifier, $name);
|
||||
/**
|
||||
* @param string[] $enchantmentTags
|
||||
*/
|
||||
public function __construct(ItemIdentifier $identifier, string $name, ArmorTypeInfo $info, array $enchantmentTags = []){
|
||||
parent::__construct($identifier, $name, $enchantmentTags);
|
||||
$this->armorInfo = $info;
|
||||
}
|
||||
|
||||
@@ -72,6 +75,14 @@ class Armor extends Durable{
|
||||
return $this->armorInfo->isFireProof();
|
||||
}
|
||||
|
||||
public function getMaterial() : ArmorMaterial{
|
||||
return $this->armorInfo->getMaterial();
|
||||
}
|
||||
|
||||
public function getEnchantability() : int{
|
||||
return $this->armorInfo->getMaterial()->getEnchantability();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the dyed colour of this armour piece. This generally only applies to leather armour.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user