1
0
cuberite-2a/src/Blocks/BlockWorkbench.h
12xx12 c2f8ceb554
Add more statistic tracking (#4837)
+ Added possible 1.8 stats
+ Added stat tracking for 1.8.2
+ Added stat tracking for 1.9
+ Added the breed cow achievement

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-09-05 16:13:44 +01:00

67 lines
855 B
C++

#pragma once
#include "BlockHandler.h"
#include "../UI/CraftingWindow.h"
#include "../Entities/Player.h"
class cBlockWorkbenchHandler:
public cBlockHandler
{
using Super = cBlockHandler;
public:
cBlockWorkbenchHandler(BLOCKTYPE a_BlockType):
Super(a_BlockType)
{
}
virtual bool OnUse(
cChunkInterface & a_ChunkInterface,
cWorldInterface & a_WorldInterface,
cPlayer & a_Player,
const Vector3i a_BlockPos,
eBlockFace a_BlockFace,
const Vector3i a_CursorPos
) override
{
a_Player.GetStatManager().AddValue(Statistic::InteractWithCraftingTable);
cWindow * Window = new cCraftingWindow();
a_Player.OpenWindow(*Window);
return true;
}
virtual bool IsUseable(void) override
{
return true;
}
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 13;
}
} ;