Update to NeoLegacy Latest

This commit is contained in:
2026-05-28 01:23:47 -04:00
parent f4390d5f0b
commit 10f9576b72
201 changed files with 12535 additions and 25235 deletions
+36
View File
@@ -26,6 +26,7 @@ void Creeper::_init()
oldSwell = 0;
maxSwell = 30;
explosionRadius = 3;
ignited = false;
}
Creeper::Creeper(Level *level) : Monster( level )
@@ -190,3 +191,38 @@ void Creeper::thunderHit(const LightningBolt *lightningBolt)
Monster::thunderHit(lightningBolt);
entityData->set(DATA_IS_POWERED, static_cast<byte>(1));
}
void Creeper::Ignite()
{
setSwellDir(1);
ignited = true;
}
bool Creeper::isIgnited()
{
return ignited;
}
bool Creeper::mobInteract(shared_ptr<Player> player)
{
shared_ptr<ItemInstance> item = player->inventory->getSelected();
if (item == nullptr || item->id != Item::flintAndSteel_Id)
return Mob::mobInteract(player);
playSound(eSoundType_FIRE_NEWIGNITE, 1, random->nextFloat() * 0.4f + 0.8f);
player->swing();
if (!level->isClientSide)
{
if (!isIgnited())
{
Ignite();
item->hurtAndBreak(1, player);
return true;
}
return Mob::mobInteract(player);
}
return true;
}