1
0

Implement horse inventory (#4053)

* Implement horse inventory

* Fix sign conversions

* Add API doc for ItemCategory::IsHorseArmor

* Improve HandleOpenHorseInventory comment and style fixes.
This commit is contained in:
peterbell10
2017-10-21 17:56:09 +01:00
committed by Alexander Harkness
parent e585595ae6
commit 0bacda3269
15 changed files with 473 additions and 27 deletions

View File

@@ -48,6 +48,7 @@ Implements the 1.9 protocol classes:
#include "../Mobs/IncludeAllMonsters.h"
#include "../UI/Window.h"
#include "../UI/HorseWindow.h"
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
@@ -1723,7 +1724,8 @@ void cProtocol_1_9_0::SendWindowOpen(const cWindow & a_Window)
if (a_Window.GetWindowType() == cWindow::wtAnimalChest)
{
Pkt.WriteBEInt32(0); // TODO: The animal's EntityID
UInt32 HorseID = static_cast<const cHorseWindow &>(a_Window).GetHorseID();
Pkt.WriteBEInt32(static_cast<Int32>(HorseID));
}
}
@@ -2517,6 +2519,7 @@ void cProtocol_1_9_0::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer)
case 2: m_Client->HandleEntityLeaveBed(PlayerID); break; // Leave Bed
case 3: m_Client->HandleEntitySprinting(PlayerID, true); break; // Start sprinting
case 4: m_Client->HandleEntitySprinting(PlayerID, false); break; // Stop sprinting
case 7: m_Client->HandleOpenHorseInventory(PlayerID); break; // Open horse inventory
}
}