PocketMine-MP 5.37.2 git-aa47b7cd412ddb171ec53c035c2bbe84199be285
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;
35
52 use RegistryTrait;
53
54 private function __construct(){
55 // NOOP
56 }
57
58 protected static function register(string $name, ArmorMaterial $armorMaterial) : void{
59 self::_registryRegister($name, $armorMaterial);
60 }
61
66 public static function getAll() : array{
67 // phpstan doesn't support generic traits yet :(
69 $result = self::_registryGetAll();
70 return $result;
71 }
72
73 protected static function setup() : void{
74 self::register("leather", new ArmorMaterial(15, new ArmorEquipLeatherSound()));
75 self::register("chainmail", new ArmorMaterial(12, new ArmorEquipChainSound()));
76 self::register("copper", new ArmorMaterial(8, new ArmorEquipCopperSound()));
77 self::register("iron", new ArmorMaterial(9, new ArmorEquipIronSound()));
78 self::register("turtle", new ArmorMaterial(9, new ArmorEquipGenericSound()));
79 self::register("gold", new ArmorMaterial(25, new ArmorEquipGoldSound()));
80 self::register("diamond", new ArmorMaterial(10, new ArmorEquipDiamondSound()));
81 self::register("netherite", new ArmorMaterial(15, new ArmorEquipNetheriteSound()));
82 }
83}