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