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
22
declare(strict_types=1);
23
24
namespace
pocketmine\item
;
25
26
use pocketmine\utils\RegistryTrait;
27
use
pocketmine\world\sound\ArmorEquipChainSound
;
28
use
pocketmine\world\sound\ArmorEquipDiamondSound
;
29
use
pocketmine\world\sound\ArmorEquipGenericSound
;
30
use
pocketmine\world\sound\ArmorEquipGoldSound
;
31
use
pocketmine\world\sound\ArmorEquipIronSound
;
32
use
pocketmine\world\sound\ArmorEquipLeatherSound
;
33
use
pocketmine\world\sound\ArmorEquipNetheriteSound
;
34
49
final
class
VanillaArmorMaterials
{
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
}
pocketmine\item\ArmorMaterial
Definition
ArmorMaterial.php:28
pocketmine\item\VanillaArmorMaterials
Definition
VanillaArmorMaterials.php:49
pocketmine\item\VanillaArmorMaterials\getAll
static getAll()
Definition
VanillaArmorMaterials.php:64
pocketmine\world\sound\ArmorEquipChainSound
Definition
ArmorEquipChainSound.php:30
pocketmine\world\sound\ArmorEquipDiamondSound
Definition
ArmorEquipDiamondSound.php:30
pocketmine\world\sound\ArmorEquipGenericSound
Definition
ArmorEquipGenericSound.php:30
pocketmine\world\sound\ArmorEquipGoldSound
Definition
ArmorEquipGoldSound.php:30
pocketmine\world\sound\ArmorEquipIronSound
Definition
ArmorEquipIronSound.php:30
pocketmine\world\sound\ArmorEquipLeatherSound
Definition
ArmorEquipLeatherSound.php:30
pocketmine\world\sound\ArmorEquipNetheriteSound
Definition
ArmorEquipNetheriteSound.php:30
pocketmine\item
Definition
Apple.php:24
src
item
VanillaArmorMaterials.php
Generated by
1.12.0