LeviLamina
Loading...
Searching...
No Matches
DespawnComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class Actor;
8class BlockPos;
9class ChunkPos;
11class IRandom;
12class Player;
13class Vec3;
14// clang-format on
15
17public:
18 // DespawnComponent inner types declare
19 // clang-format off
20 class IWorldAccessor;
21 class WorldAccessor;
22 // clang-format on
23
24 // DespawnComponent inner types define
26 public:
27 // virtual functions
28 // NOLINTBEGIN
29 virtual ~IWorldAccessor() = default;
30
31 virtual ::Player* fetchAnyInteractablePlayer(::Vec3 const& searchPos, float maxDist) const = 0;
32
33 virtual uint getChunkTickRange() const = 0;
34
35 virtual bool areChunksFullyLoaded(::BlockPos const& min, int r) const = 0;
36
37 virtual bool hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const = 0;
38
39 virtual ::IRandom& getChanceRandom() = 0;
40
41 virtual ::std::optional<int> getActorNoActionTime(::Actor const& actor) const = 0;
42
43 virtual void resetActorNoActionTime(::Actor& actor) = 0;
44 // NOLINTEND
45 };
46
47 class WorldAccessor : public ::DespawnComponent::IWorldAccessor {
48 public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 8, ::Actor&> mActor;
52 // NOLINTEND
53
54 public:
55 // prevent constructor by default
56 WorldAccessor& operator=(WorldAccessor const&);
57 WorldAccessor(WorldAccessor const&);
58 WorldAccessor();
59
60 public:
61 // virtual functions
62 // NOLINTBEGIN
63 virtual ::Player* fetchAnyInteractablePlayer(::Vec3 const& searchPos, float maxDist) const /*override*/;
64
65 virtual uint getChunkTickRange() const /*override*/;
66
67 virtual bool areChunksFullyLoaded(::BlockPos const& min, int r) const /*override*/;
68
69 virtual bool hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const /*override*/;
70
71 virtual ::IRandom& getChanceRandom() /*override*/;
72
73 virtual ::std::optional<int> getActorNoActionTime(::Actor const& actor) const /*override*/;
74
75 virtual void resetActorNoActionTime(::Actor& actor) /*override*/;
76 // NOLINTEND
77
78 public:
79 // virtual function thunks
80 // NOLINTBEGIN
81 MCAPI ::Player* $fetchAnyInteractablePlayer(::Vec3 const& searchPos, float maxDist) const;
82
83 MCAPI uint $getChunkTickRange() const;
84
85 MCAPI bool $areChunksFullyLoaded(::BlockPos const& min, int r) const;
86
87 MCAPI bool $hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const;
88
89 MCAPI ::IRandom& $getChanceRandom();
90
91 MCAPI ::std::optional<int> $getActorNoActionTime(::Actor const& actor) const;
92
93 MCAPI void $resetActorNoActionTime(::Actor& actor);
94
95
96 // NOLINTEND
97
98 public:
99 // vftables
100 // NOLINTBEGIN
101 MCNAPI static void** $vftable();
102 // NOLINTEND
103 };
104
105public:
106 // member functions
107 // NOLINTBEGIN
108 MCAPI bool _canDespawn(
109 ::Actor& actor,
111 ::DespawnDefinition const& definition
112 ) const;
113
114 MCAPI bool _instantRulesPrescribeDespawn(
115 ::Actor& actor,
116 ::DespawnDefinition const& definition,
117 ::DespawnComponent::IWorldAccessor const& worldAccessor
118 ) const;
119
120 MCAPI bool _softRulesPrescribeDespawn(
121 ::Actor& actor,
122 ::DespawnDefinition const& definition,
124 ) const;
125
126 MCAPI void onDespawn(::Actor& actor);
127
128 MCAPI void tick(::Actor& actor);
129 // NOLINTEND
130};
Definition Actor.h:113
Definition BlockPos.h:17
Definition ChunkPos.h:13
Definition DespawnComponent.h:25
Definition DespawnComponent.h:47
static MCAPI void ** $vftable()
Definition DespawnComponent.h:16
Definition DespawnDefinition.h:15
Definition IRandom.h:10
Definition Player.h:129
Definition Vec3.h:10