summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-01-17 11:27:56 +0100
committerMattes D <github@xoft.cz>2014-01-17 11:27:56 +0100
commit79c1f6f43844a85abac53f4c61bff398b88b669d (patch)
treef938528aed92ffdbea0c5d15f84f738c65c9d8d4 /src/Protocol/Protocol17x.cpp
parentFixed SIGABRT_COMPAT on other architectures. (diff)
parentChanged GetContent function. (diff)
downloadcuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.gz
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.bz2
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.lz
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.xz
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.zst
cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 354b2476a..5b3a79555 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1890,8 +1890,23 @@ void cProtocol172::cPacketizer::WriteEntityMetadata(const cEntity & a_Entity)
WriteInt(1); // Shaking direction, doesn't seem to affect anything
WriteByte(0x73);
WriteFloat((float)(((const cMinecart &)a_Entity).LastDamage() + 10)); // Damage taken / shake effect multiplyer
-
- if (((cMinecart &)a_Entity).GetPayload() == cMinecart::mpFurnace)
+
+ if (((cMinecart &)a_Entity).GetPayload() == cMinecart::mpNone)
+ {
+ cRideableMinecart & RideableMinecart = ((cRideableMinecart &)a_Entity);
+ if (!RideableMinecart.GetContent().IsEmpty())
+ {
+ WriteByte(0x54);
+ int Content = RideableMinecart.GetContent().m_ItemType;
+ Content |= RideableMinecart.GetContent().m_ItemDamage << 8;
+ WriteInt(Content);
+ WriteByte(0x55);
+ WriteInt(RideableMinecart.GetBlockHeight());
+ WriteByte(0x56);
+ WriteByte(1);
+ }
+ }
+ else if (((cMinecart &)a_Entity).GetPayload() == cMinecart::mpFurnace)
{
WriteByte(0x10);
WriteByte(((const cMinecartWithFurnace &)a_Entity).IsFueled() ? 1 : 0);