Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xNatsuri committed Mar 23, 2024
1 parent 2a94033 commit 913778d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/item/totem.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ func (Totem) MaxCount() int {
return 1
}

// EncodeItem ...
func (Totem) EncodeItem() (name string, meta int16) {
return "minecraft:totem_of_undying", 0
}
3 changes: 1 addition & 2 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,6 @@ func (p *Player) Hurt(dmg float64, src world.DamageSource) (float64, bool) {
}
}

w, pos := p.World(), p.Position()

if p.Health()-damageLeft < 0 {
hand, offHand := p.HeldItems()
if _, ok := hand.Item().(item.Totem); ok {
Expand Down Expand Up @@ -622,6 +620,7 @@ func (p *Player) Hurt(dmg float64, src world.DamageSource) (float64, bool) {
}
}

w, pos := p.World(), p.Position()
for _, viewer := range p.viewers() {
viewer.ViewEntityAction(p, entity.HurtAction{})
}
Expand Down

0 comments on commit 913778d

Please sign in to comment.