mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Rename some meta usages to variant
This commit is contained in:
parent
7dd3b5b996
commit
93131b4d92
@ -37,8 +37,8 @@ class Banner extends Item{
|
||||
public const TAG_PATTERN_COLOR = TileBanner::TAG_PATTERN_COLOR;
|
||||
public const TAG_PATTERN_NAME = TileBanner::TAG_PATTERN_NAME;
|
||||
|
||||
public function __construct(int $meta){
|
||||
parent::__construct(self::BANNER, $meta, "Banner");
|
||||
public function __construct(int $variant){
|
||||
parent::__construct(self::BANNER, $variant, "Banner");
|
||||
}
|
||||
|
||||
public function getBlock() : Block{
|
||||
|
@ -27,8 +27,8 @@ use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
|
||||
class Bed extends Item{
|
||||
public function __construct(int $meta){
|
||||
parent::__construct(self::BED, $meta, "Bed");
|
||||
public function __construct(int $variant){
|
||||
parent::__construct(self::BED, $variant, "Bed");
|
||||
}
|
||||
|
||||
public function getBlock() : Block{
|
||||
|
@ -27,8 +27,8 @@ use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
|
||||
class Dye extends Item{
|
||||
public function __construct(int $meta){
|
||||
parent::__construct(self::DYE, $meta, "Dye");
|
||||
public function __construct(int $variant){
|
||||
parent::__construct(self::DYE, $variant, "Dye");
|
||||
}
|
||||
|
||||
public function getBlock() : Block{
|
||||
|
@ -187,15 +187,15 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
* purpose.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param int $variant
|
||||
* @param string $name
|
||||
*/
|
||||
public function __construct(int $id, int $meta = 0, string $name = "Unknown"){
|
||||
public function __construct(int $id, int $variant = 0, string $name = "Unknown"){
|
||||
if($id < -0x8000 or $id > 0x7fff){ //signed short range
|
||||
throw new \InvalidArgumentException("ID must be in range " . -0x8000 . " - " . 0x7fff);
|
||||
}
|
||||
$this->id = $id;
|
||||
$this->meta = $meta !== -1 ? $meta & 0x7FFF : -1;
|
||||
$this->meta = $variant !== -1 ? $variant & 0x7FFF : -1;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
|
@ -255,8 +255,8 @@ class Potion extends Item implements Consumable{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function __construct(int $meta){
|
||||
parent::__construct(self::POTION, $meta, "Potion");
|
||||
public function __construct(int $variant){
|
||||
parent::__construct(self::POTION, $variant, "Potion");
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
|
@ -27,8 +27,8 @@ use pocketmine\nbt\tag\CompoundTag;
|
||||
|
||||
class SplashPotion extends ProjectileItem{
|
||||
|
||||
public function __construct(int $meta){
|
||||
parent::__construct(self::SPLASH_POTION, $meta, "Splash Potion");
|
||||
public function __construct(int $variant){
|
||||
parent::__construct(self::SPLASH_POTION, $variant, "Splash Potion");
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
|
Loading…
x
Reference in New Issue
Block a user