look at the code if you want to know what i did
This commit is contained in:
@@ -12,7 +12,7 @@ package data
|
||||
type VersionInfo struct {
|
||||
MinecraftVersion string
|
||||
Version int32
|
||||
DataVersion int
|
||||
DataVersion int32
|
||||
UsesNetty bool
|
||||
MajorVersion string
|
||||
ReleaseType string
|
||||
@@ -42,6 +42,16 @@ func LookUpVersionByProtocolVersion(version int32) (ret VersionInfo, err error)
|
||||
return
|
||||
}
|
||||
|
||||
func LookUpVersionByDataVersion(version int32) (ret VersionInfo, err error) {
|
||||
for _, v := range ProtocolVersions {
|
||||
if v.DataVersion == version {
|
||||
ret = v
|
||||
}
|
||||
}
|
||||
err = UnknownMinecraftVersionError
|
||||
return
|
||||
}
|
||||
|
||||
func init() {
|
||||
must(LoadJson("minecraft-data/data/pc/common/protocolVersions.json", &ProtocolVersions))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user