diff --git a/src/pocketmine/block/BrownMushroom.php b/src/pocketmine/block/BrownMushroom.php index 6ba61bd54..12cc206dc 100644 --- a/src/pocketmine/block/BrownMushroom.php +++ b/src/pocketmine/block/BrownMushroom.php @@ -33,9 +33,8 @@ class BrownMushroom extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace with common break method - $this->getLevel()->dropItem($this, Item::get($this->id)); - $this->getLevel()->setBlock($this, new Air(), false, false, true); + if($this->getSide(0)->isTransparent === true){ + $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/Fallable.php b/src/pocketmine/block/Fallable.php index 6bfb8a4eb..fdf5126ff 100644 --- a/src/pocketmine/block/Fallable.php +++ b/src/pocketmine/block/Fallable.php @@ -48,7 +48,7 @@ abstract class Fallable extends Solid{ $fall = new FallingBlock($this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new Compound("", [ "Pos" => new Enum("Pos", [ new Double("", $this->x + 0.5), - new Double("", $this->y + 0.5), + new Double("", $this->y), new Double("", $this->z + 0.5) ]), "Motion" => new Enum("Motion", [ diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index 4dd16ec7f..45f28e72c 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -129,13 +129,7 @@ class Leaves extends Transparent{ if($ev->isCancelled() or $this->findLog($this, $visited, 0, $check) === true){ $this->getLevel()->setBlock($this, $this, false, false); }else{ - $this->getLevel()->setBlock($this, new Air(), false, false); - if(mt_rand(1, 20) === 1){ //Saplings - $this->getLevel()->dropItem($this, Item::get($this->id, $this->meta & 0x03, 1)); - } - if(($this->meta & 0x03) === self::OAK and mt_rand(1, 200) === 1){ //Apples - $this->getLevel()->dropItem($this, Item::get(Item::APPLE, 0, 1)); - } + $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/Leaves2.php b/src/pocketmine/block/Leaves2.php index d7bb2fc39..8c9083dd2 100644 --- a/src/pocketmine/block/Leaves2.php +++ b/src/pocketmine/block/Leaves2.php @@ -121,10 +121,7 @@ class Leaves2 extends Leaves{ if($ev->isCancelled() or $this->findLog($this, $visited, 0, $check) === true){ $this->getLevel()->setBlock($this, $this, false, false); }else{ - $this->getLevel()->setBlock($this, new Air(), false, false, true); - if(mt_rand(1, 20) === 1){ //Saplings - $this->getLevel()->dropItem($this, Item::get($this->id, $this->meta & 0x03, 1)); - } + $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/TNT.php b/src/pocketmine/block/TNT.php index 7850a7475..76a2bd3f2 100644 --- a/src/pocketmine/block/TNT.php +++ b/src/pocketmine/block/TNT.php @@ -47,7 +47,7 @@ class TNT extends Solid{ $tnt = new PrimedTNT($this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new Compound("", [ "Pos" => new Enum("Pos", [ new Double("", $this->x + 0.5), - new Double("", $this->y + 0.5), + new Double("", $this->y), new Double("", $this->z + 0.5) ]), "Motion" => new Enum("Motion", [ diff --git a/src/pocketmine/block/Torch.php b/src/pocketmine/block/Torch.php index bf28eee89..381087bd9 100644 --- a/src/pocketmine/block/Torch.php +++ b/src/pocketmine/block/Torch.php @@ -49,9 +49,8 @@ class Torch extends Flowable{ 0 => 0, ]; - if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === self::FENCE)){ //Replace with common break method - $this->getLevel()->setBlock($this, new Air(), true); - $this->getLevel()->dropItem($this->add(0.5, 0.5, 0.5), Item::get(Item::TORCH)); + if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === self::FENCE)){ + $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/item/SpawnEgg.php b/src/pocketmine/item/SpawnEgg.php index 8ca5454db..65e74157e 100644 --- a/src/pocketmine/item/SpawnEgg.php +++ b/src/pocketmine/item/SpawnEgg.php @@ -51,9 +51,9 @@ class SpawnEgg extends Item{ $nbt = new Compound("", [ "Pos" => new Enum("Pos", [ - new Double("", $block->getX()), + new Double("", $block->getX() + 0.5), new Double("", $block->getY()), - new Double("", $block->getZ()) + new Double("", $block->getZ() + 0.5) ]), "Motion" => new Enum("Motion", [ new Double("", 0), diff --git a/src/pocketmine/level/Explosion.php b/src/pocketmine/level/Explosion.php index 4db4486fc..4be81852b 100644 --- a/src/pocketmine/level/Explosion.php +++ b/src/pocketmine/level/Explosion.php @@ -188,7 +188,7 @@ class Explosion{ $tnt = new PrimedTNT($this->level->getChunk($block->x >> 4, $block->z >> 4), new Compound("", [ "Pos" => new Enum("Pos", [ new Double("", $block->x + 0.5), - new Double("", $block->y + 0.5), + new Double("", $block->y), new Double("", $block->z + 0.5) ]), "Motion" => new Enum("Motion", [