Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockTNT.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "BlockHandler.h"
5 
6 
7 
8 
9 
10 class cBlockTNTHandler final :
11  public cBlockHandler
12 {
14 
15 public:
16 
17  using Super::Super;
18 
19 private:
20 
21  virtual void OnCancelRightClick(
22  cChunkInterface & a_ChunkInterface,
23  cWorldInterface & a_WorldInterface,
24  cPlayer & a_Player,
25  const Vector3i a_BlockPos,
26  eBlockFace a_BlockFace
27  ) const override
28  {
29  a_WorldInterface.SendBlockTo(a_BlockPos, a_Player);
30  }
31 
32 
33 
34 
35 
36  virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
37  {
38  UNUSED(a_Meta);
39  return 4;
40  }
41 };
42 
43 
44 
45 
BlockHandler.h
cBlockTNTHandler::OnCancelRightClick
virtual void OnCancelRightClick(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace) const override
Called when a right click to this block is cancelled.
Definition: BlockTNT.h:21
cBlockHandler
Definition: BlockHandler.h:25
ColourID
Byte ColourID
Definition: Globals.h:159
cWorldInterface
Definition: WorldInterface.h:19
NIBBLETYPE
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
cBlockTNTHandler
Definition: BlockTNT.h:10
cChunkInterface
Definition: ChunkInterface.h:21
cWorldInterface::SendBlockTo
virtual void SendBlockTo(int a_BlockX, int a_BlockY, int a_BlockZ, const cPlayer &a_Player)=0
Sends the block on those coords to the player.
eBlockFace
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
Definition: Defines.h:37
cPlayer
Definition: Player.h:27
cBlockTNTHandler::GetMapBaseColourID
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: BlockTNT.h:36
UNUSED
#define UNUSED
Definition: Globals.h:72
Vector3< int >
cBlockHandler::cBlockHandler
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
Definition: BlockHandler.h:29