mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 10:12:26 +00:00
chore: format files touched by refactor/remove-vec3-tls
This commit is contained in:
@@ -137,14 +137,13 @@ Vec3 LiquidTile::getFlow(LevelSource* level, int x, int y, int z) {
|
||||
if (t >= 0) {
|
||||
int dir = t - (mid - 8);
|
||||
flow = flow.add((xt - x) * dir, (yt - y) * dir,
|
||||
(zt - z) * dir);
|
||||
(zt - z) * dir);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (t >= 0) {
|
||||
int dir = t - mid;
|
||||
flow =
|
||||
flow.add((xt - x) * dir, (yt - y) * dir, (zt - z) * dir);
|
||||
flow = flow.add((xt - x) * dir, (yt - y) * dir, (zt - z) * dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,10 +307,8 @@ void LiquidTile::animateTick(Level* level, int x, int y, int z,
|
||||
double LiquidTile::getSlopeAngle(LevelSource* level, int x, int y, int z,
|
||||
Material* m) {
|
||||
Vec3 flow;
|
||||
if (m == Material::water)
|
||||
flow = Tile::water->getFlow(level, x, y, z);
|
||||
if (m == Material::lava)
|
||||
flow = Tile::lava->getFlow(level, x, y, z);
|
||||
if (m == Material::water) flow = Tile::water->getFlow(level, x, y, z);
|
||||
if (m == Material::lava) flow = Tile::lava->getFlow(level, x, y, z);
|
||||
if (flow.x == 0 && flow.z == 0) return -1000;
|
||||
return atan2(flow.z, flow.x) - PI / 2;
|
||||
}
|
||||
|
||||
@@ -794,12 +794,12 @@ void LivingEntity::breakItem(std::shared_ptr<ItemInstance> itemInstance) {
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
Vec3 d = Vec3((random->nextFloat() - 0.5) * 0.1,
|
||||
Math::random() * 0.1 + 0.1, 0);
|
||||
Math::random() * 0.1 + 0.1, 0);
|
||||
d.xRot(-xRot * PI / 180);
|
||||
d.yRot(-yRot * PI / 180);
|
||||
|
||||
Vec3 p = Vec3((random->nextFloat() - 0.5) * 0.3,
|
||||
-random->nextFloat() * 0.6 - 0.3, 0.6);
|
||||
-random->nextFloat() * 0.6 - 0.3, 0.6);
|
||||
p.xRot(-xRot * PI / 180);
|
||||
p.yRot(-yRot * PI / 180);
|
||||
p = p.add(x, y + getHeadHeight(), z);
|
||||
|
||||
@@ -1024,8 +1024,7 @@ void EnderDragon::findNewTarget() {
|
||||
|
||||
if (getSynchedAction() == e_EnderdragonAction_Takeoff) {
|
||||
Vec3 v = getHeadLookVector(1);
|
||||
targetNodeIndex =
|
||||
findClosestNode(-v.x * 40, 105.0, -v.z * 40);
|
||||
targetNodeIndex = findClosestNode(-v.x * 40, 105.0, -v.z * 40);
|
||||
} else {
|
||||
if (random->nextInt(8) == 0) {
|
||||
m_holdingPatternClockwise = !m_holdingPatternClockwise;
|
||||
|
||||
@@ -551,7 +551,8 @@ void Minecart::applyNaturalSlowdown() {
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<Vec3> Minecart::getPosOffs(double x, double y, double z, double offs) {
|
||||
std::optional<Vec3> Minecart::getPosOffs(double x, double y, double z,
|
||||
double offs) {
|
||||
int xt = Mth::floor(x);
|
||||
int yt = Mth::floor(y);
|
||||
int zt = Mth::floor(z);
|
||||
|
||||
@@ -78,7 +78,8 @@ protected:
|
||||
virtual void moveAlongTrack(int xt, int yt, int zt, double maxSpeed,
|
||||
double slideSpeed, int tile, int data);
|
||||
virtual void applyNaturalSlowdown();
|
||||
virtual std::optional<Vec3> getPosOffs(double x, double y, double z, double offs);
|
||||
virtual std::optional<Vec3> getPosOffs(double x, double y, double z,
|
||||
double offs);
|
||||
virtual std::optional<Vec3> getPos(double x, double y, double z);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -84,9 +84,8 @@ std::shared_ptr<ItemInstance> BoatItem::use(
|
||||
bool hitEntity = false;
|
||||
float overlap = 1;
|
||||
std::vector<std::shared_ptr<Entity> >* objects = level->getEntities(
|
||||
player,
|
||||
player->bb->expand(b.x * (range), b.y * (range), b.z * (range))
|
||||
->grow(overlap, overlap, overlap));
|
||||
player, player->bb->expand(b.x * (range), b.y * (range), b.z * (range))
|
||||
->grow(overlap, overlap, overlap));
|
||||
// for (int i = 0; i < objects.size(); i++) {
|
||||
for (AUTO_VAR(it, objects->begin()); it != objects->end(); ++it) {
|
||||
std::shared_ptr<Entity> e = *it; // objects.get(i);
|
||||
|
||||
@@ -26,9 +26,7 @@ Explosion::Explosion(Level* level, std::shared_ptr<Entity> source, double x,
|
||||
size = 16;
|
||||
}
|
||||
|
||||
Explosion::~Explosion() {
|
||||
delete random;
|
||||
}
|
||||
Explosion::~Explosion() { delete random; }
|
||||
|
||||
void Explosion::explode() {
|
||||
float oR = r;
|
||||
|
||||
@@ -528,13 +528,13 @@ void Player::spawnEatParticles(std::shared_ptr<ItemInstance> useItem,
|
||||
if (useItem->getUseAnimation() == UseAnim_eat) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
Vec3 d{(random->nextFloat() - 0.5) * 0.1,
|
||||
Math::random() * 0.1 + 0.1, 0};
|
||||
Math::random() * 0.1 + 0.1, 0};
|
||||
|
||||
d.xRot(-xRot * PI / 180);
|
||||
d.yRot(-yRot * PI / 180);
|
||||
|
||||
Vec3 p{(random->nextFloat() - 0.5) * 0.3,
|
||||
-random->nextFloat() * 0.6 - 0.3, 0.6};
|
||||
-random->nextFloat() * 0.6 - 0.3, 0.6};
|
||||
p.xRot(-xRot * PI / 180);
|
||||
p.yRot(-yRot * PI / 180);
|
||||
p = p.add(x, y + getHeadHeight(), z);
|
||||
|
||||
@@ -44,4 +44,4 @@ private:
|
||||
public:
|
||||
void load(CompoundTag* tag);
|
||||
void save(CompoundTag* tag);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user