mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Updated method names: getMetadata() & setMetadata() to getDamage() & setDamage() on Block and Item classes
This commit is contained in:
@ -436,7 +436,7 @@ class Item{
|
||||
public static function get($id, $meta = 0, $count = 1){
|
||||
if(isset(self::$list[$id])){
|
||||
$item = clone self::$list[$id];
|
||||
$item->setMetadata($meta);
|
||||
$item->setDamage($meta);
|
||||
$item->setCount($count);
|
||||
}else{
|
||||
$item = new Item($id, $meta, $count);
|
||||
@ -517,11 +517,11 @@ class Item{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
final public function getMetadata(){
|
||||
final public function getDamage(){
|
||||
return $this->meta;
|
||||
}
|
||||
|
||||
public function setMetadata($meta){
|
||||
public function setDamage($meta){
|
||||
$this->meta = $meta & 0xFFFF;
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ class Item{
|
||||
}
|
||||
|
||||
public final function equals(Item $item, $checkDamage = false){
|
||||
return $this->id === $item->getID() and ($checkDamage === false or $this->getMetadata() === $item->getMetadata());
|
||||
return $this->id === $item->getID() and ($checkDamage === false or $this->getDamage() === $item->getDamage());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user