diff --git a/src/pocketmine/block/Air.php b/src/pocketmine/block/Air.php index 4a9b5b456..9908bea83 100644 --- a/src/pocketmine/block/Air.php +++ b/src/pocketmine/block/Air.php @@ -44,11 +44,7 @@ class Air extends Transparent{ } public function getBoundingBox(){ - return new AxisAlignedBB(0, 0, 0, 0, 0, 0); - } - - public function collidesWithBB(AxisAlignedBB $bb, &$list = []){ - + return null; } } \ No newline at end of file diff --git a/src/pocketmine/block/Beetroot.php b/src/pocketmine/block/Beetroot.php index b26c68716..a603a3cbc 100644 --- a/src/pocketmine/block/Beetroot.php +++ b/src/pocketmine/block/Beetroot.php @@ -32,6 +32,10 @@ class Beetroot extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/BrownMushroom.php b/src/pocketmine/block/BrownMushroom.php index b06232293..bc048f77f 100644 --- a/src/pocketmine/block/BrownMushroom.php +++ b/src/pocketmine/block/BrownMushroom.php @@ -54,4 +54,9 @@ class BrownMushroom extends Flowable{ return false; } + + public function getBoundingBox(){ + return null; + } + } \ No newline at end of file diff --git a/src/pocketmine/block/Carrot.php b/src/pocketmine/block/Carrot.php index cedcf5a7a..fc3249adc 100644 --- a/src/pocketmine/block/Carrot.php +++ b/src/pocketmine/block/Carrot.php @@ -32,6 +32,11 @@ class Carrot extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/CyanFlower.php b/src/pocketmine/block/CyanFlower.php index 558396499..d4aaa0d52 100644 --- a/src/pocketmine/block/CyanFlower.php +++ b/src/pocketmine/block/CyanFlower.php @@ -31,6 +31,11 @@ class CyanFlower extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ diff --git a/src/pocketmine/block/Dandelion.php b/src/pocketmine/block/Dandelion.php index 183d589eb..a418b3e33 100644 --- a/src/pocketmine/block/Dandelion.php +++ b/src/pocketmine/block/Dandelion.php @@ -31,6 +31,11 @@ class Dandelion extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ diff --git a/src/pocketmine/block/DeadBush.php b/src/pocketmine/block/DeadBush.php index cd81c93dc..6bf63019a 100644 --- a/src/pocketmine/block/DeadBush.php +++ b/src/pocketmine/block/DeadBush.php @@ -30,6 +30,11 @@ class DeadBush extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent === true){ //Replace with common break method diff --git a/src/pocketmine/block/Fire.php b/src/pocketmine/block/Fire.php index 0774ce7af..f39fed38d 100644 --- a/src/pocketmine/block/Fire.php +++ b/src/pocketmine/block/Fire.php @@ -33,6 +33,11 @@ class Fire extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function getDrops(Item $item){ return []; } diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 0d5aca6e5..1814d1ccc 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -33,6 +33,11 @@ class Ladder extends Transparent{ $this->hardness = 2; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ if($target->isTransparent === false){ $faces = array( diff --git a/src/pocketmine/block/Lava.php b/src/pocketmine/block/Lava.php index 68d965c0b..23d6161c8 100644 --- a/src/pocketmine/block/Lava.php +++ b/src/pocketmine/block/Lava.php @@ -33,6 +33,11 @@ class Lava extends Liquid{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $ret = $this->getLevel()->setBlock($this, $this, true, false, true); $this->getLevel()->scheduleUpdate(clone $this, 40); diff --git a/src/pocketmine/block/MelonStem.php b/src/pocketmine/block/MelonStem.php index 672db32a0..80bac0a9a 100644 --- a/src/pocketmine/block/MelonStem.php +++ b/src/pocketmine/block/MelonStem.php @@ -32,6 +32,11 @@ class MelonStem extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/Potato.php b/src/pocketmine/block/Potato.php index c5cdf93b5..d14df4001 100644 --- a/src/pocketmine/block/Potato.php +++ b/src/pocketmine/block/Potato.php @@ -32,6 +32,11 @@ class Potato extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/PumpkinStem.php b/src/pocketmine/block/PumpkinStem.php index ee7129a4b..69efbdf6d 100644 --- a/src/pocketmine/block/PumpkinStem.php +++ b/src/pocketmine/block/PumpkinStem.php @@ -32,6 +32,11 @@ class PumpkinStem extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/RedMushroom.php b/src/pocketmine/block/RedMushroom.php index 847f8df14..3cd1d54df 100644 --- a/src/pocketmine/block/RedMushroom.php +++ b/src/pocketmine/block/RedMushroom.php @@ -31,6 +31,11 @@ class RedMushroom extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent === true){ //Replace with common break method diff --git a/src/pocketmine/block/Sapling.php b/src/pocketmine/block/Sapling.php index 94fa70be9..bb5f3014d 100644 --- a/src/pocketmine/block/Sapling.php +++ b/src/pocketmine/block/Sapling.php @@ -49,6 +49,11 @@ class Sapling extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::GRASS or $down->getID() === self::DIRT or $down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/block/SignPost.php b/src/pocketmine/block/SignPost.php index a1778a5fe..56f45b257 100644 --- a/src/pocketmine/block/SignPost.php +++ b/src/pocketmine/block/SignPost.php @@ -33,6 +33,11 @@ class SignPost extends Transparent{ $this->hardness = 5; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ if($face !== 0){ $faces = array( diff --git a/src/pocketmine/block/SnowLayer.php b/src/pocketmine/block/SnowLayer.php index 176710783..f434ee839 100644 --- a/src/pocketmine/block/SnowLayer.php +++ b/src/pocketmine/block/SnowLayer.php @@ -34,6 +34,11 @@ class SnowLayer extends Flowable{ $this->hardness = 0.5; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down instanceof Solid){ diff --git a/src/pocketmine/block/Sugarcane.php b/src/pocketmine/block/Sugarcane.php index 20a8cf48f..ca3421950 100644 --- a/src/pocketmine/block/Sugarcane.php +++ b/src/pocketmine/block/Sugarcane.php @@ -32,6 +32,11 @@ class Sugarcane extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function getDrops(Item $item){ return array( array(Item::SUGARCANE, 0, 1), diff --git a/src/pocketmine/block/TallGrass.php b/src/pocketmine/block/TallGrass.php index f7f51ff72..5dfb950ee 100644 --- a/src/pocketmine/block/TallGrass.php +++ b/src/pocketmine/block/TallGrass.php @@ -37,6 +37,11 @@ class TallGrass extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent === true){ //Replace with common break method diff --git a/src/pocketmine/block/Torch.php b/src/pocketmine/block/Torch.php index 72dc8f6e2..d93c916a9 100644 --- a/src/pocketmine/block/Torch.php +++ b/src/pocketmine/block/Torch.php @@ -31,6 +31,11 @@ class Torch extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ $side = $this->getDamage(); diff --git a/src/pocketmine/block/WallSign.php b/src/pocketmine/block/WallSign.php index 76c535533..7d7c7b898 100644 --- a/src/pocketmine/block/WallSign.php +++ b/src/pocketmine/block/WallSign.php @@ -27,6 +27,11 @@ class WallSign extends SignPost{ Transparent::__construct(self::WALL_SIGN, $meta, "Wall Sign"); } + public function getBoundingBox(){ + return null; + } + + public function onUpdate($type){ return false; } diff --git a/src/pocketmine/block/Water.php b/src/pocketmine/block/Water.php index 16e33ff13..0cb05f2f9 100644 --- a/src/pocketmine/block/Water.php +++ b/src/pocketmine/block/Water.php @@ -33,6 +33,11 @@ class Water extends Liquid{ $this->hardness = 500; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $ret = $this->getLevel()->setBlock($this, $this, true, false, true); $this->getLevel()->scheduleUpdate(clone $this, 10); diff --git a/src/pocketmine/block/Wheat.php b/src/pocketmine/block/Wheat.php index fa4f59c04..8e9d6390b 100644 --- a/src/pocketmine/block/Wheat.php +++ b/src/pocketmine/block/Wheat.php @@ -32,6 +32,11 @@ class Wheat extends Flowable{ $this->hardness = 0; } + public function getBoundingBox(){ + return null; + } + + public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $down = $this->getSide(0); if($down->getID() === self::FARMLAND){ diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index e7998b124..c03527a67 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -960,7 +960,7 @@ class Level implements ChunkManager, Metadatable{ //$face = -1; } - if($hand->isSolid === true and count($this->getCollidingEntities($hand->getBoundingBox())) > 0){ + if($hand->isSolid === true and $hand->getBoundingBox() !== null and count($this->getCollidingEntities($hand->getBoundingBox())) > 0){ return false; //Entity in block }