Cuberite
A lightweight, fast and extensible game server for Minecraft
ItemString.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ItemHandler.h"
5 
6 
7 
8 
9 
11  public cItemHandler
12 {
13 public:
14  cItemStringHandler(int a_ItemType) :
15  cItemHandler(a_ItemType)
16  {
17  }
18 
19  virtual bool IsPlaceable(void) override
20  {
21  return true;
22  }
23 
25  cWorld * a_World, cPlayer * a_Player,
26  int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
27  int a_CursorX, int a_CursorY, int a_CursorZ,
28  BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
29  ) override
30  {
31  a_BlockType = E_BLOCK_TRIPWIRE;
32  a_BlockMeta = 0;
33  return true;
34  }
35 };
36 
37 
38 
39 
cItemStringHandler(int a_ItemType)
Definition: ItemString.h:14
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
virtual bool GetPlacementBlockTypeMeta(cWorld *a_World, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) override
Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlayerPlace() is ...
Definition: ItemString.h:24
Definition: Player.h:27
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
Definition: World.h:65
virtual bool IsPlaceable(void) override
Blocks simply get placed.
Definition: ItemString.h:19
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
Definition: Defines.h:29