Documentation
¶
Index ¶
- Constants
- func FeatureByID(id string) (int32, bool)
- func HasFeature(protocol, feature int32) bool
- func HasFeatureByID(protocol int32, id string) bool
- func HasMace(protocol int32) bool
- func HasSpear(protocol int32) bool
- func Register(protocol int32, version string)
- func RegisterFeature(id string, protocol int32)
- func Versions() iter.Seq[Version]
- type Version
Constants ¶
const ( Protocol1_20_0 = 589 Protocol1_20_10 = 594 Protocol1_20_30 = 618 Protocol1_20_40 = 622 Protocol1_20_50 = 630 Protocol1_20_60 = 649 Protocol1_20_70 = 662 Protocol1_20_80 = 671 Protocol1_21_0 = 685 Protocol1_21_2 = 686 Protocol1_21_20 = 712 Protocol1_21_30 = 729 Protocol1_21_40 = 748 Protocol1_21_50 = 766 Protocol1_21_60 = 776 Protocol1_21_70 = 786 Protocol1_21_80 = 800 Protocol1_21_90 = 818 Protocol1_21_93 = 819 Protocol1_21_100 = 827 Protocol1_21_111 = 844 Protocol1_21_120 = 859 Protocol1_21_124 = 860 Protocol1_21_130 = 898 )
const ( // MaceImplemented is the protocol version where the Mace item was introduced (1.21.0). MaceImplemented = Protocol1_21_0 // SpearImplemented is the protocol version where the Spear item was introduced (1.21.130). SpearImplemented = Protocol1_21_130 )
Variables ¶
This section is empty.
Functions ¶
func FeatureByID ¶ added in v1.0.4
FeatureByID returns the protocol version where a feature was implemented.
func HasFeature ¶ added in v1.0.4
HasFeature returns true if the given protocol version supports the specified feature.
func HasFeatureByID ¶ added in v1.0.4
HasFeatureByID returns true if the given protocol version supports the feature with the specified ID.
func HasMace ¶ added in v1.0.4
HasMace returns true if the given protocol version supports the Mace item.
func HasSpear ¶ added in v1.0.4
HasSpear returns true if the given protocol version supports the Spear item.
func Register ¶
Register adds a new version to the version registry, making it available for lookup by both protocol number and version string. Not thread safe, should run during initialisation.
func RegisterFeature ¶ added in v1.0.4
RegisterFeature adds a feature to the registry with a string ID. Not thread safe, should run during initialisation.
Types ¶
type Version ¶
type Version struct {
// Protocol is the numeric protocol identifier used in Minecraft network communication.
// This is the official protocol number that clients and servers use.
// Example: 589 for Minecraft 1.20.0
Protocol int32
// Version is the human-readable Minecraft version string in semantic version format.
// This follows the standard Minecraft version numbering scheme (major.minor.patch).
// Example: "1.20.0", "1.21.100"
Version string
}
Version represents a Minecraft version with its protocol number and version string.
func ByProtocol ¶
ByProtocol returns the Version object for a given protocol number. This is useful for looking up version strings when you have a protocol number.