chore: format Minecraft.World

This commit is contained in:
Tropical
2026-03-13 17:06:56 -05:00
parent bd6284025d
commit 33d0737d1d
1511 changed files with 108661 additions and 115521 deletions

View File

@@ -2,34 +2,30 @@
#include "../../Headers/net.minecraft.world.entity.h"
#include "Sensing.h"
Sensing::Sensing(Mob *mob)
{
this->mob = mob;
Sensing::Sensing(Mob* mob) { this->mob = mob; }
void Sensing::tick() {
seen.clear();
unseen.clear();
}
void Sensing::tick()
{
seen.clear();
unseen.clear();
}
bool Sensing::canSee(std::shared_ptr<Entity> target) {
// if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true;
// if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return
// false;
for (AUTO_VAR(it, seen.begin()); it != seen.end(); ++it) {
if (target == (*it).lock()) return true;
}
for (AUTO_VAR(it, unseen.begin()); it != unseen.end(); ++it) {
if (target == (*it).lock()) return false;
}
bool Sensing::canSee(std::shared_ptr<Entity> target)
{
//if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true;
//if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return false;
for(AUTO_VAR(it, seen.begin()); it != seen.end(); ++it)
{
if(target == (*it).lock()) return true;
}
for(AUTO_VAR(it, unseen.begin()); it != unseen.end(); ++it)
{
if(target == (*it).lock()) return false;
}
//util.Timer.push("canSee");
bool canSee = mob->canSee(target);
//util.Timer.pop();
if (canSee) seen.push_back(std::weak_ptr<Entity>(target));
else unseen.push_back(std::weak_ptr<Entity>(target));
return canSee;
// util.Timer.push("canSee");
bool canSee = mob->canSee(target);
// util.Timer.pop();
if (canSee)
seen.push_back(std::weak_ptr<Entity>(target));
else
unseen.push_back(std::weak_ptr<Entity>(target));
return canSee;
}