Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gophertunnel: Initial support for v1.19.50.
- Loading branch information
1 parent
748203e
commit e0d052f
Showing
8 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ const ( | |
// Decode decodes one 'packet' from the io.Reader passed in NewDecoder(), producing a slice of packets that it | ||
// held and an error if not successful. | ||
func (decoder *Decoder) Decode() (packets [][]byte, err error) { | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JustTalDevelops
Author
Collaborator
|
||
var data []byte | ||
if decoder.pr == nil { | ||
var n int | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,4 +196,5 @@ const ( | |
IDRequestNetworkSettings | ||
IDGameTestRequest | ||
IDGameTestResults | ||
IDUpdateClientInputLocks | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package packet | ||
|
||
import ( | ||
"github.com/go-gl/mathgl/mgl32" | ||
"github.com/sandertv/gophertunnel/minecraft/protocol" | ||
) | ||
|
||
const ( | ||
ClientInputLockMove = 1 << (iota + 1) | ||
ClientInputLockJump | ||
ClientInputLockSneak | ||
ClientInputLockMount | ||
ClientInputLockDismount | ||
ClientInputLockRotation | ||
) | ||
|
||
// UpdateClientInputLocks is sent by the server to the client to lock certain inputs the client usually has, such as | ||
// movement, jumping, sneaking, and more. | ||
type UpdateClientInputLocks struct { | ||
// Locks is an encoded bitset of all locks that are currently active. The locks are defined in the constants above. | ||
Locks uint32 | ||
// Position is the server's position of the client at the time the packet was sent. It is unclear what the exact | ||
// purpose of this field is. | ||
Position mgl32.Vec3 | ||
} | ||
|
||
// ID ... | ||
func (u UpdateClientInputLocks) ID() uint32 { | ||
return IDUpdateClientInputLocks | ||
} | ||
|
||
// Marshal ... | ||
func (u UpdateClientInputLocks) Marshal(w *protocol.Writer) { | ||
w.Varuint32(&u.Locks) | ||
w.Vec3(&u.Position) | ||
} | ||
|
||
// Unmarshal ... | ||
func (u UpdateClientInputLocks) Unmarshal(r *protocol.Reader) { | ||
r.Varuint32(&u.Locks) | ||
r.Vec3(&u.Position) | ||
} |
This implementation is very good but should this be discarded?