The same blocks, simply better. For PocketMine & forks.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BlockRegenerateTask.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. # ____ _ _ ____ _ _
  3. # | __ ) ___ | |_ | |_ ___ _ __ | __ ) | | ___ ___ | | __ ___
  4. # | _ \ / _ \ | __| | __| / _ \ | '__| | _ \ | | / _ \ / __| | |/ / / __|
  5. # | |_) | | __/ | |_ | |_ | __/ | | | |_) | | | | (_) | | (__ | < \__ \
  6. # |____/ \___| \__| \__| \___| |_| |____/ |_| \___/ \___| |_|\_\ |___/
  7. #
  8. # Extends your Minecraft PE blocks palette ! For PocketMine.
  9. namespace Ad5001\BetterBlocks\tasks;
  10. use pocketmine\Server;
  11. use pocketmine\scheduler\PluginTask;
  12. use pocketmine\Player;
  13. use pocketmine\level\Level;
  14. use pocketmine\block\Block;
  15. use Ad5001\BetterBlocks\CustomBlockData;
  16. use Ad5001\BetterBlocks\Main;
  17. class BlockRegenerateTask extends PluginTask {
  18. public function __construct(Main $main, Block $block, Level $lvl) {
  19. parent::__construct($main);
  20. $this->main = $main;
  21. $this->server = $main->getServer();
  22. $this->block = $block;
  23. $this->lvl = $lvl;
  24. }
  25. public function onRun($tick) {
  26. $this->lvl->setBlock($this->block, $this->block); // Delays a the block setting.
  27. $this->lvl->setBlock($this->block, $this->block); // Levers are not deleting
  28. $this->main->getLogger()->debug($this->lvl->getBlock($this->block));
  29. }
  30. }