Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockDirt.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "BlockHandler.h"
5 
6 
7 
8 
9 
10 class cBlockDirtHandler final :
11  public cBlockHandler
12 {
14 
15 public:
16 
17  using Super::Super;
18 
19 private:
20 
21  virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
22  {
23  if (a_BlockMeta == E_META_DIRT_COARSE)
24  {
25  // Drop the coarse block (dirt, meta 1)
27  }
28  else
29  {
31  }
32  }
33 
34 
35 
36 
37 
38  virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
39  {
40  UNUSED(a_Meta);
41  return 10;
42  }
43 } ;
44 
45 
46 
47 
@ E_META_DIRT_NORMAL
Definition: BlockType.h:639
@ E_META_DIRT_COARSE
Definition: BlockType.h:641
@ E_BLOCK_DIRT
Definition: BlockType.h:13
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
Byte ColourID
Definition: Globals.h:162
#define UNUSED
Definition: Globals.h:72
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
Definition: BlockDirt.h:38
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
Definition: BlockDirt.h:21
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
Definition: BlockHandler.h:29
Definition: Item.h:37
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215