1
0

End crystal placement (#5112)

* End crystal placement

* End crystal placement - fixed error and added some comments

* Removed unused includes

* Update src/Items/ItemEndCrystal.h

Co-authored-by: Alexander Harkness <me@bearbin.net>

* End Crystal placement, early-return pattern enforcement

* End crystal Item finish?

* Small changes

Fixed a crashbug in ender crystal destruction.
According to vanilla 1.16 testing, end crystals don't place if any entity intersects the box, not just other end crystals.
Check return value of SpawnEnderCrystal.
Add header in SeeMake.
Cafe Stile Redux.

* The stylechecker relies on CMakeLists

* There is another

Co-authored-by: Alexander Harkness <me@bearbin.net>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
This commit is contained in:
Damián Imrich
2021-01-22 18:06:26 +01:00
committed by GitHub
parent 59e906ec6c
commit 4f3b699b27
4 changed files with 92 additions and 7 deletions

View File

@@ -89,13 +89,14 @@ void cEnderCrystal::KilledBy(TakeDamageInfo & a_TDI)
{
Super::KilledBy(a_TDI);
m_World->DoExplosionAt(6.0, GetPosX(), GetPosY() + (GetHeight() / 2.0), GetPosZ(), true, esEnderCrystal, this);
// Destroy first so the Explodinator doesn't find us (when iterating through entities):
Destroy();
m_World->SetBlock(POS_TOINT, E_BLOCK_FIRE, 0);
m_World->DoExplosionAt(6.0, GetPosX(), GetPosY() + (GetHeight() / 2.0), GetPosZ(), true, esEnderCrystal, this);
const auto Position = GetPosition().Floor();
if (cChunkDef::IsValidHeight(Position.y))
{
m_World->SetBlock(Position, E_BLOCK_FIRE, 0);
}
}