mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
/id command
This commit is contained in:
parent
157f794c7f
commit
1611236ae4
2 changed files with 17 additions and 7 deletions
|
|
@ -222,11 +222,21 @@ class BlockAPI{
|
|||
$this->server->schedule(1, [$this, "blockUpdateTick"], [], true);
|
||||
$this->server->api->console->register("setblock", "<x> <y> <z> <block[:damage]>", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("give", "<player> <item[:damage]> [amount]", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("id", "Check id of item", [$this, "commandHandler"]);
|
||||
$this->server->api->console->cmdWhitelist("id");
|
||||
}
|
||||
|
||||
public function commandHandler($cmd, $args, $issuer, $alias){
|
||||
$output = "";
|
||||
switch($cmd){
|
||||
case "id":
|
||||
if(!($issuer instanceof Player)){
|
||||
$output .= "Run this command in-game!";
|
||||
break;
|
||||
}
|
||||
$itemheld = $issuer->getSlot($issuer->slot);
|
||||
$output = self::getItem($itemheld->getID(), $itemheld->getMetadata())."";
|
||||
break;
|
||||
case "setblock":
|
||||
if(!($issuer instanceof Player)){
|
||||
if(count($args) < 5){
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ class LevelImport{
|
|||
}
|
||||
$chunks->map = null;
|
||||
$chunks = null;
|
||||
if(file_exists$this->path . "level.dat") @unlink($this->path . "level.dat");
|
||||
if(file_exists$this->path . "level.dat_old") @unlink($this->path . "level.dat_old");
|
||||
if(file_exists$this->path . "player.dat") @unlink($this->path . "player.dat");
|
||||
if(file_exists$this->path . "entities.dat") @unlink($this->path . "entities.dat");
|
||||
if(file_exists$this->path . "chunks.dat") @unlink($this->path . "chunks.dat");
|
||||
if(file_exists$this->path . "chunks.dat.gz") @unlink($this->path . "chunks.dat.gz");
|
||||
if(file_exists$this->path . "tiles.dat") @unlink($this->path . "tiles.dat");
|
||||
if(file_exists($this->path . "level.dat")) @unlink($this->path . "level.dat");
|
||||
if(file_exists($this->path . "level.dat_old")) @unlink($this->path . "level.dat_old");
|
||||
if(file_exists($this->path . "player.dat")) @unlink($this->path . "player.dat");
|
||||
if(file_exists($this->path . "entities.dat")) @unlink($this->path . "entities.dat");
|
||||
if(file_exists($this->path . "chunks.dat")) @unlink($this->path . "chunks.dat");
|
||||
if(file_exists($this->path . "chunks.dat.gz")) @unlink($this->path . "chunks.dat.gz");
|
||||
if(file_exists($this->path . "tiles.dat")) @unlink($this->path . "tiles.dat");
|
||||
unset($chunks, $level, $entities, $tiles, $nbt);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue