Skip to content

Commit

Permalink
session/player.go: Removed redundant type assertion when opening inve…
Browse files Browse the repository at this point in the history
…ntories (#887)

Update player.go
  • Loading branch information
RestartFU authored Aug 15, 2024
1 parent 876728d commit a792bfd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server/session/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,7 @@ func (s *Session) invByID(id int32) (*inventory.Inventory, bool) {
return s.armour.Inventory(), true
case protocol.ContainerLevelEntity:
if s.containerOpened.Load() {
b := s.c.World().Block(s.openedPos.Load())
if _, chest := b.(block.Chest); chest {
return s.openedWindow.Load(), true
} else if _, enderChest := b.(block.EnderChest); enderChest {
return s.openedWindow.Load(), true
}
return s.openedWindow.Load(), true
}
case protocol.ContainerBarrel:
if s.containerOpened.Load() {
Expand Down

0 comments on commit a792bfd

Please sign in to comment.