PocketMine-MP 5.39.3 git-9a46a8bd745880ddf8eebaf28cda326bb97d2efa
Loading...
Searching...
No Matches
WoodType.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\block\utils;
25
26enum WoodType{
27 case OAK;
28 case SPRUCE;
29 case BIRCH;
30 case JUNGLE;
31 case ACACIA;
32 case DARK_OAK;
33 case MANGROVE;
34 case CRIMSON;
35 case WARPED;
36 case CHERRY;
37 case PALE_OAK;
38 case BAMBOO;
39
40 public function getDisplayName() : string{
41 return match($this){
42 self::OAK => "Oak",
43 self::SPRUCE => "Spruce",
44 self::BIRCH => "Birch",
45 self::JUNGLE => "Jungle",
46 self::ACACIA => "Acacia",
47 self::DARK_OAK => "Dark Oak",
48 self::MANGROVE => "Mangrove",
49 self::CRIMSON => "Crimson",
50 self::WARPED => "Warped",
51 self::CHERRY => "Cherry",
52 self::PALE_OAK => "Pale Oak",
53 self::BAMBOO => "Bamboo",
54 };
55 }
56
57 public function isFlammable() : bool{
58 return $this !== self::CRIMSON && $this !== self::WARPED;
59 }
60
61 public function getStandardLogSuffix() : ?string{
62 return match($this){
63 self::CRIMSON, self::WARPED => "Stem",
64 self::BAMBOO => "Block",
65 default => null,
66 };
67 }
68
69 public function getAllSidedLogSuffix() : ?string{
70 return $this === self::CRIMSON || $this === self::WARPED ? "Hyphae" : null;
71 }
72}