Skip to content

Commit

Permalink
steven, protocol: update to minecraft 15w32c
Browse files Browse the repository at this point in the history
  • Loading branch information
Thinkofname committed Aug 10, 2015
1 parent 9bb88b6 commit b906a7e
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 170 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ func (c *ClientState) MouseAction(button glfw.MouseButton, down bool) {
return
}
if c.playerInventory.Items[c.currentHotbarSlot+invPlayerHotbarOffset] != nil {
c.network.Write(&protocol.PlayerBlockPlacement{
Face: 0xFF,
c.network.Write(&protocol.UseItem{
Hand: 0,
})
}

Expand All @@ -677,7 +677,7 @@ func (c *ClientState) MouseAction(button glfw.MouseButton, down bool) {
c.network.Write(&protocol.ArmSwing{})
c.network.Write(&protocol.PlayerBlockPlacement{
Location: protocol.NewPosition(pos.X, pos.Y, pos.Z),
Face: directionToProtocol(face),
Face: protocol.VarInt(directionToProtocol(face)),
CursorX: byte(cur.X() * 16),
CursorY: byte(cur.Y() * 16),
CursorZ: byte(cur.Z() * 16),
Expand Down
40 changes: 24 additions & 16 deletions protocol/play_clientbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type TimeUpdate struct {
// This is a Minecraft packet
type EntityEquipment struct {
EntityID VarInt
Slot int16
Slot VarInt
Item ItemStack `as:"raw"`
}

Expand Down Expand Up @@ -153,12 +153,11 @@ type Animation struct {
//
// This is a Minecraft packetC
type SpawnPlayer struct {
EntityID VarInt
UUID UUID `as:"raw"`
X, Y, Z int32
Yaw, Pitch int8
CurrentItem int16
Metadata Metadata
EntityID VarInt
UUID UUID `as:"raw"`
X, Y, Z int32
Yaw, Pitch int8
Metadata Metadata
}

// CollectItem causes the collected item to fly towards the collector. This
Expand All @@ -177,11 +176,12 @@ type CollectItem struct {
// This is a Minecraft packetE
type SpawnObject struct {
EntityID VarInt
UUID UUID `as:"raw"`
Type byte
X, Y, Z int32
Pitch, Yaw int8
Data int32
VelocityX, VelocityY, VelocityZ int16 `if:".Data != 0"`
VelocityX, VelocityY, VelocityZ int16
}

// SpawnMob is used to spawn a living entity into the world when it is in
Expand All @@ -190,6 +190,7 @@ type SpawnObject struct {
// This is a Minecraft packetF
type SpawnMob struct {
EntityID VarInt
UUID UUID `as:"raw"`
Type byte
X, Y, Z int32
Yaw, Pitch int8
Expand Down Expand Up @@ -762,10 +763,10 @@ type ServerDifficulty struct {
// This is a Minecraft packet
type CombatEvent struct {
Event VarInt
Duration VarInt `if:".Event == 1"`
PlayerID VarInt `if:".Event == 2"`
EntityID int32 `if:".Event == 1 .Event == 2"`
Message string `if:".Event == 2"`
Duration VarInt `if:".Event == 1"`
PlayerID VarInt `if:".Event == 2"`
EntityID int32 `if:".Event == 1 .Event == 2"`
Message format.AnyComponent `as:"json" if:".Event == 2"`
}

// Camera causes the client to spectate the entity with the passed id.
Expand Down Expand Up @@ -827,10 +828,17 @@ type ResourcePackSend struct {
Hash string
}

// UpdateEntityNBT updates the nbt tag for an entity.
// BossBar displays and/or changes a boss bar that is displayed on the
// top of the client's screen. This is normally used for bosses such as
// the ender dragon or the wither.
//
// This is a Minecraft packet
type UpdateEntityNBT struct {
EntityID VarInt
Tag *nbt.Compound
type BossBar struct {
UUID UUID `as:"raw"`
Action VarInt
Title format.AnyComponent `as:"json" if:".Action == 0 .Action == 3"`
Health float32 `if:".Action == 0 .Action == 2"`
Color VarInt `if:".Action == 0 .Action == 4"`
Style VarInt `if:".Action == 0 .Action == 4"`
Flags byte `if:".Action == 0 .Action == 5"`
}

0 comments on commit b906a7e

Please sign in to comment.