summaryrefslogtreecommitdiffstats
path: root/src/Entities/ProjectileEntity.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-29 14:59:24 +0200
committerGitHub <noreply@github.com>2019-09-29 14:59:24 +0200
commit365cbc6e1cea96741e26c9ce912b003f8fd2c62c (patch)
treef23682c47928597791c53f3a300b03494ffde417 /src/Entities/ProjectileEntity.h
parentCactus can now grow and will be dropped if there is no place to grow. (diff)
downloadcuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.gz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.bz2
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.lz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.xz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.zst
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/ProjectileEntity.h38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h
index 36f53c841..c74fdd6af 100644
--- a/src/Entities/ProjectileEntity.h
+++ b/src/Entities/ProjectileEntity.h
@@ -20,9 +20,15 @@
class cProjectileEntity :
public cEntity
{
- typedef cEntity super;
+ // tolua_end
+
+ using super = cEntity;
+
+ // tolua_begin
+
public:
+
/** The kind of the projectile. The numbers correspond to the network type ID used for spawning them in the protocol. */
enum eKind
{
@@ -43,10 +49,32 @@ public:
CLASS_PROTODEF(cProjectileEntity)
- cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, double a_Width, double a_Height);
- cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Vector3d & a_Pos, const Vector3d & a_Speed, double a_Width, double a_Height);
-
- static std::unique_ptr<cProjectileEntity> Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem * a_Item, const Vector3d * a_Speed = nullptr);
+ cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, double a_Width, double a_Height);
+ cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed, double a_Width, double a_Height);
+
+ /** Creates a new instance of the specified projectile entity.
+ a_Item is the item from which the projectile originated (such as firework or arrow). */
+ static std::unique_ptr<cProjectileEntity> Create(
+ eKind a_Kind,
+ cEntity * a_Creator,
+ Vector3d a_Pos,
+ const cItem * a_Item,
+ const Vector3d * a_Speed = nullptr
+ );
+
+ /** OBSOLETE, use the Vector3d-based overload instead.
+ Creates a new instance of the specified projectile entity.
+ a_Item is the item from which the projectile originated (such as firework or arrow). */
+ static std::unique_ptr<cProjectileEntity> Create(
+ eKind a_Kind,
+ cEntity * a_Creator,
+ double a_PosX, double a_PosY, double a_PosZ,
+ const cItem * a_Item,
+ const Vector3d * a_Speed = nullptr
+ )
+ {
+ return Create(a_Kind, a_Creator, {a_PosX, a_PosY, a_PosZ}, a_Item, a_Speed);
+ }
/** Called by the physics blocktracer when the entity hits a solid block, the hit position and the face hit (BLOCK_FACE_) is given */
virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace);