Cuberite
A lightweight, fast and extensible game server for Minecraft
ThrownEggEntity.h
Go to the documentation of this file.
1 
2 // ThrownEggEntity.h
3 
4 // Declares the cThrownEggEntity class representing a regular thrown egg
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "ProjectileEntity.h"
13 
14 
15 
16 
17 
18 // tolua_begin
19 
21  public cProjectileEntity
22 {
23  // tolua_end
24 
26 
27 public: // tolua_export
28 
30 
31  cThrownEggEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed);
32 
33 private:
34 
36  void TrySpawnChicken(Vector3d a_HitPos);
37 
38  // cProjectileEntity overrides:
39  virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
40  virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
41 
42 } ; // 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
cProjectileEntity(eKind a_Kind, cEntity *a_Creator, Vector3d a_Pos, float a_Width, float a_Height)
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...
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos) override
Called by the physics blocktracer when the entity hits another entity.
cThrownEggEntity(cEntity *a_Creator, Vector3d a_Pos, Vector3d a_Speed)
void TrySpawnChicken(Vector3d a_HitPos)
Randomly decides whether to spawn a chicken where the egg lands.