summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemMinecart.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2016-08-20 14:34:29 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2016-08-20 14:34:29 +0200
commit7175b9e435a54cff33914d21384625a445cc5cf0 (patch)
tree7feb44f1e8e4ed7ea4d5bf0ba1d173abd3417f34 /src/Items/ItemMinecart.h
parentAdded cWorld:SetSpawn() API and Lua binding (#3316) (diff)
downloadcuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar.gz
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar.bz2
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar.lz
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar.xz
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.tar.zst
cuberite-7175b9e435a54cff33914d21384625a445cc5cf0.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemMinecart.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/Items/ItemMinecart.h b/src/Items/ItemMinecart.h
index 6344c0178..d7ea18719 100644
--- a/src/Items/ItemMinecart.h
+++ b/src/Items/ItemMinecart.h
@@ -59,21 +59,8 @@ public:
double x = static_cast<double>(a_BlockX) + 0.5;
double y = static_cast<double>(a_BlockY) + 0.5;
double z = static_cast<double>(a_BlockZ) + 0.5;
- cMinecart * Minecart = nullptr;
- switch (m_ItemType)
- {
- case E_ITEM_MINECART: Minecart = new cRideableMinecart (x, y, z, cItem(), 1); break;
- case E_ITEM_CHEST_MINECART: Minecart = new cMinecartWithChest (x, y, z); break;
- case E_ITEM_FURNACE_MINECART: Minecart = new cMinecartWithFurnace (x, y, z); break;
- case E_ITEM_MINECART_WITH_TNT: Minecart = new cMinecartWithTNT (x, y, z); break;
- case E_ITEM_MINECART_WITH_HOPPER: Minecart = new cMinecartWithHopper (x, y, z); break;
- default:
- {
- ASSERT(!"Unhandled minecart item");
- return false;
- }
- } // switch (m_ItemType)
- Minecart->Initialize(*a_World);
+
+ a_World->SpawnMinecart(x, y, z, m_ItemType);
if (!a_Player->IsGameModeCreative())
{