| 112 | } |
| 113 | |
| 114 | func (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 | } |