This commit is contained in:
williamtdr 2014-07-16 13:07:26 -05:00
parent bd2cb4b851
commit 9c9d786194

View File

@ -1612,6 +1612,14 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$this->craftingType = 0;
$target = $this->getLevel()->getEntity($packet->target);
if(
$target instanceof Player and
$this->server->getConfigBoolean("pvp",true) === false
){
$cancelled = true;
}
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->blocked === false and $this->dead !== true and $target->dead !== true){
$cancelled = false;