mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 15:36:08 +00:00
Fixed old & deprecated plugins not being able to create a config file
This commit is contained in:
@@ -50,12 +50,12 @@ class EntityAPI{
|
||||
$this->harm($eid, -$heal, $cause);
|
||||
}
|
||||
|
||||
public function harm($eid, $attack = 1, $cause){
|
||||
public function harm($eid, $attack = 1, $cause, $force = false){
|
||||
$e = $this->get($eid);
|
||||
if($e === false or $e->dead === true){
|
||||
return false;
|
||||
}
|
||||
$e->setHealth($e->getHealth() - $attack, $cause);
|
||||
$e->setHealth($e->getHealth() - $attack, $cause, $force);
|
||||
}
|
||||
|
||||
public function add($class, $type = 0, $data = array()){
|
||||
|
@@ -127,7 +127,7 @@ class PlayerAPI{
|
||||
case "kill":
|
||||
$player = $this->get(implode(" ", $params));
|
||||
if($player !== false){
|
||||
$this->server->api->entity->harm($player->eid, 20, "console");
|
||||
$this->server->api->entity->harm($player->eid, 20, "console", true);
|
||||
}else{
|
||||
console("[INFO] Usage: /kill <player>");
|
||||
}
|
||||
|
@@ -125,6 +125,7 @@ class PluginAPI extends stdClass{
|
||||
return false;
|
||||
}
|
||||
$path = FILE_PATH."plugins/".$p[1]["name"]."/";
|
||||
@mkdir($path);
|
||||
$this->plugins[$p[1]["class"]][1]["path"] = $path;
|
||||
$cnf = new Config($path."config.yml", CONFIG_YAML, $default);
|
||||
$cnf->save();
|
||||
|
Reference in New Issue
Block a user