chore: format files touched by refactor/remove-vec3-tls

This commit is contained in:
orng 2026-03-26 14:13:45 -05:00
parent 87e8078a65
commit 20982f11c1
16 changed files with 44 additions and 50 deletions

View file

@ -155,7 +155,8 @@ void ConsoleSchematicFile::load(DataInputStream* dis) {
// app.DebugPrintf(1,"Loaded entity type %d at
// (%f,%f,%f)\n",(int)type,x,y,z);
#endif
m_entities.push_back(std::pair<Vec3, CompoundTag*>(Vec3(x, y, z), (CompoundTag*)eTag->copy()));
m_entities.push_back(std::pair<Vec3, CompoundTag*>(
Vec3(x, y, z), (CompoundTag*)eTag->copy()));
}
}
delete tag;

View file

@ -28,8 +28,7 @@ int AreaHint::tick() {
if ((m_displayState == e_Tutorial_State_Any ||
m_tutorial->getCurrentState() == m_displayState) &&
m_hintNeeded &&
area->contains(&player_pos) == contains) {
m_hintNeeded && area->contains(&player_pos) == contains) {
if (m_completeState == e_Tutorial_State_None) {
m_hintNeeded = false;
} else if (m_tutorial->isStateCompleted(m_completeState)) {

View file

@ -87,8 +87,7 @@ void ChangeStateConstraint::tick(int iPad) {
}
Vec3 ipad_player = minecraft->localplayers[iPad]->getPos(1);
if (!m_bHasChanged && inASourceState &&
movementArea->contains(&ipad_player) ==
contains) {
movementArea->contains(&ipad_player) == contains) {
m_bHasChanged = true;
m_changedFromState = m_tutorial->getCurrentState();
m_tutorial->changeTutorialState(m_targetState);
@ -126,8 +125,7 @@ void ChangeStateConstraint::tick(int iPad) {
}
}
} else if (m_bHasChanged &&
movementArea->contains(
&ipad_player) != contains) {
movementArea->contains(&ipad_player) != contains) {
m_bHasChanged = false;
m_tutorial->changeTutorialState(m_changedFromState);

View file

@ -316,8 +316,8 @@ bool Tile_SPU::isSolidRender(bool isServerLevel) { return true; }
// double yo = level->random->nextFloat() * s + (1 - s) * 0.5;
// double zo = level->random->nextFloat() * s + (1 - s) * 0.5;
// std::shared_ptr<ItemEntity> item = std::shared_ptr<ItemEntity>( new
// ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); item->throwTime =
// 10; level->addEntity(item);
// ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); item->throwTime
// = 10; level->addEntity(item);
// }
//
// // Brought forward for TU7
@ -328,8 +328,8 @@ bool Tile_SPU::isSolidRender(bool isServerLevel) { return true; }
// while (amount > 0)
// {
// int newCount =
// ExperienceOrb::getExperienceValue(amount); amount -= newCount;
// level->addEntity(std::shared_ptr<ExperienceOrb>( new
// ExperienceOrb::getExperienceValue(amount); amount -=
// newCount; level->addEntity(std::shared_ptr<ExperienceOrb>( new
// ExperienceOrb(level, x + .5, y + .5, z + .5, newCount)));
// }
// }
@ -366,14 +366,14 @@ bool Tile_SPU::isSolidRender(bool isServerLevel) { return true; }
// Vec3 *closest = NULL;
//
// if (containsX(xh0) && (closest == NULL || a->distanceTo(xh0) <
// a->distanceTo(closest))) closest = xh0; if (containsX(xh1) && (closest ==
// NULL || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1; if
// (containsY(yh0) && (closest == NULL || a->distanceTo(yh0) <
// a->distanceTo(closest))) closest = yh0; if (containsY(yh1) && (closest ==
// NULL || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1; if
// (containsZ(zh0) && (closest == NULL || a->distanceTo(zh0) <
// a->distanceTo(closest))) closest = zh0; if (containsZ(zh1) && (closest ==
// NULL || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
// a->distanceTo(closest))) closest = xh0; if (containsX(xh1) && (closest
// == NULL || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1;
// if (containsY(yh0) && (closest == NULL || a->distanceTo(yh0) <
// a->distanceTo(closest))) closest = yh0; if (containsY(yh1) && (closest
// == NULL || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1;
// if (containsZ(zh0) && (closest == NULL || a->distanceTo(zh0) <
// a->distanceTo(closest))) closest = zh0; if (containsZ(zh1) && (closest
// == NULL || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
//
// LeaveCriticalSection(&m_csShape);
//
@ -525,7 +525,8 @@ void Tile_SPU::updateDefaultShape() {}
// player->awardStat(Stats::blocksMined[id], 1);
// }
// player->awardStat(Stats::totalBlocksMined, 1); // 4J : WESTY : Added
// for other award. player->causeFoodExhaustion(FoodConstants::EXHAUSTION_MINE);
// for other award.
// player->causeFoodExhaustion(FoodConstants::EXHAUSTION_MINE);
//
// if( id == Tile_SPU::treeTrunk_Id )
// player->awardStat(Achievements::mineWood);

View file

@ -550,7 +550,8 @@ void LocalPlayer::closeContainer() {
void LocalPlayer::openTextEdit(std::shared_ptr<TileEntity> tileEntity) {
#ifdef ENABLE_JAVA_GUIS
if (tileEntity->GetType() == eTYPE_SIGNTILEENTITY) {
minecraft->setScreen(new TextEditScreen(std::dynamic_pointer_cast<SignTileEntity>(tileEntity)));
minecraft->setScreen(new TextEditScreen(
std::dynamic_pointer_cast<SignTileEntity>(tileEntity)));
bool success = true;
}
#else
@ -782,8 +783,7 @@ void LocalPlayer::awardStat(Stat* stat, byteArray param) {
// storage device, so needs a primary player, and the player may not
// have been a primary player when they first 'got' the award so let the
// award manager figure it out
if (!minecraft->stats[m_iPad]->hasTaken(ach))
{
if (!minecraft->stats[m_iPad]->hasTaken(ach)) {
// 4J-PB - Don't display the java popup
#ifdef ENABLE_JAVA_GUIS
minecraft->achievementPopup->popup(ach);

View file

@ -27,7 +27,7 @@ public:
static TilePos* getCameraTilePos(std::shared_ptr<LivingEntity> player,
double alpha);
static Vec3 getCameraPos(std::shared_ptr<LivingEntity> player,
double alpha);
double alpha);
static int getBlockAt(Level* level, std::shared_ptr<LivingEntity> player,
float alpha);
};

View file

@ -60,11 +60,11 @@ void FishingHookRenderer::render(std::shared_ptr<Entity> _hook, double x,
Vec3 vv(-0.5, 0.03, 0.8);
vv.xRot(-(hook->owner->xRotO +
(hook->owner->xRot - hook->owner->xRotO) * a) *
PI / 180);
(hook->owner->xRot - hook->owner->xRotO) * a) *
PI / 180);
vv.yRot(-(hook->owner->yRotO +
(hook->owner->yRot - hook->owner->yRotO) * a) *
PI / 180);
(hook->owner->yRot - hook->owner->yRotO) * a) *
PI / 180);
vv.yRot(swing2 * 0.5f);
vv.xRot(-swing2 * 0.7f);

View file

@ -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;
}

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -44,4 +44,4 @@ private:
public:
void load(CompoundTag* tag);
void save(CompoundTag* tag);
};
};