예제 #1
0
 public function __construct($owner, $cfg)
 {
     parent::__construct($owner);
     $this->enableCmd("veinminer", ["description" => mc::_("Enable/Disable VeinMiner"), "usage" => mc::_("/veinminer"), "aliases" => ["vm"], "permission" => "toybox.veinminer"]);
     $this->owner->getServer()->getPluginManager()->registerEvents($this, $this->owner);
     if ($cfg["need-item"]) {
         $this->items = [];
         foreach ($cfg["ItemIDs"] as $i) {
             $item = $this->owner->getItem($i, false, "veinminer");
             if ($item === null) {
                 continue;
             }
             $this->items[$item->getId()] = $item->getId();
         }
         $this->itemwear = $cfg["item-wear"];
     } else {
         $this->items = false;
     }
     $this->creative = $cfg["creative"];
     $this->blocklimit = $cfg["max-blocks"];
     $this->broadcast = $cfg["broadcast-use"];
     $this->sides = [];
     foreach ([Vector3::SIDE_NORTH, Vector3::SIDE_SOUTH, Vector3::SIDE_EAST, Vector3::SIDE_WEST, Vector3::SIDE_UP, Vector3::SIDE_DOWN] as $dir) {
         $this->sides[$dir] = $dir;
     }
     $this->revert[Vector3::SIDE_NORTH] = Vector3::SIDE_SOUTH;
     $this->revert[Vector3::SIDE_SOUTH] = Vector3::SIDE_NORTH;
     $this->revert[Vector3::SIDE_WEST] = Vector3::SIDE_EAST;
     $this->revert[Vector3::SIDE_EAST] = Vector3::SIDE_WEST;
     $this->revert[Vector3::SIDE_UP] = Vector3::SIDE_DOWN;
     $this->revert[Vector3::SIDE_DOWN] = Vector3::SIDE_UP;
 }
예제 #2
0
 public function __construct($owner, $bl)
 {
     parent::__construct($owner);
     $this->enableCmd("magiccarpet", ["description" => mc::_("Fly with a magic carpet"), "usage" => mc::_("/magiccarpet"), "aliases" => ["mc"], "permission" => "toybox.magiccarpet"]);
     $this->owner->getServer()->getPluginManager()->registerEvents($this, $this->owner);
     $this->block = $this->owner->getItem($bl, Item::GLASS, "magic-carpet")->getId();
     //echo __METHOD__.",".__LINE__." $this->block\n";//##DEBUG
 }
예제 #3
0
 public function __construct($owner, $cfg)
 {
     parent::__construct($owner);
     $this->enableCmd("powertool", ["description" => mc::_("Enable/Disable PowerTool"), "usage" => mc::_("/powertool"), "aliases" => ["pt"], "permission" => "toybox.powertool"]);
     $this->owner->getServer()->getPluginManager()->registerEvents($this, $this->owner);
     if ($cfg["need-item"]) {
         $this->items = [];
         foreach ($cfg["ItemIDs"] as $i) {
             $item = $this->owner->getItem($i, false, "powertool");
             if ($item === null) {
                 continue;
             }
             $this->items[$item->getId()] = $item->getId();
         }
         $this->itemwear = $cfg["item-wear"];
     } else {
         $this->items = false;
     }
     $this->creative = $cfg["creative"];
 }