mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Fix #1615
Players in creative cannot die from non-magic (plugin/console) causes.
This commit is contained in:
parent
3e882ef40d
commit
61043d2e0d
@ -58,6 +58,9 @@ abstract class Living extends Entity implements Damageable{
|
||||
public abstract function getName();
|
||||
|
||||
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
|
||||
if($this instanceof Player and ($this->getGamemode() & 0x01) === 1 and $source != EntityDamageEvent::CAUSE_MAGIC) {
|
||||
return;
|
||||
}
|
||||
//TODO: attack tick limit
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getID();
|
||||
@ -103,4 +106,4 @@ abstract class Living extends Entity implements Damageable{
|
||||
public function getDrops(){
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user