MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / sync

Method sync

server/player/state/playerEntity.go:114–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112}
113
114func (p *PlayerEntity) sync() {
115 x, y, z := p.Position()
116 yaw, pitch := p.Rotation()
117 vx, vy, vz := p.Motion()
118
119 p.data.Abilities = p.abilities.Get()
120 p.data.Pos = [3]float64{x, y, z}
121 p.data.Rotation = [2]float32{yaw, pitch}
122 p.data.OnGround = p.OnGround()
123 p.data.Dimension = p.DimensionName()
124 p.data.Inventory = *p.inventory
125 //p.data.RecipeBook = p.recipeBook.Get()
126
127 p.data.Motion = [3]float64{vx, vy, vz}
128
129 p.data.Attributes = p.Attributes()
130
131 p.data.Health = p.Health()
132 p.data.FoodLevel, p.data.FoodSaturationLevel, p.data.FoodExhaustionLevel = p.Food()
133 p.data.PlayerGameType = level.GameMode(p.gameMode.Load())
134 p.data.SelectedItemSlot = p.selectedItemSlot.Load()
135}

Callers 1

SaveAllMethod · 0.80

Calls 10

GameModeTypeAlias · 0.92
RotationMethod · 0.80
MotionMethod · 0.80
OnGroundMethod · 0.80
DimensionNameMethod · 0.80
AttributesMethod · 0.80
HealthMethod · 0.80
FoodMethod · 0.80
PositionMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected