Cleaned up some copy-pasted code for coloured blocks names

This commit is contained in:
Dylan K. Taylor
2017-08-16 14:38:41 +01:00
parent 8510be062c
commit 021dbd65d7
12 changed files with 72 additions and 92 deletions

View File

@ -49,11 +49,9 @@ class DoubleWoodenSlab extends Solid{
2 => "Birch",
3 => "Jungle",
4 => "Acacia",
5 => "Dark Oak",
6 => "",
7 => ""
5 => "Dark Oak"
];
return "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
return "Double " . ($names[$this->meta & 0x07] ?? "") . " Wooden Slab";
}
public function getDrops(Item $item){