refactor package

This commit is contained in:
2025-08-22 05:14:59 +08:00
parent bec0a56a3d
commit 65690e51ab
371 changed files with 835 additions and 627 deletions

View File

@ -0,0 +1,27 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type AttributeModifiers struct {
Modifiers []AttributeModifier
}
//codec:gen
type AttributeModifier struct {
AttributeID int32 `mc:"VarInt"`
ModifierID string `mc:"Identifier"`
Value float64
Operation int32 `mc:"VarInt"` // 0=Add, 1=Multiply base, 2=Multiply total
Slot int32 `mc:"VarInt"` // 0=Any, 1=Main hand, 2=Off hand, etc.
}
func (*AttributeModifiers) Type() slot.ComponentID {
return 13
}
func (*AttributeModifiers) ID() string {
return "minecraft:attribute_modifiers"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type AxolotlVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*AxolotlVariant) Type() slot.ComponentID {
return 91
}
func (*AxolotlVariant) ID() string {
return "minecraft:axolotl/variant"
}

View File

@ -0,0 +1,34 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type BannerPatterns struct {
Layers []BannerLayer
}
//codec:gen
type BannerLayer struct {
Pattern int32 `mc:"VarInt"`
//opt:enum:Pattern:0
AssetID pk.Identifier
//opt:enum:Pattern:0
TranslationKey string
Color DyeColor
}
//codec:gen
type DyeColor struct {
ColorID int32 `mc:"VarInt"`
}
func (*BannerPatterns) Type() slot.ComponentID {
return 63
}
func (*BannerPatterns) ID() string {
return "minecraft:banner_patterns"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type BaseColor struct {
Color DyeColor
}
func (*BaseColor) Type() slot.ComponentID {
return 64
}
func (*BaseColor) ID() string {
return "minecraft:base_color"
}

View File

@ -0,0 +1,26 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type Bees struct {
Bees []Bee
}
//codec:gen
type Bee struct {
EntityData nbt.RawMessage `mc:"NBT"`
TicksInHive int32 `mc:"VarInt"`
MinTicksInHive int32 `mc:"VarInt"`
}
func (*Bees) Type() slot.ComponentID {
return 68
}
func (*Bees) ID() string {
return "minecraft:bees"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type BlockEntityData struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*BlockEntityData) Type() slot.ComponentID {
return 51
}
func (*BlockEntityData) ID() string {
return "minecraft:block_entity_data"
}

View File

@ -0,0 +1,24 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type BlockState struct {
Properties []BlockStateProperty
}
//codec:gen
type BlockStateProperty struct {
Name string
Value string
}
func (*BlockState) Type() slot.ComponentID {
return 67
}
func (*BlockState) ID() string {
return "minecraft:block_state"
}

View File

@ -0,0 +1,48 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type BlocksAttacks struct {
BlockDelaySeconds float32
DisableCooldownScale float32
DamageReductions []DamageReduction
ItemDamageThreshold float32
ItemDamageBase float32
ItemDamageFactor float32
BypassedBy pk.Option[pk.Identifier, *pk.Identifier]
HasBlockSound bool
//opt:optional:HasBlockSound
BlockSoundID int32 `mc:"VarInt"`
//opt:optional:HasBlockSound
//opt:id:BlockSoundID
BlockSound SoundEvent
HasDisableSound bool
//opt:optional:HasDisableSound
DisableSoundID int32 `mc:"VarInt"`
//opt:optional:HasDisableSound
//opt:id:DisableSoundID
DisableSound SoundEvent
}
//codec:gen
type DamageReduction struct {
HorizontalBlockingAngle float32
HasType bool
//opt:optional:HasType
Type pk.IDSet
Base float32
Factor float32
}
func (*BlocksAttacks) Type() slot.ComponentID {
return 33
}
func (*BlocksAttacks) ID() string {
return "minecraft:blocks_attacks"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type BreakSound struct {
SoundData packet.OptID[SoundEvent, *SoundEvent]
}
func (*BreakSound) Type() slot.ComponentID {
return 71
}
func (*BreakSound) ID() string {
return "minecraft:break_sound"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type BucketEntityData struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*BucketEntityData) Type() slot.ComponentID {
return 50
}
func (*BucketEntityData) ID() string {
return "minecraft:bucket_entity_data"
}

View File

@ -0,0 +1,18 @@
package component
import (
slot2 "git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type BundleContents struct {
Items []slot2.Slot
}
func (*BundleContents) Type() slot2.ComponentID {
return 41
}
func (*BundleContents) ID() string {
return "minecraft:bundle_contents"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CanBreak struct {
BlockPredicates []BlockPredicate
}
func (*CanBreak) Type() slot.ComponentID {
return 12
}
func (*CanBreak) ID() string {
return "minecraft:can_break"
}

View File

@ -0,0 +1,62 @@
package component
import (
"io"
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type CanPlaceOn struct {
BlockPredicates []BlockPredicate
}
//codec:gen
type BlockPredicate struct {
Blocks pk.Option[pk.IDSet, *pk.IDSet]
Properties pk.Option[Properties, *Properties]
NBT pk.Option[pk.NBTField, *pk.NBTField]
DataComponents []ExactDataComponentMatcher
PartialDataComponentPredicates []PartialDataComponentMatcher
}
type Properties []Property
func (p Properties) WriteTo(w io.Writer) (n int64, err error) {
return pk.Array(p).WriteTo(w)
}
func (p *Properties) ReadFrom(r io.Reader) (n int64, err error) {
return pk.Array(p).ReadFrom(r)
}
//codec:gen
type Property struct {
Name string
IsExactMatch bool
ExactValue pk.Option[pk.String, *pk.String]
MinValue pk.Option[pk.String, *pk.String]
MaxValue pk.Option[pk.String, *pk.String]
}
//codec:gen
type ExactDataComponentMatcher struct {
Type int32 `mc:"VarInt"`
Value nbt.RawMessage `mc:"NBT"`
}
//codec:gen
type PartialDataComponentMatcher struct {
Type int32 `mc:"VarInt"`
Predicate nbt.RawMessage `mc:"NBT"`
}
func (*CanPlaceOn) Type() slot.ComponentID {
return 11
}
func (*CanPlaceOn) ID() string {
return "minecraft:can_place_on"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CatCollar struct {
Color DyeColor
}
func (*CatCollar) Type() slot.ComponentID {
return 93
}
func (*CatCollar) ID() string {
return "minecraft:cat/collar"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CatVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*CatVariant) Type() slot.ComponentID {
return 92
}
func (*CatVariant) ID() string {
return "minecraft:cat/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
slot2 "git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type ChargedProjectiles struct {
Projectiles []slot2.Slot
}
func (*ChargedProjectiles) Type() slot2.ComponentID {
return 40
}
func (*ChargedProjectiles) ID() string {
return "minecraft:charged_projectiles"
}

View File

@ -0,0 +1,58 @@
package component
import (
"io"
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
type ChickenVariant struct {
Mode int8
VariantName packet.Identifier
VariantID int32
}
func (c *ChickenVariant) ReadFrom(r io.Reader) (n int64, err error) {
n1, err := (*packet.Byte)(&c.Mode).ReadFrom(r)
if err != nil {
return n1, err
}
if c.Mode == 0 {
n2, err := c.VariantName.ReadFrom(r)
return n1 + n2, err
}
if c.Mode == 1 {
n2, err := (*packet.VarInt)(&c.VariantID).ReadFrom(r)
return n1 + n2, err
}
return n1, err
}
func (c ChickenVariant) WriteTo(w io.Writer) (int64, error) {
n1, err := (*packet.Byte)(&c.Mode).WriteTo(w)
if err != nil {
return n1, err
}
if c.Mode == 0 {
n2, err := c.VariantName.WriteTo(w)
return n1 + n2, err
}
if c.Mode == 1 {
n2, err := (*packet.VarInt)(&c.VariantID).WriteTo(w)
return n1 + n2, err
}
return n1, err
}
func (*ChickenVariant) Type() slot.ComponentID {
return 86
}
func (*ChickenVariant) ID() string {
return "minecraft:chicken/variant"
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,296 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
func init() {
slot.RegisterComponent(func() slot.Component {
return &CustomData{}
})
slot.RegisterComponent(func() slot.Component {
return &MaxStackSize{}
})
slot.RegisterComponent(func() slot.Component {
return &MaxDamage{}
})
slot.RegisterComponent(func() slot.Component {
return &Damage{}
})
slot.RegisterComponent(func() slot.Component {
return &Unbreakable{}
})
slot.RegisterComponent(func() slot.Component {
return &CustomName{}
})
slot.RegisterComponent(func() slot.Component {
return &ItemName{}
})
slot.RegisterComponent(func() slot.Component {
return &ItemModel{}
})
slot.RegisterComponent(func() slot.Component {
return &Lore{}
})
slot.RegisterComponent(func() slot.Component {
return &Rarity{}
})
slot.RegisterComponent(func() slot.Component {
return &Enchantments{}
})
slot.RegisterComponent(func() slot.Component {
return &CanPlaceOn{}
})
slot.RegisterComponent(func() slot.Component {
return &CanBreak{}
})
slot.RegisterComponent(func() slot.Component {
return &AttributeModifiers{}
})
slot.RegisterComponent(func() slot.Component {
return &CustomModelData{}
})
slot.RegisterComponent(func() slot.Component {
return &TooltipDisplay{}
})
slot.RegisterComponent(func() slot.Component {
return &RepairCost{}
})
slot.RegisterComponent(func() slot.Component {
return &CreativeSlotLock{}
})
slot.RegisterComponent(func() slot.Component {
return &EnchantmentGlintOverride{}
})
slot.RegisterComponent(func() slot.Component {
return &IntangibleProjectile{}
})
slot.RegisterComponent(func() slot.Component {
return &Food{}
})
slot.RegisterComponent(func() slot.Component {
return &Consumable{}
})
slot.RegisterComponent(func() slot.Component {
return &UseRemainder{}
})
slot.RegisterComponent(func() slot.Component {
return &UseCooldown{}
})
slot.RegisterComponent(func() slot.Component {
return &DamageResistant{}
})
slot.RegisterComponent(func() slot.Component {
return &Tool{}
})
slot.RegisterComponent(func() slot.Component {
return &Weapon{}
})
slot.RegisterComponent(func() slot.Component {
return &Enchantable{}
})
slot.RegisterComponent(func() slot.Component {
return &Equippable{}
})
slot.RegisterComponent(func() slot.Component {
return &Repairable{}
})
slot.RegisterComponent(func() slot.Component {
return &Glider{}
})
slot.RegisterComponent(func() slot.Component {
return &TooltipStyle{}
})
slot.RegisterComponent(func() slot.Component {
return &DeathProtection{}
})
slot.RegisterComponent(func() slot.Component {
return &BlocksAttacks{}
})
slot.RegisterComponent(func() slot.Component {
return &StoredEnchantments{}
})
slot.RegisterComponent(func() slot.Component {
return &DyedColor{}
})
slot.RegisterComponent(func() slot.Component {
return &MapColor{}
})
slot.RegisterComponent(func() slot.Component {
return &MapID{}
})
slot.RegisterComponent(func() slot.Component {
return &MapDecorations{}
})
slot.RegisterComponent(func() slot.Component {
return &MapPostProcessing{}
})
slot.RegisterComponent(func() slot.Component {
return &ChargedProjectiles{}
})
slot.RegisterComponent(func() slot.Component {
return &BundleContents{}
})
slot.RegisterComponent(func() slot.Component {
return &PotionContents{}
})
slot.RegisterComponent(func() slot.Component {
return &PotionDurationScale{}
})
slot.RegisterComponent(func() slot.Component {
return &SuspiciousStewEffects{}
})
slot.RegisterComponent(func() slot.Component {
return &WritableBookContent{}
})
slot.RegisterComponent(func() slot.Component {
return &WrittenBookContent{}
})
slot.RegisterComponent(func() slot.Component {
return &Trim{}
})
slot.RegisterComponent(func() slot.Component {
return &DebugStickState{}
})
slot.RegisterComponent(func() slot.Component {
return &EntityData{}
})
slot.RegisterComponent(func() slot.Component {
return &BucketEntityData{}
})
slot.RegisterComponent(func() slot.Component {
return &BlockEntityData{}
})
slot.RegisterComponent(func() slot.Component {
return &Instrument{}
})
slot.RegisterComponent(func() slot.Component {
return &ProvidesTrimMaterial{}
})
slot.RegisterComponent(func() slot.Component {
return &OminousBottleAmplifier{}
})
slot.RegisterComponent(func() slot.Component {
return &JukeboxPlayable{}
})
slot.RegisterComponent(func() slot.Component {
return &ProvidesBannerPatterns{}
})
slot.RegisterComponent(func() slot.Component {
return &Recipes{}
})
slot.RegisterComponent(func() slot.Component {
return &LodestoneTracker{}
})
slot.RegisterComponent(func() slot.Component {
return &FireworkExplosion{}
})
slot.RegisterComponent(func() slot.Component {
return &Fireworks{}
})
slot.RegisterComponent(func() slot.Component {
return &Profile{}
})
slot.RegisterComponent(func() slot.Component {
return &NoteBlockSound{}
})
slot.RegisterComponent(func() slot.Component {
return &BannerPatterns{}
})
slot.RegisterComponent(func() slot.Component {
return &BaseColor{}
})
slot.RegisterComponent(func() slot.Component {
return &PotDecorations{}
})
slot.RegisterComponent(func() slot.Component {
return &Container{}
})
slot.RegisterComponent(func() slot.Component {
return &BlockState{}
})
slot.RegisterComponent(func() slot.Component {
return &Bees{}
})
slot.RegisterComponent(func() slot.Component {
return &Lock{}
})
slot.RegisterComponent(func() slot.Component {
return &ContainerLoot{}
})
slot.RegisterComponent(func() slot.Component {
return &BreakSound{}
})
slot.RegisterComponent(func() slot.Component {
return &VillagerVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &WolfVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &WolfSoundVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &WolfCollar{}
})
slot.RegisterComponent(func() slot.Component {
return &FoxVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &SalmonSize{}
})
slot.RegisterComponent(func() slot.Component {
return &ParrotVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &TropicalFishPattern{}
})
slot.RegisterComponent(func() slot.Component {
return &TropicalFishBaseColor{}
})
slot.RegisterComponent(func() slot.Component {
return &TropicalFishPatternColor{}
})
slot.RegisterComponent(func() slot.Component {
return &MooshroomVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &RabbitVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &PigVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &CowVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &ChickenVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &FrogVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &HorseVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &PaintingVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &LlamaVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &AxolotlVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &CatVariant{}
})
slot.RegisterComponent(func() slot.Component {
return &CatCollar{}
})
slot.RegisterComponent(func() slot.Component {
return &SheepColor{}
})
slot.RegisterComponent(func() slot.Component {
return &ShulkerColor{}
})
}

View File

@ -0,0 +1,48 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/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.
SoundID int32 `mc:"VarInt"`
//opt:id:SoundID
SoundEvent *SoundEvent
HasConsumeParticles bool
Effects []ConsumeEffect
}
//codec:gen
type SoundEvent struct {
SoundEventID packet.Identifier
HasFixedRange bool
//opt:optional:HasFixedRange
FixedRange float32
}
//codec:gen
type ConsumeEffect struct {
Type int32 `mc:"VarInt"`
//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 {
return 21
}
func (*Consumable) ID() string {
return "minecraft:consumable"
}

View File

@ -0,0 +1,18 @@
package component
import (
slot2 "git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Container struct {
Items []slot2.Slot
}
func (*Container) Type() slot2.ComponentID {
return 66
}
func (*Container) ID() string {
return "minecraft:container"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type ContainerLoot struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*ContainerLoot) Type() slot.ComponentID {
return 70
}
func (*ContainerLoot) ID() string {
return "minecraft:container_loot"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CowVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*CowVariant) Type() slot.ComponentID {
return 85
}
func (*CowVariant) ID() string {
return "minecraft:cow/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CreativeSlotLock struct {
// no fields
}
func (*CreativeSlotLock) Type() slot.ComponentID {
return 17
}
func (*CreativeSlotLock) ID() string {
return "minecraft:creative_slot_lock"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type CustomData struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*CustomData) Type() slot.ComponentID {
return 0
}
func (*CustomData) ID() string {
return "minecraft:custom_data"
}

View File

@ -0,0 +1,21 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type CustomModelData struct {
Floats []float32
Flags []bool
Strings []string
Colors []int32 `mc:"VarInt"`
}
func (*CustomModelData) Type() slot.ComponentID {
return 14
}
func (*CustomModelData) ID() string {
return "minecraft:custom_model_data"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
)
//codec:gen
type CustomName struct {
Name chat.Message
}
func (*CustomName) Type() slot.ComponentID {
return 5
}
func (*CustomName) ID() string {
return "minecraft:custom_name"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Damage struct {
Damage int32 `mc:"VarInt"`
}
func (*Damage) Type() slot.ComponentID {
return 3
}
func (*Damage) ID() string {
return "minecraft:damage"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type DamageResistant struct {
Types pk.Identifier // Tag specifying damage types
}
func (*DamageResistant) Type() slot.ComponentID {
return 24
}
func (*DamageResistant) ID() string {
return "minecraft:damage_resistant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type DeathProtection struct {
Effects []ConsumeEffect
}
func (*DeathProtection) Type() slot.ComponentID {
return 32
}
func (*DeathProtection) ID() string {
return "minecraft:death_protection"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type DebugStickState struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*DebugStickState) Type() slot.ComponentID {
return 48
}
func (*DebugStickState) ID() string {
return "minecraft:debug_stick_state"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type DyedColor struct {
Color int32 `mc:"Int"` // RGB components encoded as integer
}
func (*DyedColor) Type() slot.ComponentID {
return 35
}
func (*DyedColor) ID() string {
return "minecraft:dyed_color"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Enchantable struct {
Value int32 `mc:"VarInt"`
}
func (*Enchantable) Type() slot.ComponentID {
return 27
}
func (*Enchantable) ID() string {
return "minecraft:enchantable"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type EnchantmentGlintOverride struct {
HasGlint bool
}
func (*EnchantmentGlintOverride) Type() slot.ComponentID {
return 18
}
func (*EnchantmentGlintOverride) ID() string {
return "minecraft:enchantment_glint_override"
}

View File

@ -0,0 +1,24 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Enchantments struct {
Enchantments []Enchantment
}
//codec:gen
type Enchantment struct {
Type int32 `mc:"VarInt"`
Level int32 `mc:"VarInt"`
}
func (*Enchantments) Type() slot.ComponentID {
return 10
}
func (*Enchantments) ID() string {
return "minecraft:enchantments"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type EntityData struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*EntityData) Type() slot.ComponentID {
return 49
}
func (*EntityData) ID() string {
return "minecraft:entity_data"
}

View File

@ -0,0 +1,34 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Equippable struct {
Slot int32 `mc:"VarInt"` // 0=mainhand, 1=feet, 2=legs, etc.
EquipSoundID int32 `mc:"VarInt"`
//opt:id:EquipSoundID
EquipSoundEvent *SoundEvent
HasModel bool
//opt:optional:HasModel
Model string `mc:"Identifier"`
HasCameraOverlay bool
//opt:optional:HasCameraOverlay
CameraOverlay string `mc:"Identifier"`
HasAllowedEntities bool
//opt:optional:HasAllowedEntities
AllowedEntitiesID pk.IDSet
Dispensable bool
Swappable bool
DamageOnHurt bool
}
func (*Equippable) Type() slot.ComponentID {
return 28
}
func (*Equippable) ID() string {
return "minecraft:equippable"
}

View File

@ -0,0 +1,27 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type FireworkExplosion struct {
Explosion FireworkExplosionData
}
//codec:gen
type FireworkExplosionData struct {
Shape int32 `mc:"VarInt"`
Colors []int32
FadeColors []int32
HasTrail bool
HasTwinkle bool
}
func (*FireworkExplosion) Type() slot.ComponentID {
return 59
}
func (*FireworkExplosion) ID() string {
return "minecraft:firework_explosion"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Fireworks struct {
FlightDuration int32 `mc:"VarInt"`
Explosions []FireworkExplosionData
}
func (*Fireworks) Type() slot.ComponentID {
return 60
}
func (*Fireworks) ID() string {
return "minecraft:fireworks"
}

View File

@ -0,0 +1,20 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Food struct {
Nutrition int32 `mc:"VarInt"`
SaturationModifier float32
CanAlwaysEat bool
}
func (*Food) Type() slot.ComponentID {
return 20
}
func (*Food) ID() string {
return "minecraft:food"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type FoxVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*FoxVariant) Type() slot.ComponentID {
return 76
}
func (*FoxVariant) ID() string {
return "minecraft:fox/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type FrogVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*FrogVariant) Type() slot.ComponentID {
return 87
}
func (*FrogVariant) ID() string {
return "minecraft:frog/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Glider struct {
// no fields
}
func (*Glider) Type() slot.ComponentID {
return 30
}
func (*Glider) ID() string {
return "minecraft:glider"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type HorseVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*HorseVariant) Type() slot.ComponentID {
return 88
}
func (*HorseVariant) ID() string {
return "minecraft:horse/variant"
}

View File

@ -0,0 +1,28 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Instrument struct {
Instrument packet.OptID[InstrumentData, *InstrumentData]
}
//codec:gen
type InstrumentData struct {
SoundEvent packet.OptID[SoundEvent, *SoundEvent]
SoundRange float32
Range float32
Description chat.Message
}
func (*Instrument) Type() slot.ComponentID {
return 52
}
func (*Instrument) ID() string {
return "minecraft:instrument"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type IntangibleProjectile struct {
Empty nbt.RawMessage `mc:"NBT"` // Always empty compound tag
}
func (*IntangibleProjectile) Type() slot.ComponentID {
return 19
}
func (*IntangibleProjectile) ID() string {
return "minecraft:intangible_projectile"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type ItemModel struct {
Model packet.Identifier
}
func (*ItemModel) Type() slot.ComponentID {
return 7
}
func (*ItemModel) ID() string {
return "minecraft:item_model"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
)
//codec:gen
type ItemName struct {
Name chat.Message
}
func (*ItemName) Type() slot.ComponentID {
return 6
}
func (*ItemName) ID() string {
return "minecraft:item_name"
}

View File

@ -0,0 +1,67 @@
package component
import (
"io"
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
"github.com/Tnze/go-mc/net/packet"
)
type JukeboxPlayable struct {
Mode int8
Name packet.Identifier
SongData packet.OptID[JukeboxSongData, *JukeboxSongData]
}
func (p *JukeboxPlayable) ReadFrom(r io.Reader) (n int64, err error) {
n1, err := (*packet.Byte)(&p.Mode).ReadFrom(r)
if err != nil {
return n1, err
}
if p.Mode == 0 {
n2, err := p.Name.ReadFrom(r)
return n1 + n2, err
}
if p.Mode == 1 {
n2, err := p.SongData.ReadFrom(r)
return n1 + n2, err
}
return n1, err
}
func (p JukeboxPlayable) WriteTo(w io.Writer) (int64, error) {
n1, err := (*packet.Byte)(&p.Mode).WriteTo(w)
if err != nil {
return n1, err
}
if p.Mode == 0 {
n2, err := p.Name.WriteTo(w)
return n1 + n2, err
}
if p.Mode == 1 {
n2, err := p.SongData.WriteTo(w)
return n1 + n2, err
}
return n1, err
}
//codec:gen
type JukeboxSongData struct {
SoundEvent packet.OptID[SoundEvent, *SoundEvent]
Description chat.Message
Duration float32
Output int32 `mc:"VarInt"`
}
func (*JukeboxPlayable) Type() slot.ComponentID {
return 55
}
func (*JukeboxPlayable) ID() string {
return "minecraft:jukebox_playable"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type LlamaVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*LlamaVariant) Type() slot.ComponentID {
return 90
}
func (*LlamaVariant) ID() string {
return "minecraft:llama/variant"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type Lock struct {
Key nbt.RawMessage `mc:"NBT"`
}
func (*Lock) Type() slot.ComponentID {
return 69
}
func (*Lock) ID() string {
return "minecraft:lock"
}

View File

@ -0,0 +1,23 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type LodestoneTracker struct {
HasGlobalPosition bool
Dimension pk.Option[packet.Identifier, *packet.Identifier]
Position pk.Option[pk.Position, *pk.Position]
Tracked bool
}
func (*LodestoneTracker) Type() slot.ComponentID {
return 58
}
func (*LodestoneTracker) ID() string {
return "minecraft:lodestone_tracker"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
)
//codec:gen
type Lore struct {
Lines []chat.Message
}
func (*Lore) Type() slot.ComponentID {
return 8
}
func (*Lore) ID() string {
return "minecraft:lore"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MapColor struct {
Color int32 `mc:"Int"` // RGB components encoded as integer
}
func (*MapColor) Type() slot.ComponentID {
return 36
}
func (*MapColor) ID() string {
return "minecraft:map_color"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type MapDecorations struct {
Data nbt.RawMessage `mc:"NBT"` // Always a Compound Tag
}
func (*MapDecorations) Type() slot.ComponentID {
return 38
}
func (*MapDecorations) ID() string {
return "minecraft:map_decorations"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MapID struct {
MapID int32 `mc:"VarInt"`
}
func (*MapID) Type() slot.ComponentID {
return 37
}
func (*MapID) ID() string {
return "minecraft:map_id"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MapPostProcessing struct {
PostProcessingType int32 `mc:"VarInt"` // 0=Lock, 1=Scale
}
func (*MapPostProcessing) Type() slot.ComponentID {
return 39
}
func (*MapPostProcessing) ID() string {
return "minecraft:map_post_processing"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MaxDamage struct {
Damage int32 `mc:"VarInt"`
}
func (*MaxDamage) Type() slot.ComponentID {
return 2
}
func (*MaxDamage) ID() string {
return "minecraft:max_damage"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MaxStackSize struct {
Size int32 `mc:"VarInt"`
}
func (*MaxStackSize) Type() slot.ComponentID {
return 1
}
func (*MaxStackSize) ID() string {
return "minecraft:max_stack_size"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type MooshroomVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*MooshroomVariant) Type() slot.ComponentID {
return 82
}
func (*MooshroomVariant) ID() string {
return "minecraft:mooshroom/variant"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type NoteBlockSound struct {
Sound packet.Identifier
}
func (*NoteBlockSound) Type() slot.ComponentID {
return 62
}
func (*NoteBlockSound) ID() string {
return "minecraft:note_block_sound"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type OminousBottleAmplifier struct {
Amplifier int32 `mc:"VarInt"`
}
func (*OminousBottleAmplifier) Type() slot.ComponentID {
return 54
}
func (*OminousBottleAmplifier) ID() string {
return "minecraft:ominous_bottle_amplifier"
}

View File

@ -0,0 +1,24 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type PaintingVariant struct {
Width int32
Height int32
AssetID pk.Identifier
Title pk.Option[chat.Message, *chat.Message]
Author pk.Option[chat.Message, *chat.Message]
}
func (*PaintingVariant) Type() slot.ComponentID {
return 89
}
func (*PaintingVariant) ID() string {
return "minecraft:painting/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type ParrotVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*ParrotVariant) Type() slot.ComponentID {
return 78
}
func (*ParrotVariant) ID() string {
return "minecraft:parrot/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type PigVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*PigVariant) Type() slot.ComponentID {
return 84
}
func (*PigVariant) ID() string {
return "minecraft:pig/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type PotDecorations struct {
Decorations []int32 `mc:"PrefixedArray"`
}
func (*PotDecorations) Type() slot.ComponentID {
return 65
}
func (*PotDecorations) ID() string {
return "minecraft:pot_decorations"
}

View File

@ -0,0 +1,42 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type PotionContents struct {
HasPotionID bool
PotionID int32 `mc:"VarInt"`
HasCustomColor bool
CustomColor int32 `mc:"Int"`
CustomEffects []PotionEffect
CustomName string
}
//codec:gen
type PotionEffect struct {
TypeID int32 `mc:"VarInt"`
Details PotionEffectDetails
}
//codec:gen
type PotionEffectDetails struct {
Amplifier int32 `mc:"VarInt"`
Duration int32 `mc:"VarInt"`
Ambient bool
ShowParticles bool
ShowIcon bool
HasHiddenEffect bool
//opt:optional:HasHiddenEffect
HiddenEffect *PotionEffect
}
func (*PotionContents) Type() slot.ComponentID {
return 42
}
func (*PotionContents) ID() string {
return "minecraft:potion_contents"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type PotionDurationScale struct {
EffectMultiplier float32
}
func (*PotionDurationScale) Type() slot.ComponentID {
return 43
}
func (*PotionDurationScale) ID() string {
return "minecraft:potion_duration_scale"
}

View File

@ -0,0 +1,31 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Profile struct {
HasName bool
Name pk.Option[pk.String, *pk.String]
HasUniqueID bool
UniqueID pk.Option[pk.UUID, *pk.UUID]
Properties []ProfileProperty
}
//codec:gen
type ProfileProperty struct {
Name string `mc:"String"`
Value string `mc:"String"`
HasSignature bool
Signature pk.Option[pk.String, *pk.String]
}
func (*Profile) Type() slot.ComponentID {
return 61
}
func (*Profile) ID() string {
return "minecraft:profile"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type ProvidesBannerPatterns struct {
Key packet.Identifier
}
func (*ProvidesBannerPatterns) Type() slot.ComponentID {
return 56
}
func (*ProvidesBannerPatterns) ID() string {
return "minecraft:provides_banner_patterns"
}

View File

@ -0,0 +1,58 @@
package component
import (
"io"
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/net/packet"
)
type ProvidesTrimMaterial struct {
Mode int8
Name packet.Identifier
Material packet.OptID[TrimMaterial, *TrimMaterial]
}
func (p *ProvidesTrimMaterial) ReadFrom(r io.Reader) (n int64, err error) {
n1, err := (*packet.Byte)(&p.Mode).ReadFrom(r)
if err != nil {
return n1, err
}
if p.Mode == 0 {
n2, err := p.Name.ReadFrom(r)
return n1 + n2, err
}
if p.Mode == 1 {
n2, err := p.Material.ReadFrom(r)
return n1 + n2, err
}
return n1, err
}
func (p ProvidesTrimMaterial) WriteTo(w io.Writer) (int64, error) {
n1, err := (*packet.Byte)(&p.Mode).WriteTo(w)
if err != nil {
return n1, err
}
if p.Mode == 0 {
n2, err := p.Name.WriteTo(w)
return n1 + n2, err
}
if p.Mode == 1 {
n2, err := p.Material.WriteTo(w)
return n1 + n2, err
}
return n1, err
}
func (*ProvidesTrimMaterial) Type() slot.ComponentID {
return 53
}
func (*ProvidesTrimMaterial) ID() string {
return "minecraft:provides_trim_material"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type RabbitVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*RabbitVariant) Type() slot.ComponentID {
return 83
}
func (*RabbitVariant) ID() string {
return "minecraft:rabbit/variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Rarity struct {
Rarity int32 `mc:"VarInt"` // 0=Common, 1=Uncommon, 2=Rare, 3=Epic
}
func (*Rarity) Type() slot.ComponentID {
return 9
}
func (*Rarity) ID() string {
return "minecraft:rarity"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type Recipes struct {
Data nbt.RawMessage `mc:"NBT"`
}
func (*Recipes) Type() slot.ComponentID {
return 57
}
func (*Recipes) ID() string {
return "minecraft:recipes"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type RepairCost struct {
Cost int32 `mc:"VarInt"`
}
func (*RepairCost) Type() slot.ComponentID {
return 16
}
func (*RepairCost) ID() string {
return "minecraft:repair_cost"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Repairable struct {
Items pk.IDSet
}
func (*Repairable) Type() slot.ComponentID {
return 29
}
func (*Repairable) ID() string {
return "minecraft:repairable"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type SalmonSize struct {
SizeType int32 `mc:"VarInt"`
}
func (*SalmonSize) Type() slot.ComponentID {
return 77
}
func (*SalmonSize) ID() string {
return "minecraft:salmon/size"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type SheepColor struct {
Color DyeColor
}
func (*SheepColor) Type() slot.ComponentID {
return 94
}
func (*SheepColor) ID() string {
return "minecraft:sheep/color"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type ShulkerColor struct {
Color DyeColor
}
func (*ShulkerColor) Type() slot.ComponentID {
return 95
}
func (*ShulkerColor) ID() string {
return "minecraft:shulker/color"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type StoredEnchantments struct {
Enchantments []Enchantment
}
func (*StoredEnchantments) Type() slot.ComponentID {
return 34
}
func (*StoredEnchantments) ID() string {
return "minecraft:stored_enchantments"
}

View File

@ -0,0 +1,24 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type SuspiciousStewEffects struct {
Effects []SuspiciousStewEffect
}
//codec:gen
type SuspiciousStewEffect struct {
TypeID int32 `mc:"VarInt"`
Duration int32 `mc:"VarInt"`
}
func (*SuspiciousStewEffects) Type() slot.ComponentID {
return 44
}
func (*SuspiciousStewEffects) ID() string {
return "minecraft:suspicious_stew_effects"
}

View File

@ -0,0 +1,30 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Tool struct {
Rules []ToolRule
DefaultMiningSpeed float32
DamagePerBlock int32 `mc:"VarInt"`
}
//codec:gen
type ToolRule struct {
Blocks pk.IDSet
HasSpeed bool
Speed pk.Option[pk.Float, *pk.Float]
HasCorrectDropForBlocks bool
CorrectDropForBlocks pk.Option[pk.Boolean, *pk.Boolean]
}
func (*Tool) Type() slot.ComponentID {
return 25
}
func (*Tool) ID() string {
return "minecraft:tool"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type TooltipDisplay struct {
HideTooltip bool
HiddenComponents []int32 `mc:"VarInt"`
}
func (*TooltipDisplay) Type() slot.ComponentID {
return 15
}
func (*TooltipDisplay) ID() string {
return "minecraft:tooltip_display"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type TooltipStyle struct {
Style pk.Identifier
}
func (*TooltipStyle) Type() slot.ComponentID {
return 31
}
func (*TooltipStyle) ID() string {
return "minecraft:tooltip_style"
}

View File

@ -0,0 +1,42 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Trim struct {
TrimMaterial TrimMaterial
TrimPattern TrimPattern
}
//codec:gen
type TrimMaterial struct {
Suffix string
Overrides []TrimOverride
Description chat.Message
}
//codec:gen
type TrimOverride struct {
MaterialType pk.Identifier
OverrideAssetName string
}
//codec:gen
type TrimPattern struct {
AssetName string
TemplateItem int32 `mc:"VarInt"`
Description chat.Message
Decal bool
}
func (*Trim) Type() slot.ComponentID {
return 47
}
func (*Trim) ID() string {
return "minecraft:trim"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type TropicalFishBaseColor struct {
Color DyeColor
}
func (*TropicalFishBaseColor) Type() slot.ComponentID {
return 80
}
func (*TropicalFishBaseColor) ID() string {
return "minecraft:tropical_fish/base_color"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type TropicalFishPattern struct {
Pattern int32 `mc:"VarInt"`
}
func (*TropicalFishPattern) Type() slot.ComponentID {
return 79
}
func (*TropicalFishPattern) ID() string {
return "minecraft:tropical_fish/pattern"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type TropicalFishPatternColor struct {
Color DyeColor
}
func (*TropicalFishPatternColor) Type() slot.ComponentID {
return 81
}
func (*TropicalFishPatternColor) ID() string {
return "minecraft:tropical_fish/pattern_color"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Unbreakable struct {
// no fields
}
func (*Unbreakable) Type() slot.ComponentID {
return 4
}
func (*Unbreakable) ID() string {
return "minecraft:unbreakable"
}

View File

@ -0,0 +1,20 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type UseCooldown struct {
Seconds float32
CooldownGroup pk.Option[pk.Identifier, *pk.Identifier]
}
func (*UseCooldown) Type() slot.ComponentID {
return 23
}
func (*UseCooldown) ID() string {
return "minecraft:use_cooldown"
}

View File

@ -0,0 +1,18 @@
package component
import (
slot2 "git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type UseRemainder struct {
Remainder slot2.Slot
}
func (*UseRemainder) Type() slot2.ComponentID {
return 22
}
func (*UseRemainder) ID() string {
return "minecraft:use_remainder"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type VillagerVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*VillagerVariant) Type() slot.ComponentID {
return 72
}
func (*VillagerVariant) ID() string {
return "minecraft:villager/variant"
}

View File

@ -0,0 +1,19 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type Weapon struct {
DamagePerAttack int32 `mc:"VarInt"`
DisableBlockingFor float32 // In seconds
}
func (*Weapon) Type() slot.ComponentID {
return 26
}
func (*Weapon) ID() string {
return "minecraft:weapon"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type WolfCollar struct {
Color DyeColor
}
func (*WolfCollar) Type() slot.ComponentID {
return 75
}
func (*WolfCollar) ID() string {
return "minecraft:wolf/collar"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type WolfSoundVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*WolfSoundVariant) Type() slot.ComponentID {
return 74
}
func (*WolfSoundVariant) ID() string {
return "minecraft:wolf/sound_variant"
}

View File

@ -0,0 +1,18 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
)
//codec:gen
type WolfVariant struct {
Variant int32 `mc:"VarInt"`
}
func (*WolfVariant) Type() slot.ComponentID {
return 73
}
func (*WolfVariant) ID() string {
return "minecraft:wolf/variant"
}

View File

@ -0,0 +1,26 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type WritableBookContent struct {
Pages []WritableBookPage
}
//codec:gen
type WritableBookPage struct {
RawContent string `mc:"String"`
HasFilteredContent bool
FilteredContent pk.Option[pk.String, *pk.String]
}
func (*WritableBookContent) Type() slot.ComponentID {
return 45
}
func (*WritableBookContent) ID() string {
return "minecraft:writable_book_content"
}

View File

@ -0,0 +1,32 @@
package component
import (
"git.konjactw.dev/patyhank/minego/pkg/protocol/slot"
"github.com/Tnze/go-mc/chat"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type WrittenBookContent struct {
RawTitle string `mc:"String"`
HasFilteredTitle bool
FilteredTitle pk.Option[pk.String, *pk.String]
Author string `mc:"String"`
Generation int32 `mc:"VarInt"`
Pages []WrittenBookPage
}
//codec:gen
type WrittenBookPage struct {
RawContent chat.Message
HasFilteredContent bool
FilteredContent pk.Option[chat.Message, *chat.Message]
}
func (*WrittenBookContent) Type() slot.ComponentID {
return 46
}
func (*WrittenBookContent) ID() string {
return "minecraft:written_book_content"
}