diff options
author | Mattes D <github@xoft.cz> | 2015-03-05 13:57:19 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-05 13:57:19 +0100 |
commit | 78120db487e775bc294d8222581b6791456cc380 (patch) | |
tree | f142764f84560a9761bf7d70efbdf4f6d28d0421 /src/Entities/Entity.cpp | |
parent | Lua API: Fixed md5 and sha1 hex formatting. (diff) | |
parent | Added OnTeleportEntity hook for plugins. (diff) | |
download | cuberite-78120db487e775bc294d8222581b6791456cc380.tar cuberite-78120db487e775bc294d8222581b6791456cc380.tar.gz cuberite-78120db487e775bc294d8222581b6791456cc380.tar.bz2 cuberite-78120db487e775bc294d8222581b6791456cc380.tar.lz cuberite-78120db487e775bc294d8222581b6791456cc380.tar.xz cuberite-78120db487e775bc294d8222581b6791456cc380.tar.zst cuberite-78120db487e775bc294d8222581b6791456cc380.zip |
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r-- | src/Entities/Entity.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 07cfb97b2..1bc4690e1 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1632,8 +1632,12 @@ void cEntity::TeleportToEntity(cEntity & a_Entity) void cEntity::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) { - SetPosition(a_PosX, a_PosY, a_PosZ); - m_World->BroadcastTeleportEntity(*this); + // ask the plugins to allow teleport to the new position. + if (!cRoot::Get()->GetPluginManager()->CallHookEntityTeleport(*this, m_LastPos, Vector3d(a_PosX, a_PosY, a_PosZ))) + { + SetPosition(a_PosX, a_PosY, a_PosZ); + m_World->BroadcastTeleportEntity(*this); + } } |