diff options
author | archshift <admin@archshift.com> | 2014-07-19 11:55:36 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-07-19 11:55:36 +0200 |
commit | 7c861f98a2933e125f100f239d0ae5e977d1a719 (patch) | |
tree | 846d4d6530b4a89b5827dc4d9ddcac422d42ba18 | |
parent | Trees.cpp: removed unused "debug" fields (diff) | |
download | cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar.gz cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar.bz2 cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar.lz cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar.xz cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.tar.zst cuberite-7c861f98a2933e125f100f239d0ae5e977d1a719.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Minecart.cpp | 16 | ||||
-rw-r--r-- | src/Entities/Minecart.h | 11 |
2 files changed, 7 insertions, 20 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp index 03850c8a7..d4eadc5d5 100644 --- a/src/Entities/Minecart.cpp +++ b/src/Entities/Minecart.cpp @@ -103,21 +103,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) : void cMinecart::SpawnOn(cClientHandle & a_ClientHandle) { - char SubType = 0; - switch (m_Payload) - { - case mpNone: SubType = 0; break; - case mpChest: SubType = 1; break; - case mpFurnace: SubType = 2; break; - case mpTNT: SubType = 3; break; - case mpHopper: SubType = 5; break; - default: - { - ASSERT(!"Unknown payload, cannot spawn on client"); - return; - } - } - a_ClientHandle.SendSpawnVehicle(*this, 10, SubType); // 10 = Minecarts, SubType = What type of Minecart + a_ClientHandle.SendSpawnVehicle(*this, 10, (char)m_Payload); // 10 = Minecarts a_ClientHandle.SendEntityMetadata(*this); } diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h index 798f844ce..c585cfab0 100644 --- a/src/Entities/Minecart.h +++ b/src/Entities/Minecart.h @@ -23,13 +23,14 @@ class cMinecart : public: CLASS_PROTODEF(cMinecart); + /** Minecart payload, values correspond to packet subtype */ enum ePayload { - mpNone, // Empty minecart, ridable by player or mobs - mpChest, // Minecart-with-chest, can store a grid of 3*8 items - mpFurnace, // Minecart-with-furnace, can be powered - mpTNT, // Minecart-with-TNT, can be blown up with activator rail - mpHopper, // Minecart-with-hopper, can be hopper + mpNone = 0, // Empty minecart, ridable by player or mobs + mpChest = 1, // Minecart-with-chest, can store a grid of 3*8 items + mpFurnace = 2, // Minecart-with-furnace, can be powered + mpTNT = 3, // Minecart-with-TNT, can be blown up with activator rail + mpHopper = 5, // Minecart-with-hopper, can be hopper // TODO: Spawner minecarts, (and possibly any block in a minecart with NBT editing) } ; |