Skip to content

Instantly share code, notes, and snippets.

@Omattyao
Last active January 1, 2016 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Omattyao/8208967 to your computer and use it in GitHub Desktop.
Save Omattyao/8208967 to your computer and use it in GitHub Desktop.
<?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