if negative, returns 0 and if over 8, returns 8
()
| 90 | |
| 91 | // if negative, returns 0 and if over 8, returns 8 |
| 92 | func (p *PlayerEntity) SelectedItemSlot() int32 { |
| 93 | slot := p.selectedItemSlot.Load() |
| 94 | if slot < 0 { |
| 95 | slot = 0 |
| 96 | } |
| 97 | if slot > 8 { |
| 98 | slot = 8 |
| 99 | } |
| 100 | return slot |
| 101 | } |
| 102 | |
| 103 | // if negative, set to 0 and if over 8, set to 8 |
| 104 | func (p *PlayerEntity) SetSelectedItemSlot(slot int32) { |
nothing calls this directly
no outgoing calls
no test coverage detected