mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Cleaned up some copy-pasted code for coloured blocks names
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\utils\ColorBlockMetaHelper;
|
||||
use pocketmine\item\Tool;
|
||||
|
||||
class Wool extends Solid{
|
||||
@ -42,25 +43,7 @@ class Wool extends Solid{
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
static $names = [
|
||||
0 => "White Wool",
|
||||
1 => "Orange Wool",
|
||||
2 => "Magenta Wool",
|
||||
3 => "Light Blue Wool",
|
||||
4 => "Yellow Wool",
|
||||
5 => "Lime Wool",
|
||||
6 => "Pink Wool",
|
||||
7 => "Gray Wool",
|
||||
8 => "Light Gray Wool",
|
||||
9 => "Cyan Wool",
|
||||
10 => "Purple Wool",
|
||||
11 => "Blue Wool",
|
||||
12 => "Brown Wool",
|
||||
13 => "Green Wool",
|
||||
14 => "Red Wool",
|
||||
15 => "Black Wool",
|
||||
];
|
||||
return $names[$this->meta & 0x0f];
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Wool";
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user