summaryrefslogtreecommitdiffstats
path: root/src/World.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/World.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/World.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 2b85e4b58..edf27050d 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"
@@ -1673,6 +1674,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, const cItem & a_Content, int a_BlockHeight)
+{
+ cMinecart * Minecart;
+ switch (a_MinecartType)
+ {
+ case E_ITEM_MINECART: Minecart = new cRideableMinecart (a_X, a_Y, a_Z, a_Content, a_BlockHeight); 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:
+ {
+ return -1;
+ }
+ } // switch (a_MinecartType)
+ Minecart->Initialize(this);
+ return Minecart->GetUniqueID();
+}
+
+
+
+
+
void cWorld::SpawnPrimedTNT(double a_X, double a_Y, double a_Z, double a_FuseTimeInSec, double a_InitialVelocityCoeff)
{
UNUSED(a_InitialVelocityCoeff);