1.21.60 support
This commit is contained in:
25
legacyver/legacypacket/item_registry.go
Normal file
25
legacyver/legacypacket/item_registry.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package legacypacket
|
||||
|
||||
import (
|
||||
"github.com/akmalfairuz/legacy-version/legacyver/proto"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
||||
)
|
||||
|
||||
// ItemRegistry is sent by the server to send the client a list of available items and attach client-side
|
||||
// components to a custom item. This packet was formerly known as the ItemComponent packet before 1.21.60,
|
||||
// which did not include item definitions but only the components.
|
||||
type ItemRegistry struct {
|
||||
// Items is a list of all items with their legacy IDs which are available in the game. Failing to send any
|
||||
// of the items that are in the game will crash mobile clients. Any custom components are also attached to
|
||||
// the items in this list.
|
||||
Items []proto.ItemEntry
|
||||
}
|
||||
|
||||
// ID ...
|
||||
func (*ItemRegistry) ID() uint32 {
|
||||
return packet.IDItemRegistry
|
||||
}
|
||||
func (pk *ItemRegistry) Marshal(io protocol.IO) {
|
||||
protocol.Slice(io, &pk.Items)
|
||||
}
|
||||
Reference in New Issue
Block a user