-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f2f7c7
commit eed76a6
Showing
16 changed files
with
124 additions
and
27 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
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
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,36 @@ | ||
package packet | ||
|
||
import ( | ||
"github.com/sandertv/gophertunnel/minecraft/protocol" | ||
) | ||
|
||
const ( | ||
MovementEffectTypeGlideBoost = iota | ||
) | ||
|
||
// MovementEffect is sent by the server to the client to update specific movement effects to allow the client | ||
// to predict its movement. For example, fireworks used during gliding will send this packet to tell the | ||
// client the exact duration of the boost. | ||
type MovementEffect struct { | ||
// EntityRuntimeID is the runtime ID of the entity. The runtime ID is unique for each world session, and | ||
// entities are generally identified in packets using this runtime ID. | ||
EntityRuntimeID uint64 | ||
// Type is the type of movement effect being updated. It is one of the constants found above. | ||
Type int32 | ||
// Duration is the duration of the effect, measured in ticks. | ||
Duration int32 | ||
// Tick is the server tick at which the packet was sent. It is used in relation to CorrectPlayerMovePrediction. | ||
Tick uint64 | ||
} | ||
|
||
// ID ... | ||
func (*MovementEffect) ID() uint32 { | ||
return IDMovementEffect | ||
} | ||
|
||
func (pk *MovementEffect) Marshal(io protocol.IO) { | ||
io.Varuint64(&pk.EntityRuntimeID) | ||
io.Varint32(&pk.Type) | ||
io.Varint32(&pk.Duration) | ||
io.Varuint64(&pk.Tick) | ||
} |
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,24 @@ | ||
package packet | ||
|
||
import ( | ||
"github.com/sandertv/gophertunnel/minecraft/protocol" | ||
) | ||
|
||
// SetMovementAuthority is sent by the server to the client to change its movement mode. | ||
type SetMovementAuthority struct { | ||
// MovementType specifies the way the server handles player movement. Available options are | ||
// protocol.PlayerMovementModeClient, protocol.PlayerMovementModeServer and | ||
// protocol.PlayerMovementModeServerWithRewind, where the server authoritative types result | ||
// in the client sending PlayerAuthInput packets instead of MovePlayer packets and the rewind mode | ||
// requires sending the tick of movement and several actions. | ||
MovementType byte | ||
} | ||
|
||
// ID ... | ||
func (*SetMovementAuthority) ID() uint32 { | ||
return IDSetMovementAuthority | ||
} | ||
|
||
func (pk *SetMovementAuthority) Marshal(io protocol.IO) { | ||
io.Uint8(&pk.MovementType) | ||
} |
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