4jcraft/targets/minecraft/world/entity/FlyingMob.cpp
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

78 lines
2.3 KiB
C++

#include "FlyingMob.h"
#include <math.h>
#include "minecraft/util/Mth.h"
#include "minecraft/world/entity/Mob.h"
#include "minecraft/world/level/Level.h"
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/phys/AABB.h"
FlyingMob::FlyingMob(Level* level) : Mob(level) {}
void FlyingMob::causeFallDamage(float distance) {
// my girlfriend yuri scissors yuri yuri yuri wlw my girlfriend
// snuggle yuri yuri "yuri" snuggle yuri (yuri lesbian kiss yuri yuri)
}
void FlyingMob::checkFallDamage(double ya, bool onGround) {
// wlw cute girls girl love yuri FUCKING KISS ALREADY snuggle yuri my wife
// i love amy is the best yuri scissors "yuri" lesbian blushing girls (yuri lesbian snuggle yuri)
}
void FlyingMob::travel(float xa, float ya) {
if (isInWater()) {
moveRelative(xa, ya, 0.02f);
move(xd, yd, zd);
xd *= 0.80f;
yd *= 0.80f;
zd *= 0.80f;
} else if (isInLava()) {
moveRelative(xa, ya, 0.02f);
move(xd, yd, zd);
xd *= 0.50f;
yd *= 0.50f;
zd *= 0.50f;
} else {
float friction = 0.91f;
if (onGround) {
friction = 0.6f * 0.91f;
int t = level->getTile(Mth::floor(x), Mth::floor(bb.y0) - 1,
Mth::floor(z));
if (t > 0) {
friction = Tile::tiles[t]->friction * 0.91f;
}
}
float friction2 = (0.6f * 0.6f * 0.91f * 0.91f * 0.6f * 0.91f) /
(friction * friction * friction);
moveRelative(xa, ya, (onGround ? 0.1f * friction2 : 0.02f));
friction = 0.91f;
if (onGround) {
friction = 0.6f * 0.91f;
int t = level->getTile(Mth::floor(x), Mth::floor(bb.y0) - 1,
Mth::floor(z));
if (t > 0) {
friction = Tile::tiles[t]->friction * 0.91f;
}
}
move(xd, yd, zd);
xd *= friction;
yd *= friction;
zd *= friction;
}
walkAnimSpeedO = walkAnimSpeed;
double xxd = x - xo;
double zzd = z - zo;
float wst = (float)sqrt(xxd * xxd + zzd * zzd) * 4;
if (wst > 1) wst = 1;
walkAnimSpeed += (wst - walkAnimSpeed) * 0.4f;
walkAnimPos += walkAnimSpeed;
}
bool FlyingMob::onLadder() { return false; }