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 IRandom;
13class Mob;
14class Random;
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 ::IRandom& random,
25 ::Mob& mob,
26 int xzDist,
27 int yDist,
28 int yOffset,
29 ::Vec3 const* dir,
30 bool canFly,
31 bool canSwim,
32 ::IntRange const& hoverHeight,
33 int tries,
34 ::SolidityCheckType blockTest
35 );
36
37 MCAPI static ::std::optional<::Vec3> generateRandomSpawnPos(
38 ::BlockSource& region,
39 ::Random& random,
40 ::Vec3 const& inPos,
41 int numAttempts,
42 int xzDist,
43 int yDist,
44 ::Vec3* dir
45 );
46
47 MCAPI static ::std::optional<::Vec3>
48 getPos(::Mob& mob, int xzDist, int yDist, int tries, ::SolidityCheckType blockTest);
49
50 MCAPI static ::std::optional<::Vec3>
51 getPosAvoid(::Mob& mob, int xzDist, int yDist, ::Vec3 const& avoidPos, ::SolidityCheckType blockTest, int tries);
52
53 MCAPI static ::std::optional<::Vec3> getPosInDirection(
54 ::Mob& mob,
55 int xzDist,
56 int yDist,
57 int yOffset,
58 bool canFly,
59 bool canSwim,
60 ::Vec3* direction,
61 ::IntRange const& hoverHeight,
62 int tries,
63 ::SolidityCheckType blockTest
64 );
65
66 MCAPI static ::std::optional<::Vec3> getPosTowards(::Mob& mob, int xzDist, int yDist, ::Vec3 const& towardsPos);
67
68 MCAPI static ::std::optional<::Vec3>
69 getPosTowards(::Random& random, ::Mob& mob, int xzDist, int yDist, ::Vec3 const& towardsPos);
70
71 MCAPI static ::std::optional<::Vec3>
72 getSpawnPos(::BlockSource& region, ::Random& random, ::Vec3 const& inPos, int xzDist, int yDist, int numAttempts);
73
74 MCAPI static bool snapToGround(
75 ::BlockPos& inOutPos,
76 ::Mob& mob,
77 int yDist,
78 ::IntRange const& hoverHeight,
79 ::SolidityCheckType blockTest
80 );
81
82 MCAPI static bool spawnSnapToGround(::BlockSource& region, ::BlockPos& inOutPos, float startingY, int yDist);
83 // NOLINTEND
84};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition IRandom.h:10
Definition Mob.h:57
Definition RandomPos.h:19
Definition Random.h:10
Definition Vec3.h:10
Definition IntRange.h:11