LeviLamina
Loading...
Searching...
No Matches
RandomPos.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/actor/ai/util/SolidityCheckType.h"
7
8// auto generated forward declare list
9// clang-format off
10class BlockPos;
11class BlockSource;
12class Mob;
13class Random;
14class Randomize;
15class Vec3;
16struct IntRange;
17// clang-format on
18
19class RandomPos {
20public:
21 // static functions
22 // NOLINTBEGIN
23 MCAPI static ::std::optional<::Vec3> generateRandomPos(
24 ::Mob& mob,
25 int xzDist,
26 int yDist,
27 ::Vec3 const* dir,
28 bool canFly,
29 bool canSwim,
30 int tries,
31 ::SolidityCheckType blockTest
32 );
33
34 MCAPI static ::std::optional<::Vec3> generateRandomPos(
35 ::Randomize& randomize,
36 ::Mob& mob,
37 int xzDist,
38 int yDist,
39 int yOffset,
40 ::Vec3 const* dir,
41 bool canFly,
42 bool canSwim,
43 ::IntRange const& hoverHeight,
44 int tries,
45 ::SolidityCheckType blockTest
46 );
47
48 MCAPI static ::std::optional<::Vec3> generateRandomSpawnPos(
49 ::BlockSource& region,
50 ::Random& random,
51 ::Vec3 const& inPos,
52 int xzDist,
53 int yDist,
54 int numAttempts,
55 ::Vec3* dir
56 );
57
58 MCAPI static ::std::optional<::Vec3>
59 getPos(::Mob& mob, int xzDist, int yDist, int tries, ::SolidityCheckType blockTest);
60
61 MCAPI static ::std::optional<::Vec3>
62 getPosAvoid(::Mob& mob, int xzDist, int yDist, ::Vec3 const& avoidPos, ::SolidityCheckType blockTest, int tries);
63
64 MCAPI static ::std::optional<::Vec3> getPosTowards(::Mob& mob, int xzDist, int yDist, ::Vec3 const& towardsPos);
65
66 MCAPI static ::std::optional<::Vec3>
67 getPosTowards(::Random& random, ::Mob& mob, int towardsPos, int xzDist, ::Vec3 const& yDist);
68
69 MCAPI static bool snapToGround(
70 ::BlockPos& inOutPos,
71 ::Mob& mob,
72 int yDist,
73 ::IntRange const& hoverHeight,
74 ::SolidityCheckType blockTest
75 );
76
77 MCAPI static bool spawnSnapToGround(::BlockSource& region, ::BlockPos& inOutPos, float startingY, int yDist);
78 // NOLINTEND
79};
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition Mob.h:47
Definition RandomPos.h:19
Definition Random.h:16
Definition Randomize.h:13
Definition Vec3.h:10
Definition IntRange.h:11