Files
GabsPuNs-MinecraftConsoles/Minecraft.World/MultiEntityMobPart.cpp
GabsPuNs f79ca9e411 Support for TU24 has been extended.
Since the TU25 update still requires a lot of work and the TU24 version does not yet include all the features, I have decided to continue working with the TU24 version for now.

Merge latest changes from Minecraft Consoles:
* Added support for Big-Endian DLCs.
* Fix redstone tick persistence on chunk unload.
* Fix pistons permanently breaking server-wide on dedicated servers.
* Fix Ender Dragon damage and End Poem crash.
* Disable font mipmapping to get rid of artifacts on signs.

Other:
* Music Fixes.
* Added missing sounds (Caves, Horse Eat, Sheep Shear, Water Swim, Thorns)
* Remove duplicated sounds.
* Added High Quality ver of "The End Dragon Alive" music.
* Fix Mobs sounds volume.
* Added Old Swing Animation Option.
* Added Graphics Mode (Potato, Fast, Fancy and Extra)
* Fix a small memory leak with signs.
* Fixed Pig Zombies attacking creative players.
2026-03-28 06:27:19 -04:00

46 lines
1.2 KiB
C++

#include "stdafx.h"
#include "BossMob.h"
#include "MultiEntityMob.h"
#include "MultiEntityMobPart.h"
MultiEntityMobPart::MultiEntityMobPart(shared_ptr<MultiEntityMob>parentMob, const wstring &id, float w, float h) : Entity(parentMob->getLevel()), parentMob( parentMob ), id( id )
{
// 4J Stu - This function call had to be moved here from the Entity ctor to ensure that
// the derived version of the function is called
this->defineSynchedData();
setSize(w, h);
}
void MultiEntityMobPart::defineSynchedData()
{
}
void MultiEntityMobPart::readAdditionalSaveData(CompoundTag *tag)
{
}
void MultiEntityMobPart::addAdditonalSaveData(CompoundTag *tag)
{
}
bool MultiEntityMobPart::isPickable()
{
return true;
}
bool MultiEntityMobPart::hurt(DamageSource *source, float damage)
{
if (auto parent = parentMob.lock()) {
return parent->hurt(dynamic_pointer_cast<MultiEntityMobPart>(shared_from_this()), source, damage);
}
// If the parent doesn't exist, safely ignore the damage to avoid the Crashing
return false;
}
bool MultiEntityMobPart::is(shared_ptr<Entity> other)
{
return shared_from_this() == other || parentMob.lock() == dynamic_pointer_cast<MultiEntityMob>(other);
}