mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed old & deprecated plugins not being able to create a config file
This commit is contained in:
parent
00c3201580
commit
afbb5fab04
@ -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();
|
||||
|
@ -38,6 +38,6 @@ ini_set("memory_limit", "256M");
|
||||
define("LOG", true);
|
||||
define("MAGIC", "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78");
|
||||
define("TEST_MD5", "d0ca3786e53b615bb4fb9f5094d5c9a7");
|
||||
define("MAJOR_VERSION", "Alpha_1.0.8");
|
||||
define("MAJOR_VERSION", "Alpha_1.1dev");
|
||||
define("CURRENT_PROTOCOL", 5);
|
||||
define("CURRENT_MINECRAFT_VERSION", "v0.5.0 alpha");
|
Loading…
x
Reference in New Issue
Block a user