1
0
Fork 0
cuberite-2a/src/Blocks/BlockWorkbench.h

62 lines
825 B
C
Raw Normal View History

#pragma once
#include "BlockHandler.h"
2014-12-13 14:06:55 +00:00
#include "../UI/CraftingWindow.h"
#include "../Entities/Player.h"
class cBlockWorkbenchHandler:
public cBlockHandler
{
using Super = cBlockHandler;
public:
using Super::Super;
private:
virtual bool OnUse(
cChunkInterface & a_ChunkInterface,
cWorldInterface & a_WorldInterface,
cPlayer & a_Player,
const Vector3i a_BlockPos,
eBlockFace a_BlockFace,
const Vector3i a_CursorPos
) const override
{
a_Player.GetStatManager().AddValue(Statistic::InteractWithCraftingTable);
cWindow * Window = new cCraftingWindow();
2017-07-31 20:17:52 +00:00
a_Player.OpenWindow(*Window);
return true;
}
virtual bool IsUseable(void) const override
{
return true;
}
2015-06-30 14:50:15 +00:00
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
2015-06-30 14:50:15 +00:00
{
UNUSED(a_Meta);
return 13;
}
} ;