MCPcopy Create free account
hub / github.com/cuberite/cuberite / OnHitSolidBlock

Method OnHitSolidBlock

src/Entities/ProjectileEntity.cpp:263–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261
262
263void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
264{
265 // Set the position based on what face was hit:
266 SetPosition(a_HitPos);
267 SetSpeed(0, 0, 0);
268
269 // DEBUG:
270 LOGD("Projectile %d: pos {%.02f, %.02f, %.02f}, hit solid block at face %d",
271 m_UniqueID,
272 a_HitPos.x, a_HitPos.y, a_HitPos.z,
273 a_HitFace
274 );
275
276 m_IsInGround = true;
277}
278
279
280

Callers 1

OnNextBlockMethod · 0.80

Calls 8

AddFaceDirectionFunction · 0.85
GetTickRandomNumberMethod · 0.80
SpawnMobMethod · 0.80
TakeDamageMethod · 0.80
SpawnExperienceOrbMethod · 0.80
BroadcastSoundEffectMethod · 0.45
TeleportToCoordsMethod · 0.45

Tested by

no test coverage detected