Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockSideways.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "BlockHandler.h"
5 
6 
7 
8 
9 
12 class cBlockSidewaysHandler final :
13  public cBlockHandler
14 {
16 
17 public:
18 
19  using Super::Super;
20 
21 private:
22 
23  virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
24  {
25  // Reset the orientation part of meta, keep the sub-type part of meta:
26  return cItem(m_BlockType, 1, a_BlockMeta & 0x03);
27  }
28 } ;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
Definition: BlockHandler.h:29
const BLOCKTYPE m_BlockType
Definition: BlockHandler.h:205
Handler for blocks that have 3 orientations (hay bale, log), specified by the upper 2 bits in meta.
Definition: BlockSideways.h:14
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: BlockSideways.h:23
Definition: Item.h:37
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215