first commit

This commit is contained in:
murdle
2026-03-01 02:38:58 +02:00
commit 19250b9db4
19111 changed files with 4358159 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#include "stdafx.h"
#include "net.minecraft.world.entity.ai.control.h"
#include "net.minecraft.world.entity.ai.navigation.h"
#include "net.minecraft.world.entity.ai.util.h"
#include "net.minecraft.world.entity.h"
#include "net.minecraft.world.phys.h"
#include "PanicGoal.h"
PanicGoal::PanicGoal(PathfinderMob *mob, float speed)
{
this->mob = mob;
this->speed = speed;
setRequiredControlFlags(Control::MoveControlFlag);
}
bool PanicGoal::canUse()
{
if (mob->getLastHurtByMob() == NULL) return false;
Vec3 *pos = RandomPos::getPos(dynamic_pointer_cast<PathfinderMob>(mob->shared_from_this()), 5, 4);
if (pos == NULL) return false;
posX = pos->x;
posY = pos->y;
posZ = pos->z;
return true;
}
void PanicGoal::start()
{
mob->getNavigation()->moveTo(posX, posY, posZ, speed);
}
bool PanicGoal::canContinueToUse()
{
return !mob->getNavigation()->isDone();
}