summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/CommandBlockEntity.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-01-18 14:40:47 +0100
committerandrew <xdotftw@gmail.com>2014-01-18 14:40:47 +0100
commitbe5299350a3b808ade39df7e9654eda47732e96e (patch)
tree0ab800ee34fc0489a9542ae3607383050bae7f8e /src/BlockEntities/CommandBlockEntity.cpp
parentBasic command block implementation (diff)
downloadcuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar.gz
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar.bz2
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar.lz
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar.xz
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.tar.zst
cuberite-be5299350a3b808ade39df7e9654eda47732e96e.zip
Diffstat (limited to 'src/BlockEntities/CommandBlockEntity.cpp')
-rw-r--r--src/BlockEntities/CommandBlockEntity.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 6e371e0fe..88e55dece 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -45,7 +45,7 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
cWindow * Window = GetWindow();
if (Window == NULL)
{
- //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this));
+ //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this)); FIXME
Window = GetWindow();
}
@@ -71,6 +71,24 @@ void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
+void cCommandBlockEntity::SetLastOutput(const AString & a_LastOut)
+{
+ m_LastOutput = a_LastOut;
+}
+
+
+
+
+
+void cCommandBlockEntity::SetResult(const NIBBLETYPE a_Result)
+{
+ m_Result = a_Result;
+}
+
+
+
+
+
const AString & cCommandBlockEntity::GetCommand(void) const
{
return m_Command;
@@ -89,6 +107,15 @@ const AString & cCommandBlockEntity::GetLastOutput(void) const
+NIBBLETYPE cCommandBlockEntity::GetResult(void) const
+{
+ return m_Result;
+}
+
+
+
+
+
void cCommandBlockEntity::Activate(void)
{
m_ShouldExecute = true;
@@ -164,8 +191,11 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value)
void cCommandBlockEntity::Execute()
{
// TODO: Parse arguments and dispatch command
+
LOGD("Command: %s", m_Command.c_str());
+
m_LastOutput = "";
+ m_Result = 0;
}