summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/NoteEntity.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-08-29 15:56:40 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-08-29 15:56:40 +0200
commit431b7ed0b7764db732e39802a40d94dfe9f2108b (patch)
treef3f5ab4a7b1f2838733004d8294e571b777e631f /src/BlockEntities/NoteEntity.h
parentAdded new console command with cleanup (diff)
parentVanillaFluidSimulator: Fixed an invalid Y-coord query. (diff)
downloadcuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.gz
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.bz2
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.lz
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.xz
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.zst
cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.zip
Diffstat (limited to 'src/BlockEntities/NoteEntity.h')
-rw-r--r--src/BlockEntities/NoteEntity.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h
index e8497da3e..f538de060 100644
--- a/src/BlockEntities/NoteEntity.h
+++ b/src/BlockEntities/NoteEntity.h
@@ -2,6 +2,7 @@
#pragma once
#include "BlockEntity.h"
+#include "RedstonePoweredEntity.h"
namespace Json
@@ -30,6 +31,9 @@ enum ENUM_NOTE_INSTRUMENTS
class cNoteEntity :
public cBlockEntity
+ // tolua_end
+ , public cRedstonePoweredEntity
+ // tolua_begin
{
typedef cBlockEntity super;
public:
@@ -38,6 +42,7 @@ public:
/// Creates a new note entity. a_World may be NULL
cNoteEntity(int a_X, int a_Y, int a_Z, cWorld * a_World);
+ virtual ~cNoteEntity() {}
bool LoadFromJson(const Json::Value & a_Value);
virtual void SaveToJson(Json::Value & a_Value) override;
@@ -53,6 +58,14 @@ public:
virtual void UsedBy(cPlayer * a_Player) override;
virtual void SendTo(cClientHandle &) override {}
+
+ virtual void SetRedstonePower(bool a_Value)
+ {
+ if (a_Value)
+ {
+ MakeSound();
+ }
+ }
static const char * GetClassStatic(void) { return "cNoteEntity"; }