Skip to content

Commit

Permalink
Merge branch 'LNSSPsd:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
chfwd authored Jan 8, 2023
2 parents 2fb34b9 + 09a7ef5 commit 8d6b931
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
7 changes: 0 additions & 7 deletions fastbuilder/bdump/bdump_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ func (bdump *BDumpLegacy) writeHeader(w *bytes.Buffer) error {
return err
}
_, err = w.Write([]byte{0})
if err != nil {
return err
}
// 写入作者之名
// 注:现在不再写入作者信息
_, err = w.Write([]byte{0x1f, 0x75})
return err
// 放置容器需要用到 117 号的 RunTimeId 调色板表
}

func (bdump *BDumpLegacy) writeBlocks(w *bytes.Buffer) error {
Expand Down
6 changes: 5 additions & 1 deletion fastbuilder/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func CheckUpdate(currentVersion string) (bool, string) {
fmt.Printf("Failed to check update due to invalid response received from GitHub.\n")
return false, ""
}
version:=json_structure["tag_name"].(string)
version, found_tag_name_item:=json_structure["tag_name"].(string)
if !found_tag_name_item {
fmt.Printf("Unknown error occured while checking the update\n")
return false, ""
}
return C.compareVersion(C.CString(version[1:]),C.CString(currentVersion))!=0, version[1:]
}
2 changes: 1 addition & 1 deletion minecraft/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (d Dialer) DialContext(ctx context.Context, network string) (conn *Conn, er
request = login.Encode(chainData, conn.clientData, key)
identityData, _, _, err := login.Parse(request)
if err!=nil {
fmt.Printf("WARNING: Identity data parsing error: %w\n", err)
fmt.Printf("WARNING: Identity data parsing error: %w\n", err.(error))
}
// If we got the identity data from Minecraft auth, we need to make sure we set it in the Conn too, as
// we are not aware of the identity data ourselves yet.
Expand Down
3 changes: 2 additions & 1 deletion minecraft/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (p *packetData) decode(conn *Conn) (pk packet.Packet, err error) {
r := protocol.NewReader(p.payload, conn.shieldID.Load())
defer func() {
if recoveredErr := recover(); recoveredErr != nil {
err = fmt.Errorf("%T: %w", pk, recoveredErr.(error))
//
//err = fmt.Errorf("%T: %w", pk, recoveredErr.(error))
}
}()
pk.Unmarshal(r)
Expand Down
5 changes: 5 additions & 0 deletions minecraft/protocol/login/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func (data IdentityData) Validate() error {
if id, err := uuid.Parse(data.Identity); err != nil || id == uuid.Nil {
return fmt.Errorf("UUID must be parseable as a valid UUID, but got %v", data.Identity)
}
// NetEase's rule for DisplayName is different, where unicode characters
// were enabled to use. We are not going to open a server as it's not
// possible for NetEase's Minecraft, so these checks below could be
// ignored.
return nil
if len(data.DisplayName) == 0 || len(data.DisplayName) > 15 {
return fmt.Errorf("DisplayName must not be empty or longer than 15 characters, but got %v characters", len(data.DisplayName))
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.95001
4.9.95002

0 comments on commit 8d6b931

Please sign in to comment.