summaryrefslogtreecommitdiffstats
path: root/source/blocks/BlockWorkbench.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/blocks/BlockWorkbench.h')
-rw-r--r--source/blocks/BlockWorkbench.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blocks/BlockWorkbench.h b/source/blocks/BlockWorkbench.h
index 2a0936c08..d654ca666 100644
--- a/source/blocks/BlockWorkbench.h
+++ b/source/blocks/BlockWorkbench.h
@@ -1,16 +1,23 @@
#pragma once
#include "Block.h"
-
+#include "../cCraftingWindow.h"
+#include "../cPlayer.h"
class cBlockWorkbenchHandler : public cBlockHandler
{
public:
- cBlockWorkbenchHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
+ cBlockWorkbenchHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual bool IsUseable()
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
+ {
+ cWindow* Window = new cCraftingWindow(0, true);
+ a_Player->OpenWindow(Window);
+ }
+
+ virtual bool IsUseable() override
{
return true;
}