Last active
January 1, 2016 22:19
-
-
Save Omattyao/8208967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
修正したソースコード | |
*/ | |
class takumi implements Plugin{ | |
private $api; | |
public function __construct(ServerAPI $api, $server = false){ | |
$this->api = $api; | |
} | |
public function init(){ | |
$this->api->console->register("baku", "爆発します", array($this, "time")); | |
} | |
public function time($cmd, $params, $issuer, $alias) { | |
if ($issuer instanceof Player) { | |
$issuer->sendChat("5秒後に爆発します"); | |
$t = 5; | |
$this->api->shcedule($t * 20, array($this, "creeper"), array($issuer)); | |
} | |
} | |
public function creeper($issuer){ | |
$x = $issuer->entity->x; | |
$y = $issuer->entity->y; | |
$z = $issuer->entity->z; | |
$level = $issuer->level; | |
$explosion = new Explosion(new Position($x, $y, $z, $level), 3); | |
$explosion->explode(); | |
} | |
public function __destruct(){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment