diff options
author | andrew <xdotftw@gmail.com> | 2014-03-25 19:59:33 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-25 19:59:33 +0100 |
commit | 2e28c09770a937b253680d7f62b9b2f4c8f4670c (patch) | |
tree | 60bc0e8da8940df8acd338692ac8a95327b2347e /src/Entities/EnderCrystal.cpp | |
parent | Plugins can set flying speed. (diff) | |
download | cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar.gz cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar.bz2 cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar.lz cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar.xz cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.tar.zst cuberite-2e28c09770a937b253680d7f62b9b2f4c8f4670c.zip |
Diffstat (limited to 'src/Entities/EnderCrystal.cpp')
-rw-r--r-- | src/Entities/EnderCrystal.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/Entities/EnderCrystal.cpp b/src/Entities/EnderCrystal.cpp new file mode 100644 index 000000000..a640b236c --- /dev/null +++ b/src/Entities/EnderCrystal.cpp @@ -0,0 +1,56 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + +#include "EnderCrystal.h" +#include "ClientHandle.h" +#include "Player.h" +#include "../Chunk.h" + + + + + +cEnderCrystal::cEnderCrystal(double a_X, double a_Y, double a_Z) + : cEntity(etEnderCrystal, a_X, a_Y, a_Z, 1.0, 1.0) +{ + SetMaxHealth(5); +} + + + + + +void cEnderCrystal::SpawnOn(cClientHandle & a_ClientHandle) +{ + a_ClientHandle.SendSpawnObject(*this, 51, 0, (Byte)GetYaw(), (Byte)GetPitch()); +} + + + + + +void cEnderCrystal::Tick(float a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + + a_Chunk.SetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT, E_BLOCK_FIRE, 0); + + // No further processing (physics e.t.c.) is needed +} + + + + + +void cEnderCrystal::KilledBy(cEntity * a_Killer) +{ + super::KilledBy(a_Killer); + + m_World->DoExplosionAt(6.0, GetPosX(), GetPosY(), GetPosZ(), true, esEnderCrystal, this); + + Destroy(); +} + + + + |