mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Merge branch 'master' of github.com:PocketMine/PocketMine-MP
This commit is contained in:
commit
94bc817756
@ -53,7 +53,7 @@ class KickCommand extends VanillaCommand{
|
|||||||
|
|
||||||
if(($player = $sender->getServer()->getPlayer($name)) instanceof Player){
|
if(($player = $sender->getServer()->getPlayer($name)) instanceof Player){
|
||||||
$player->kick($reason);
|
$player->kick($reason);
|
||||||
Command::broadcastCommandMessage($sender, "Kicked player " . $player->getName() . ". With reason: " . $reason);
|
Command::broadcastCommandMessage($sender, "Kicked " . $player->getName() . " from the game: '{$reason}'");
|
||||||
}else{
|
}else{
|
||||||
$sender->sendMessage($name . " not found.");
|
$sender->sendMessage($name . " not found.");
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,23 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
public abstract function getName();
|
public abstract function getName();
|
||||||
|
|
||||||
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
|
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
|
||||||
|
|
||||||
|
if($this instanceof Player and ($this->getGamemode() & 0x01) === 1){
|
||||||
|
if($source instanceof EntityDamageEvent){
|
||||||
|
$cause = $source->getCause();
|
||||||
|
}else{
|
||||||
|
$cause = $source;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(
|
||||||
|
$cause !== EntityDamageEvent::CAUSE_MAGIC
|
||||||
|
and $cause !== EntityDamageEvent::CAUSE_SUICIDE
|
||||||
|
and $cause !== EntityDamageEvent::CAUSE_VOID
|
||||||
|
){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: attack tick limit
|
//TODO: attack tick limit
|
||||||
$pk = new EntityEventPacket();
|
$pk = new EntityEventPacket();
|
||||||
$pk->eid = $this->getID();
|
$pk->eid = $this->getID();
|
||||||
@ -103,4 +120,4 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
public function getDrops(){
|
public function getDrops(){
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user