mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Added pvp server property
This commit is contained in:
parent
3e3521086b
commit
5f55cdf26a
@ -99,6 +99,7 @@ class ServerAPI{
|
||||
"server-type" => "normal",
|
||||
"time-per-second" => 20,
|
||||
"gamemode" => 1,
|
||||
"pvp" => true,
|
||||
"difficulty" => 1,
|
||||
"generator" => "",
|
||||
"generator-settings" => "",
|
||||
|
@ -852,7 +852,9 @@ class Player{
|
||||
$target = $this->server->api->entity->get($data["target"]);
|
||||
$data["targetentity"] = $target;
|
||||
$data["entity"] = $this->entity;
|
||||
if(($target instanceof Entity) and $target->class === ENTITY_PLAYER and ($this->server->difficulty <= 0 or $target->gamemode === CREATIVE)){
|
||||
if(!($target instanceof Entity)){
|
||||
break;
|
||||
}elseif($target->class === ENTITY_PLAYER and ($this->server->getProperty("pvp") == false or $this->server->difficulty <= 0 or $target->player->gamemode === CREATIVE)){
|
||||
break;
|
||||
}elseif($this->handle("player.interact", $data) !== false){
|
||||
switch($this->equipment->getID()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user