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.

SetVacuumTask.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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\nbt\tag\ShortTag;
  14. use Ad5001\BetterBlocks\Main;
  15. use Ad5001\BetterBlocks\CustomBlockData;
  16. class SetVacuumTask extends PluginTask {
  17. protected $block;
  18. protected $main;
  19. protected $server;
  20. public function __construct(Main $main, \pocketmine\block\Block $block) {
  21. parent::__construct($main);
  22. $this->main = $main;
  23. $this->block = $block;
  24. $this->server = $main->getServer();
  25. }
  26. public function onRun($tick) {
  27. $tile = $this->block->getLevel()->getTile($this->block);
  28. if(get_class($tile) == "pocketmine\\tile\\Hopper") { // For software like pocketmine that haven't implemented Hoppers.
  29. $tile->namedtag->isVacuum = new ShortTag("isVacuum", 1);
  30. }
  31. }
  32. }