PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
VanillaArmorMaterials.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\item;
25
26use pocketmine\utils\RegistryTrait;
34
50 use RegistryTrait;
51
52 private function __construct(){
53 // NOOP
54 }
55
56 protected static function register(string $name, ArmorMaterial $armorMaterial) : void{
57 self::_registryRegister($name, $armorMaterial);
58 }
59
64 public static function getAll() : array{
65 // phpstan doesn't support generic traits yet :(
67 $result = self::_registryGetAll();
68 return $result;
69 }
70
71 protected static function setup() : void{
72 self::register("leather", new ArmorMaterial(15, new ArmorEquipLeatherSound()));
73 self::register("chainmail", new ArmorMaterial(12, new ArmorEquipChainSound()));
74 self::register("iron", new ArmorMaterial(9, new ArmorEquipIronSound()));
75 self::register("turtle", new ArmorMaterial(9, new ArmorEquipGenericSound()));
76 self::register("gold", new ArmorMaterial(25, new ArmorEquipGoldSound()));
77 self::register("diamond", new ArmorMaterial(10, new ArmorEquipDiamondSound()));
78 self::register("netherite", new ArmorMaterial(15, new ArmorEquipNetheriteSound()));
79 }
80}