Cuberite
A lightweight, fast and extensible game server for Minecraft
DispenserEntity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "DropSpenserEntity.h"
5 
6 
7 
8 
9 
10 // tolua_begin
12  public cDropSpenserEntity
13 {
14  // tolua_end
15 
17 
18 public: // tolua_export
19 
21 
22 
23  cDispenserEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
24 
25  // tolua_begin
26 
31  Vector3i a_BlockPos,
32  cProjectileEntity::eKind a_Kind,
33  const Vector3d & a_Speed,
34  const cItem * a_Item = nullptr
35  );
36 
42  int a_BlockX, int a_BlockY, int a_BlockZ,
43  cProjectileEntity::eKind a_Kind,
44  const Vector3d & a_Speed,
45  const cItem * a_Item = nullptr
46  )
47  {
48  return SpawnProjectileFromDispenser({a_BlockX, a_BlockY, a_BlockZ}, a_Kind, a_Speed, a_Item);
49  }
50 
52  static Vector3d GetShootVector(NIBBLETYPE a_BlockMeta);
53 
54  // tolua_end
55 
56 private:
57  // cDropSpenser overrides:
58  virtual void DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum) override;
59 
61  bool ScoopUpLiquid(int a_SlotNum, short a_ResultingBucketItemType);
62 
65  bool EmptyLiquidBucket(BLOCKTYPE a_BlockInFront, int a_SlotNum);
66 } ; // tolua_export
67 
68 
69 
bool EmptyLiquidBucket(BLOCKTYPE a_BlockInFront, int a_SlotNum)
If the a_BlockInFront can be washed away by liquid and the empty bucket can fit, does the m_Contents ...
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
Definition: Chunk.h:49
bool ScoopUpLiquid(int a_SlotNum, short a_ResultingBucketItemType)
If such a bucket can fit, adds it to m_Contents and returns true.
Definition: World.h:65
UInt32 SpawnProjectileFromDispenser(Vector3i a_BlockPos, cProjectileEntity::eKind a_Kind, const Vector3d &a_Speed, const cItem *a_Item=nullptr)
Spawns a projectile of the given kind in front of the dispenser with the specified speed...
#define BLOCKENTITY_PROTODEF(classname)
Place this macro in the declaration of each cBlockEntity descendant.
Definition: BlockEntity.h:9
virtual void DropSpenseFromSlot(cChunk &a_Chunk, int a_SlotNum) override
Override this function to provide the specific behavior for item dropspensing (drop / shoot / pour / ...
unsigned int UInt32
Definition: Globals.h:113
Definition: Item.h:36
static Vector3d GetShootVector(NIBBLETYPE a_BlockMeta)
Returns a unit vector in the cardinal direction of where the dispenser with the specified meta would ...
cDropSpenserEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)