mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 01:29:55 +00:00
Correctly fixed #1659 PvP settings not working
This commit is contained in:
parent
a9cd03da2e
commit
487ce00542
@ -1611,17 +1611,18 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$this->craftingType = 0;
|
$this->craftingType = 0;
|
||||||
|
|
||||||
$target = $this->getLevel()->getEntity($packet->target);
|
$target = $this->getLevel()->getEntity($packet->target);
|
||||||
|
|
||||||
|
$cancelled = false;
|
||||||
|
|
||||||
if(
|
if(
|
||||||
$target instanceof Player and
|
$target instanceof Player and
|
||||||
$this->server->getConfigBoolean("pvp", true) === false
|
$this->server->getConfigBoolean("pvp", true) === false
|
||||||
|
|
||||||
){
|
){
|
||||||
$cancelled = true;
|
$cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->blocked === false and $this->dead !== true and $target->dead !== true){
|
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->blocked === false and $this->dead !== true and $target->dead !== true){
|
||||||
$cancelled = false;
|
|
||||||
$item = $this->inventory->getItemInHand();
|
$item = $this->inventory->getItemInHand();
|
||||||
$damageTable = [
|
$damageTable = [
|
||||||
Item::WOODEN_SWORD => 4,
|
Item::WOODEN_SWORD => 4,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user