Item: Added API method getVanillaName()

This allows retrieving the name of an item without the custom name being plastered over the top. This will also allow weird things to have special functions for their names.
This commit is contained in:
Dylan K. Taylor 2018-02-16 10:57:02 +00:00
parent 7fc3eeab00
commit be1ddb9f5b

View File

@ -633,7 +633,15 @@ class Item implements ItemIds, \JsonSerializable{
* @return string
*/
final public function getName() : string{
return $this->hasCustomName() ? $this->getCustomName() : $this->name;
return $this->hasCustomName() ? $this->getCustomName() : $this->getVanillaName();
}
/**
* Returns the vanilla name of the item, disregarding custom names.
* @return string
*/
public function getVanillaName() : string{
return $this->name;
}
/**