1.21.6 Clientbound PlayState Packets

This commit is contained in:
2025-06-20 04:22:08 +08:00
parent e40ed2e534
commit 195d34f32d
204 changed files with 10118 additions and 3287 deletions

View File

@ -1,29 +1,42 @@
package component
import (
"git.konjactw.dev/patyhank/minego/codec/data/slot"
"git.konjactw.dev/patyhank/minego/codec/slot"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Consumable struct {
ConsumeSeconds float32
Animation int32 `mc:"VarInt"` // 0=none, 1=eat, 2=drink, etc.
Sound SoundEvent
ConsumeSeconds float32
Animation int32 `mc:"VarInt"` // 0=none, 1=eat, 2=drink, etc.
SoundID int32 `mc:"VarInt"`
//opt:id:SoundID
SoundEvent *SoundEvent
HasConsumeParticles bool
Effects []ConsumeEffect
}
//codec:gen
type SoundEvent struct {
SoundEventID packet.Identifier
FixedRange packet.Option[packet.Float, *packet.Float]
SoundEventID packet.Identifier
HasFixedRange bool
//opt:optional:HasFixedRange
FixedRange float32
}
//codec:gen
type ConsumeEffect struct {
Type int32 `mc:"VarInt"`
// Data varies by type - would need custom handling
//opt:enum:Type:0
ApplyEffects []PotionEffect
//opt:enum:Type:0
ApplyProbability float32
//opt:enum:Type:1
RemoveEffects packet.IDSet
//opt:enum:Type:3
TeleportRandomlyDiameter float32
//opt:enum:Type:4
PlaySound SoundEvent
}
func (*Consumable) Type() slot.ComponentID {