Improved chunk ticking, enabled again. Disable it setting chunk-ticking.per-tick to 0

This commit is contained in:
Shoghi Cervantes
2014-08-26 11:52:45 +02:00
parent d169734781
commit f74af12914
3 changed files with 57 additions and 27 deletions

View File

@ -24,6 +24,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\generator\object\TallGrass;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\math\Vector3;
use pocketmine\Player;
use pocketmine\utils\Random;
@ -54,7 +55,7 @@ class Grass extends Solid{
$z = mt_rand($this->z - 1, $this->z + 1);
$block = $this->getLevel()->getBlockIdAt($x, $y, $z);
if($block === Block::DIRT){
$block = $this->getLevel()->getBlock(new Vector3($x, $y, $z));
$block = Block::get($block, $this->getLevel()->getBlockDataAt($x, $y, $z), new Position($x, $y, $z, $this->getLevel()));
if($block->getSide(1) instanceof Transparent){
$this->getLevel()->setBlock($block, new Grass());
}