mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
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:
parent
7fc3eeab00
commit
be1ddb9f5b
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user