mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
s/Item/Block
This commit is contained in:
parent
2d8395f70e
commit
06083d6dc4
@ -688,7 +688,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
return $this->getLevel()->getBlock(Vector3::getSide($side, $step));
|
||||
}
|
||||
|
||||
return Block::get(Item::AIR, 0, Position::fromObject(Vector3::getSide($side, $step)));
|
||||
return Block::get(Block::AIR, 0, Position::fromObject(Vector3::getSide($side, $step)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,7 +50,7 @@ class Dirt extends Solid{
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->isHoe()){
|
||||
$item->useOn($this);
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::FARMLAND, 0), true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::FARMLAND, 0), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class GlowingRedstoneOre extends RedstoneOre{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_SCHEDULED or $type === Level::BLOCK_UPDATE_RANDOM){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::REDSTONE_ORE, $this->meta), false, false);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::REDSTONE_ORE, $this->meta), false, false);
|
||||
|
||||
return Level::BLOCK_UPDATE_WEAK;
|
||||
}
|
||||
|
@ -434,9 +434,9 @@ abstract class Liquid extends Transparent{
|
||||
|
||||
if($colliding){
|
||||
if($this->getDamage() === 0){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::OBSIDIAN), true, true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::OBSIDIAN), true, true);
|
||||
}elseif($this->getDamage() <= 4){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::COBBLESTONE), true, true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::COBBLESTONE), true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class RedstoneOre extends Solid{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta));
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::GLOWING_REDSTONE_ORE, $this->meta));
|
||||
|
||||
return Level::BLOCK_UPDATE_WEAK;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Bed extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::BED_BLOCK);
|
||||
$this->block = Block::get(Block::BED_BLOCK);
|
||||
parent::__construct(self::BED, $meta, $count, "Bed");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class BeetrootSeeds extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::BEETROOT_BLOCK);
|
||||
$this->block = Block::get(Block::BEETROOT_BLOCK);
|
||||
parent::__construct(self::BEETROOT_SEEDS, $meta, $count, "Beetroot Seeds");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Cake extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::CAKE_BLOCK);
|
||||
$this->block = Block::get(Block::CAKE_BLOCK);
|
||||
parent::__construct(self::CAKE, $meta, $count, "Cake");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Carrot extends Food{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::CARROT_BLOCK);
|
||||
$this->block = Block::get(Block::CARROT_BLOCK);
|
||||
parent::__construct(self::CARROT, $meta, $count, "Carrot");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class FlowerPot extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::FLOWER_POT_BLOCK);
|
||||
$this->block = Block::get(Block::FLOWER_POT_BLOCK);
|
||||
parent::__construct(self::FLOWER_POT, $meta, $count, "Flower Pot");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class IronDoor extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::IRON_DOOR_BLOCK);
|
||||
$this->block = Block::get(Block::IRON_DOOR_BLOCK);
|
||||
parent::__construct(self::IRON_DOOR, $meta, $count, "Iron Door");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class MelonSeeds extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::MELON_STEM);
|
||||
$this->block = Block::get(Block::MELON_STEM);
|
||||
parent::__construct(self::MELON_SEEDS, $meta, $count, "Melon Seeds");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Potato extends Food{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::POTATO_BLOCK);
|
||||
$this->block = Block::get(Block::POTATO_BLOCK);
|
||||
parent::__construct(self::POTATO, $meta, $count, "Potato");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class PumpkinSeeds extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::PUMPKIN_STEM);
|
||||
$this->block = Block::get(Block::PUMPKIN_STEM);
|
||||
parent::__construct(self::PUMPKIN_SEEDS, $meta, $count, "Pumpkin Seeds");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Sign extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::SIGN_POST);
|
||||
$this->block = Block::get(Block::SIGN_POST);
|
||||
parent::__construct(self::SIGN, $meta, $count, "Sign");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Skull extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::SKULL_BLOCK);
|
||||
$this->block = Block::get(Block::SKULL_BLOCK);
|
||||
parent::__construct(self::SKULL, $meta, $count, "Mob Head");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class Sugarcane extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::SUGARCANE_BLOCK);
|
||||
$this->block = Block::get(Block::SUGARCANE_BLOCK);
|
||||
parent::__construct(self::SUGARCANE, $meta, $count, "Sugar Cane");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class WheatSeeds extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::WHEAT_BLOCK);
|
||||
$this->block = Block::get(Block::WHEAT_BLOCK);
|
||||
parent::__construct(self::WHEAT_SEEDS, $meta, $count, "Wheat Seeds");
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\block\Block;
|
||||
|
||||
class WoodenDoor extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::WOODEN_DOOR_BLOCK);
|
||||
$this->block = Block::get(Block::WOODEN_DOOR_BLOCK);
|
||||
parent::__construct(self::WOODEN_DOOR, $meta, $count, "Wooden Door");
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
$this->namedtag->BurnTime->setValue($ev->getBurnTime());
|
||||
$this->namedtag->BurnTicks = new ShortTag("BurnTicks", 0);
|
||||
if($this->getBlock()->getId() === Item::FURNACE){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::BURNING_FURNACE, $this->getBlock()->getDamage()), true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::BURNING_FURNACE, $this->getBlock()->getDamage()), true);
|
||||
}
|
||||
|
||||
if($this->namedtag->BurnTime->getValue() > 0 and $ev->isBurning()){
|
||||
@ -254,7 +254,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
$ret = true;
|
||||
}else{
|
||||
if($this->getBlock()->getId() === Item::BURNING_FURNACE){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::FURNACE, $this->getBlock()->getDamage()), true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Block::FURNACE, $this->getBlock()->getDamage()), true);
|
||||
}
|
||||
$this->namedtag->BurnTime->setValue(0);
|
||||
$this->namedtag->CookTime->setValue(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user