Replaced literal ints with Vector3 constants for Block->getSide() calls

This commit is contained in:
Dylan K. Taylor
2017-08-04 13:33:23 +01:00
parent 3188f1c053
commit 2103c981a9
23 changed files with 77 additions and 65 deletions

View File

@ -64,7 +64,7 @@ class Mycelium extends Solid{
$z = mt_rand($this->z - 1, $this->z + 1);
$block = $this->getLevel()->getBlock(new Vector3($x, $y, $z));
if($block->getId() === Block::DIRT){
if($block->getSide(1) instanceof Transparent){
if($block->getSide(Vector3::SIDE_UP) instanceof Transparent){
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockSpreadEvent($block, $this, new Mycelium()));
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($block, $ev->getNewState());