s/Item/Block

This commit is contained in:
Dylan K. Taylor 2017-08-07 16:26:27 +01:00
parent 2d8395f70e
commit 06083d6dc4
20 changed files with 22 additions and 22 deletions

View File

@ -688,7 +688,7 @@ class Block extends Position implements BlockIds, Metadatable{
return $this->getLevel()->getBlock(Vector3::getSide($side, $step)); 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)));
} }
/** /**

View File

@ -50,7 +50,7 @@ class Dirt extends Solid{
public function onActivate(Item $item, Player $player = null){ public function onActivate(Item $item, Player $player = null){
if($item->isHoe()){ if($item->isHoe()){
$item->useOn($this); $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; return true;
} }

View File

@ -40,7 +40,7 @@ class GlowingRedstoneOre extends RedstoneOre{
public function onUpdate($type){ public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_SCHEDULED or $type === Level::BLOCK_UPDATE_RANDOM){ 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; return Level::BLOCK_UPDATE_WEAK;
} }

View File

@ -434,9 +434,9 @@ abstract class Liquid extends Transparent{
if($colliding){ if($colliding){
if($this->getDamage() === 0){ 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){ }elseif($this->getDamage() <= 4){
$this->getLevel()->setBlock($this, Block::get(Item::COBBLESTONE), true, true); $this->getLevel()->setBlock($this, Block::get(Block::COBBLESTONE), true, true);
} }
} }
} }

View File

@ -50,7 +50,7 @@ class RedstoneOre extends Solid{
public function onUpdate($type){ public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){ 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; return Level::BLOCK_UPDATE_WEAK;
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Bed extends Item{ class Bed extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::BED, $meta, $count, "Bed");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class BeetrootSeeds extends Item{ class BeetrootSeeds extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::BEETROOT_SEEDS, $meta, $count, "Beetroot Seeds");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Cake extends Item{ class Cake extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::CAKE, $meta, $count, "Cake");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Carrot extends Food{ class Carrot extends Food{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::CARROT, $meta, $count, "Carrot");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class FlowerPot extends Item{ class FlowerPot extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::FLOWER_POT, $meta, $count, "Flower Pot");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class IronDoor extends Item{ class IronDoor extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::IRON_DOOR, $meta, $count, "Iron Door");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class MelonSeeds extends Item{ class MelonSeeds extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::MELON_SEEDS, $meta, $count, "Melon Seeds");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Potato extends Food{ class Potato extends Food{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::POTATO, $meta, $count, "Potato");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class PumpkinSeeds extends Item{ class PumpkinSeeds extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::PUMPKIN_SEEDS, $meta, $count, "Pumpkin Seeds");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Sign extends Item{ class Sign extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::SIGN, $meta, $count, "Sign");
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Skull extends Item{ class Skull extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::SKULL, $meta, $count, "Mob Head");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class Sugarcane extends Item{ class Sugarcane extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::SUGARCANE, $meta, $count, "Sugar Cane");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class WheatSeeds extends Item{ class WheatSeeds extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::WHEAT_SEEDS, $meta, $count, "Wheat Seeds");
} }
} }

View File

@ -27,7 +27,7 @@ use pocketmine\block\Block;
class WoodenDoor extends Item{ class WoodenDoor extends Item{
public function __construct($meta = 0, $count = 1){ 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"); parent::__construct(self::WOODEN_DOOR, $meta, $count, "Wooden Door");
} }

View File

@ -191,7 +191,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
$this->namedtag->BurnTime->setValue($ev->getBurnTime()); $this->namedtag->BurnTime->setValue($ev->getBurnTime());
$this->namedtag->BurnTicks = new ShortTag("BurnTicks", 0); $this->namedtag->BurnTicks = new ShortTag("BurnTicks", 0);
if($this->getBlock()->getId() === Item::FURNACE){ 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()){ if($this->namedtag->BurnTime->getValue() > 0 and $ev->isBurning()){
@ -254,7 +254,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
$ret = true; $ret = true;
}else{ }else{
if($this->getBlock()->getId() === Item::BURNING_FURNACE){ 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->BurnTime->setValue(0);
$this->namedtag->CookTime->setValue(0); $this->namedtag->CookTime->setValue(0);