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