mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Fixed #179
This commit is contained in:
parent
e3a858a089
commit
77fa1608c1
@ -852,24 +852,24 @@ class Player{
|
|||||||
if(($target instanceof Entity) and $target->class === ENTITY_PLAYER and ($this->server->difficulty <= 0 or $target->gamemode === CREATIVE)){
|
if(($target instanceof Entity) and $target->class === ENTITY_PLAYER and ($this->server->difficulty <= 0 or $target->gamemode === CREATIVE)){
|
||||||
break;
|
break;
|
||||||
}elseif($this->handle("player.interact", $data) !== false){
|
}elseif($this->handle("player.interact", $data) !== false){
|
||||||
// Swords do proper damage amiunt (by williamtdr)
|
switch($this->equipment->getID()){
|
||||||
$harmamount = $this->server->difficulty;
|
case WOODEN_SWORD:
|
||||||
if($data["entity"]->hand == 268) { // wooden sword
|
case GOLD_SWORD:
|
||||||
$harmamount = $harmamount + 3;
|
$damage = 4;
|
||||||
|
break;
|
||||||
|
case STONE_SWORD:
|
||||||
|
$damage = 5;
|
||||||
|
break;
|
||||||
|
case IRON_SWORD:
|
||||||
|
$damage = 6;
|
||||||
|
break;
|
||||||
|
case DIAMOND_SWORD:
|
||||||
|
$damage = 7;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$damage = $this->server->difficulty;
|
||||||
}
|
}
|
||||||
if($data["entity"]->hand == 283) { // gold sword
|
$this->server->api->entity->harm($data["target"], $damage, $this->eid);
|
||||||
$harmamount = $harmamount + 3;
|
|
||||||
}
|
|
||||||
if($data["entity"]->hand == 272) { // stone sword
|
|
||||||
$harmamount = $harmamount + 4;
|
|
||||||
}
|
|
||||||
if($data["entity"]->hand == 267) { // iron sword
|
|
||||||
$harmamount = $harmamount + 5;
|
|
||||||
}
|
|
||||||
if($data["entity"]->hand == 276) { // diamond sword
|
|
||||||
$harmamount = $harmamount + 6;
|
|
||||||
}
|
|
||||||
$this->server->api->entity->harm($data["target"], $harmamount, $this->eid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user