mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
noPhysics field now works
This commit is contained in:
parent
f8c9349510
commit
e9b2f724c6
|
|
@ -87,7 +87,7 @@ void ArmorStand::defineSynchedData()
|
||||||
|
|
||||||
ArmorStand::~ArmorStand() {}
|
ArmorStand::~ArmorStand() {}
|
||||||
|
|
||||||
|
bool ArmorStand::hasPhysics() const { return (entityData->getByte(DATA_CLIENT_FLAGS) & FLAG_NO_GRAVITY) == 0; }
|
||||||
bool ArmorStand::isBaby() const { return (entityData->getByte(DATA_CLIENT_FLAGS) & FLAG_SMALL) != 0; }
|
bool ArmorStand::isBaby() const { return (entityData->getByte(DATA_CLIENT_FLAGS) & FLAG_SMALL) != 0; }
|
||||||
bool ArmorStand::isSmall() const { return isBaby(); }
|
bool ArmorStand::isSmall() const { return isBaby(); }
|
||||||
bool ArmorStand::isShowArms() const { return (entityData->getByte(DATA_CLIENT_FLAGS) & FLAG_SHOW_ARMS) != 0; }
|
bool ArmorStand::isShowArms() const { return (entityData->getByte(DATA_CLIENT_FLAGS) & FLAG_SHOW_ARMS) != 0; }
|
||||||
|
|
@ -196,17 +196,17 @@ void ArmorStand::updateInvisibilityStatus()
|
||||||
void ArmorStand::tick()
|
void ArmorStand::tick()
|
||||||
{
|
{
|
||||||
float lockedRot = this->yRot;
|
float lockedRot = this->yRot;
|
||||||
LivingEntity::tick();
|
if (hasPhysics()) LivingEntity::tick();
|
||||||
if (onGround)
|
if (onGround)
|
||||||
{
|
{
|
||||||
BlockPos pos((int)floorf(x), (int)floorf(y) - 1, (int)floorf(z));
|
BlockPos pos((int)floorf(x), (int)floorf(y) - 1, (int)floorf(z));
|
||||||
int blockId = level->getTile(pos.getX(), pos.getY(), pos.getZ());
|
int blockId = level->getTile(pos.getX(), pos.getY(), pos.getZ());
|
||||||
if (blockId == Tile::topSnow->id)
|
if (blockId == Tile::topSnow->id)
|
||||||
{
|
{
|
||||||
int meta = level->getData(pos.getX(), pos.getY(), pos.getZ());
|
int meta = level->getData(pos.getX(), pos.getY(), pos.getZ());
|
||||||
float snowHeight = ((meta & 0x7) + 1) * 0.125f;
|
float snowHeight = ((meta & 0x7) + 1) * 0.125f;
|
||||||
moveTo(x, floorf(y) + snowHeight, z, yRot, xRot);
|
moveTo(x, floorf(y) + snowHeight, z, yRot, xRot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->yRot = lockedRot;
|
this->yRot = lockedRot;
|
||||||
this->yRotO = lockedRot;
|
this->yRotO = lockedRot;
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ public:
|
||||||
explicit ArmorStand(Level* level);
|
explicit ArmorStand(Level* level);
|
||||||
virtual ~ArmorStand();
|
virtual ~ArmorStand();
|
||||||
|
|
||||||
|
bool hasPhysics() const;
|
||||||
bool isBaby() const;
|
bool isBaby() const;
|
||||||
bool isSmall() const;
|
bool isSmall() const;
|
||||||
bool isShowArms() const;
|
bool isShowArms() const;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue