-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclass.ItemStack.php
More file actions
39 lines (34 loc) · 794 Bytes
/
class.ItemStack.php
File metadata and controls
39 lines (34 loc) · 794 Bytes
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
<?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 = 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 display($display)
{
$this->meta["=="] = "ItemMeta";
$this->meta["meta-type"] = "UNSPECIFIC";
$this->meta["display-name"] = $display->name;
}
}