Cuberite
A lightweight, fast and extensible game server for Minecraft
ItemLeaves.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 {
14 
15 public:
16  cItemLeavesHandler(int a_ItemType)
17  : cItemHandler(a_ItemType)
18  {
19  }
20 
22  cWorld * a_World, cPlayer * a_Player,
23  int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
24  int a_CursorX, int a_CursorY, int a_CursorZ,
25  BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
26  ) override
27  {
29  a_World, a_Player,
30  a_BlockX, a_BlockY, a_BlockZ, a_BlockFace,
31  a_CursorX, a_CursorY, a_CursorZ,
32  a_BlockType, a_BlockMeta
33  );
34  a_BlockMeta = a_BlockMeta | 0x4; // 0x4 bit set means this is a player-placed leaves block, not to be decayed
35  return res;
36  }
37 } ;
38 
39 
40 
41 
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
Definition: Player.h:27
cItemLeavesHandler(int a_ItemType)
Definition: ItemLeaves.h:16
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
Definition: World.h:65
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)
Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlayerPlace() is ...
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
Definition: Defines.h:29
cItemHandler super
Definition: ItemLeaves.h:13
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: ItemLeaves.h:21