Add 1.20.70 & 1.20.60 support + Fix crafting issue (#9)

This commit is contained in:
C. Pham
2025-04-05 04:43:37 -04:00
committed by GitHub
parent 6f8d6e922d
commit bcb3e990d3
24 changed files with 12442 additions and 127 deletions

View File

@@ -0,0 +1,34 @@
package legacypacket
import (
"github.com/akmalfairuz/legacy-version/legacyver/proto"
"github.com/go-gl/mathgl/mgl32"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)
// SetActorMotion is sent by the server to change the client-side velocity of an entity. It is usually used
// in combination with server-side movement calculation.
type SetActorMotion 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
// Velocity is the new velocity the entity gets. This velocity will initiate the client-side movement of
// the entity.
Velocity mgl32.Vec3
// Tick is the server tick at which the packet was sent. It is used in relation to CorrectPlayerMovePrediction.
Tick uint64
}
// ID ...
func (*SetActorMotion) ID() uint32 {
return packet.IDSetActorMotion
}
func (pk *SetActorMotion) Marshal(io protocol.IO) {
io.Varuint64(&pk.EntityRuntimeID)
io.Vec3(&pk.Velocity)
if proto.IsProtoGTE(io, proto.ID662) {
io.Varuint64(&pk.Tick)
}
}