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

@ -26,6 +26,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Vector3;
use pocketmine\Player;
class Carpet extends Flowable{
@ -79,7 +80,7 @@ class Carpet extends Flowable{
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
$down = $this->getSide(Vector3::SIDE_DOWN);
if($down->getId() !== self::AIR){
$this->getLevel()->setBlock($block, $this, true, true);
@ -91,7 +92,7 @@ class Carpet extends Flowable{
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getId() === self::AIR){
if($this->getSide(Vector3::SIDE_DOWN)->getId() === self::AIR){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;