summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-01-12 14:33:32 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-01-12 14:33:32 +0100
commit6ff375273bf757da7c464f6b6a2b0d475a76f370 (patch)
tree95be0c87c7f86dc58d89c44fdfe2fa333e79b79f /src/World.cpp
parentMerge pull request #533 from mc-server/CmakeMultiConfig (diff)
downloadcuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar.gz
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar.bz2
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar.lz
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar.xz
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.tar.zst
cuberite-6ff375273bf757da7c464f6b6a2b0d475a76f370.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 1cf82d641..b5599c660 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -16,6 +16,7 @@
// Entities (except mobs):
#include "Entities/ExpOrb.h"
#include "Entities/FallingBlock.h"
+#include "Entities/Minecart.h"
#include "Entities/Pickup.h"
#include "Entities/Player.h"
#include "Entities/TNTEntity.h"
@@ -1647,6 +1648,29 @@ int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward)
+int cWorld::SpawnMinecart(double a_X, double a_Y, double a_Z, int a_MinecartType)
+{
+ cMinecart * Minecart;
+ switch (a_MinecartType)
+ {
+ case E_ITEM_MINECART: Minecart = new cEmptyMinecart (a_X, a_Y, a_Z); break;
+ case E_ITEM_CHEST_MINECART: Minecart = new cMinecartWithChest (a_X, a_Y, a_Z); break;
+ case E_ITEM_FURNACE_MINECART: Minecart = new cMinecartWithFurnace (a_X, a_Y, a_Z); break;
+ case E_ITEM_MINECART_WITH_TNT: Minecart = new cMinecartWithTNT (a_X, a_Y, a_Z); break;
+ case E_ITEM_MINECART_WITH_HOPPER: Minecart = new cMinecartWithHopper (a_X, a_Y, a_Z); break;
+ default:
+ {
+ ASSERT(!"Unhandled minecart item");
+ return -1;
+ }
+ } // switch (a_MinecartType)
+ Minecart->Initialize(this);
+}
+
+
+
+
+
void cWorld::SpawnPrimedTNT(double a_X, double a_Y, double a_Z, double a_FuseTimeInSec, double a_InitialVelocityCoeff)
{
UNUSED(a_InitialVelocityCoeff);