Cuberite
A lightweight, fast and extensible game server for Minecraft
SplashPotionEntity.h
Go to the documentation of this file.
1 
2 // SplashPotionEntity.h
3 
4 // Declares the cSplashPotionEntity class representing a splash potion that has been thrown
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "ProjectileEntity.h"
13 #include "EntityEffect.h"
14 #include "../World.h"
15 
16 
17 
18 class cEntity;
19 
20 
21 
22 // tolua_begin
23 
25  public cProjectileEntity
26 {
27  // tolua_end
28 
30 
31 public: // tolua_export
32 
34 
36  cEntity * a_Creator,
37  Vector3d a_Pos,
38  Vector3d a_Speed,
39  const cItem & a_Item
40  );
41 
42  // tolua_begin
44  int GetPotionColor(void) const { return m_PotionColor; }
45  const cItem & GetItem(void) const { return m_Item; }
46 
47  void SetEntityEffectType(cEntityEffect::eType a_EntityEffectType) { m_EntityEffectType = a_EntityEffectType; }
48  void SetPotionColor(int a_PotionColor) { m_PotionColor = a_PotionColor; }
49 
50  // tolua_end
51 
53  void SetEntityEffect(cEntityEffect a_EntityEffect) { m_EntityEffect = a_EntityEffect; }
54 
55 private:
56 
61 
64  void Splash(Vector3d a_HitPos);
65 
66  // cProjectileEntity overrides:
67  virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
68  virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
69 } ; // tolua_export
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
Definition: Defines.h:38
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
Definition: Entity.h:76
eType
All types of entity effects (numbers correspond to protocol / storage types)
Definition: EntityEffect.h:12
cProjectileEntity(eKind a_Kind, cEntity *a_Creator, Vector3d a_Pos, float a_Width, float a_Height)
cEntityEffect GetEntityEffect(void) const
void SetPotionColor(int a_PotionColor)
void SetEntityEffectType(cEntityEffect::eType a_EntityEffectType)
cEntityEffect::eType GetEntityEffectType(void) const
cEntityEffect m_EntityEffect
cEntityEffect::eType m_EntityEffectType
const cItem & GetItem(void) const
void Splash(Vector3d a_HitPos)
Splashes the potion, fires its particle effects and sounds.
int GetPotionColor(void) const
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos) override
Called by the physics blocktracer when the entity hits another entity.
void SetEntityEffect(cEntityEffect a_EntityEffect)
virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override
Called by the physics blocktracer when the entity hits a solid block, the hit position and the face h...
cSplashPotionEntity(cEntity *a_Creator, Vector3d a_Pos, Vector3d a_Speed, const cItem &a_Item)
Definition: Item.h:37