2020-11-25 19:58:35 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockEntity.h"
|
|
|
|
#include "../BlockEntities/NoteEntity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockNoteBlockHandler final :
|
|
|
|
public cBlockEntityHandler
|
|
|
|
{
|
|
|
|
using Super = cBlockEntityHandler;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
using Super::Super;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
virtual void OnDigging(
|
|
|
|
cChunkInterface & a_ChunkInterface,
|
|
|
|
cWorldInterface & a_WorldInterface,
|
|
|
|
cPlayer & a_Player,
|
|
|
|
const Vector3i a_BlockPos
|
|
|
|
) const override
|
|
|
|
{
|
2021-03-28 09:40:57 -04:00
|
|
|
a_WorldInterface.DoWithBlockEntityAt(a_BlockPos, [](cBlockEntity & a_BlockEntity)
|
2020-11-25 19:58:35 -05:00
|
|
|
{
|
2021-04-30 09:23:46 -04:00
|
|
|
ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_NOTE_BLOCK);
|
2020-11-25 19:58:35 -05:00
|
|
|
|
2021-03-28 09:40:57 -04:00
|
|
|
static_cast<cNoteEntity &>(a_BlockEntity).MakeSound();
|
|
|
|
return false;
|
2020-11-25 19:58:35 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|