forked from phildier/dat_converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass.ItemStack.php
49 lines (43 loc) · 1.03 KB
/
class.ItemStack.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
class ItemStack
{
public $type = null;
public $amount = null;
public $damage = null;
public $meta = null;
public function __construct($type,$amount=1,$damage=null)
{
if(is_int($type)) {
$type = strtolower(Materials::getName($type));
}
$this->type = $type;
$this->amount = $amount;
$this->damage = $damage;
$java = "==";
$this->$java = "org.bukkit.inventory.ItemStack";
}
public function enchant($type,$level)
{
$this->meta["=="] = "ItemMeta";
$this->meta["meta-type"] = "UNSPECIFIC";
if(is_int($type)) {
$type = Enchantments::getName($type);
}
$this->meta["enchants"][$type] = $level;
}
public function enchantStored($type,$level)
{
$this->meta["=="] = "ItemMeta";
$this->meta["meta-type"] = "UNSPECIFIC";
if(is_int($type)) {
$type = Enchantments::getName($type);
}
$this->meta["stored-enchants"][$type] = $level;
}
public function display($display)
{
$this->meta["=="] = "ItemMeta";
$this->meta["meta-type"] = "UNSPECIFIC";
$this->meta["display-name"] = $display->name;
}
}