Cuberite
A lightweight, fast and extensible game server for Minecraft
ItemSapling.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ItemHandler.h"
5 
6 
7 
8 
9 
11 {
13 
14 public:
15  cItemSaplingHandler(int a_ItemType)
16  : cItemHandler(a_ItemType)
17  {
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  // Only the lowest 3 bits are important
35  a_BlockMeta = a_BlockMeta & 0x7;
36  return res;
37  }
38 } ;
39 
40 
41 
42 
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
Definition: Player.h:27
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
cItemSaplingHandler(int a_ItemType)
Definition: ItemSapling.h:15
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) override
Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlayerPlace() is ...
Definition: ItemSapling.h:21
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: ItemSapling.h:12