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 public:
47 // virtual function thunks
48 // NOLINTBEGIN
49
50 // NOLINTEND
51 };
52
53 class WorldAccessor : public ::DespawnComponent::IWorldAccessor {
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 8, ::Actor&> mActor;
58 // NOLINTEND
59
60 public:
61 // prevent constructor by default
62 WorldAccessor& operator=(WorldAccessor const&);
63 WorldAccessor(WorldAccessor const&);
64 WorldAccessor();
65
66 public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual ::Player* fetchAnyInteractablePlayer(::Vec3 const& searchPos, float maxDist) const /*override*/;
70
71 virtual uint getChunkTickRange() const /*override*/;
72
73 virtual bool areChunksFullyLoaded(::BlockPos const& min, int r) const /*override*/;
74
75 virtual bool hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const /*override*/;
76
77 virtual ::IRandom& getChanceRandom() /*override*/;
78
79 virtual ::std::optional<int> getActorNoActionTime(::Actor const& actor) const /*override*/;
80
81 virtual void resetActorNoActionTime(::Actor& actor) /*override*/;
82 // NOLINTEND
83
84 public:
85 // virtual function thunks
86 // NOLINTBEGIN
87 MCAPI ::Player* $fetchAnyInteractablePlayer(::Vec3 const& searchPos, float maxDist) const;
88
89 MCAPI uint $getChunkTickRange() const;
90
91 MCAPI bool $areChunksFullyLoaded(::BlockPos const& min, int r) const;
92
93 MCAPI bool $hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const;
94
95 MCAPI ::IRandom& $getChanceRandom();
96
97 MCAPI ::std::optional<int> $getActorNoActionTime(::Actor const& actor) const;
98
99 MCAPI void $resetActorNoActionTime(::Actor& actor);
100
101
102 // NOLINTEND
103
104 public:
105 // vftables
106 // NOLINTBEGIN
107 MCNAPI static void** $vftable();
108 // NOLINTEND
109 };
110
111public:
112 // member functions
113 // NOLINTBEGIN
114 MCAPI bool _canDespawn(
115 ::Actor& actor,
117 ::DespawnDefinition const& definition
118 ) const;
119
120 MCAPI bool _instantRulesPrescribeDespawn(
121 ::Actor& actor,
122 ::DespawnDefinition const& definition,
123 ::DespawnComponent::IWorldAccessor const& worldAccessor
124 ) const;
125
126 MCAPI bool _softRulesPrescribeDespawn(
127 ::Actor& actor,
128 ::DespawnDefinition const& definition,
130 ) const;
131
132 MCAPI void onDespawn(::Actor& actor);
133
134 MCAPI void tick(::Actor& actor);
135 // NOLINTEND
136};
Definition Actor.h:125
Definition BlockPos.h:21
Definition ChunkPos.h:11
Definition DespawnComponent.h:25
Definition DespawnComponent.h:53
static MCAPI void ** $vftable()
Definition DespawnComponent.h:16
Definition DespawnDefinition.h:15
Definition IRandom.h:10
Definition Player.h:137
Definition Vec3.h:10