Cuberite
A lightweight, fast and extensible game server for Minecraft
ItemComparator.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ItemHandler.h"
5 #include "../Blocks/BlockRedstoneRepeater.h"
6 
7 
8 
9 
10 
12  public cItemHandler
13 {
14 public:
15  cItemComparatorHandler(int a_ItemType) :
16  cItemHandler(a_ItemType)
17  {
18  }
19 
20  virtual bool IsPlaceable(void) override
21  {
22  return true;
23  }
24 
26  cWorld * a_World, cPlayer * a_Player,
27  int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
28  int a_CursorX, int a_CursorY, int a_CursorZ,
29  BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
30  ) override
31  {
32  a_BlockType = E_BLOCK_INACTIVE_COMPARATOR;
34  return true;
35  }
36 } ;
37 
38 
39 
40 
static NIBBLETYPE RepeaterRotationToMetaData(double a_Rotation)
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
Definition: Player.h:27
virtual bool IsPlaceable(void) override
Blocks simply get placed.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
cItemComparatorHandler(int a_ItemType)
Definition: World.h:65
double GetYaw(void) const
Definition: Entity.h:209
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
Definition: Defines.h:29
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 ...