mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fixed items getting damaged when hitting players in gm 1
This commit is contained in:
parent
e30586fff2
commit
b63741dc22
3 changed files with 6 additions and 5 deletions
|
|
@ -945,10 +945,10 @@ class Entity extends Position
|
|||
|
||||
if($action === InteractPacket::ACTION_ATTACK && $e->isPlayer()){
|
||||
$slot = $e->player->getHeldItem();
|
||||
$damage = $slot->getDamageAgainstOf($e);
|
||||
$damage = $slot->getDamageAgainstOf($this);
|
||||
$this->harm($damage, $e->eid);
|
||||
if($slot->isTool() === true and ($e->player->gamemode & 0x01) === 0){
|
||||
if($slot->useOn($e) and $slot->getMetadata() >= $slot->getMaxDurability()){
|
||||
if($slot->isTool() and ($this->player->gamemode & 0x01) === 0){
|
||||
if($slot->useOn($this) and $slot->getMetadata() >= $slot->getMaxDurability()){
|
||||
$e->player->removeItem($slot->getID(), $slot->getMetadata(), 1, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue