Updated 1.21.6

This commit is contained in:
2025-06-16 12:46:46 +08:00
parent 539b4a3a7f
commit f67c9e3052
290 changed files with 22178 additions and 18088 deletions

View File

@ -1,39 +0,0 @@
package screen
import (
"errors"
"github.com/Tnze/go-mc/chat"
"github.com/Tnze/go-mc/data/inventory"
)
type Chest struct {
Type inventory.InventoryID
Title chat.Message
Slots []Slot
Rows int
}
func (c *Chest) onSetSlot(i int, slot Slot) error {
if i < 0 || i >= len(c.Slots) {
return errors.New("slot index out of bounds")
}
c.Slots[i] = slot
return nil
}
func (c *Chest) onClose() error {
return nil
}
func (c *Chest) Container() []Slot {
return c.Slots[0 : c.Rows*9]
}
func (c *Chest) Main() []Slot {
return c.Slots[c.Rows*9 : c.Rows*9+27]
}
func (c *Chest) Hotbar() []Slot {
return c.Slots[c.Rows*9+27 : (c.Rows+4)*9]
}