LeviLamina
Loading...
Searching...
No Matches
IBlockSource.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/WeakRef.h"
7#include "mc/deps/vanilla_components/IConstBlockSource.h"
8#include "mc/world/actor/ActorType.h"
9#include "mc/world/level/BlockChangedEventTarget.h"
10#include "mc/world/level/ShapeType.h"
11
12// auto generated forward declare list
13// clang-format off
14class AABB;
15class Actor;
16class Block;
18class BlockPos;
19class BlockSource;
21class ChunkPos;
22class ChunkSource;
23class Dimension;
24class EntityContext;
25class GameEvent;
26class HitResult;
27class ILevel;
28class ItemStackBase;
29class Level;
30class LevelChunk;
31class LevelSeed64;
32class Vec3;
34struct ClipParameters;
35// clang-format on
36
38public:
39 // IBlockSource inner types define
40 using Listener = ::BlockSourceListener;
41
42 using ListenerVector = ::std::vector<::BlockSourceListener*>;
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 virtual ::std::vector<::AABB>& fetchAABBs(::AABB const&, bool) = 0;
48
49 virtual ::std::vector<::AABB>&
50 fetchCollisionShapes(::AABB const&, bool, ::std::optional<::EntityContext const>, ::std::vector<::AABB>*) = 0;
51
52 virtual ::WeakRef<::BlockSource> getWeakRef() = 0;
53
54 virtual void addListener(::BlockSourceListener&) = 0;
55
56 virtual void removeListener(::BlockSourceListener&) = 0;
57
58 virtual ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(::Actor const*, ::AABB const&, bool, bool) = 0;
59
60 virtual ::gsl::span<::gsl::not_null<::Actor*>>
61 fetchEntities(::ActorType, ::AABB const&, ::Actor const*, ::std::function<bool(::Actor*)>) = 0;
62
63 virtual bool
64 setBlock(::BlockPos const&, ::Block const&, int, ::ActorBlockSyncMessage const*, ::BlockChangeContext const&) = 0;
65
66 virtual bool setExtraBlock(::BlockPos const&, ::Block const&, int) = 0;
67
68 virtual bool removeBlock(::BlockPos const&, ::BlockChangeContext const&) = 0;
69
70 virtual short getMinHeight() const = 0;
71
72 virtual short getMaxHeight() const = 0;
73
74 virtual ::Dimension& getDimension() const = 0;
75
76 virtual ::Dimension& getDimension() = 0;
77
78 virtual ::Dimension const& getDimensionConst() const = 0;
79
80 virtual ::LevelChunk* getChunkAt(::BlockPos const&) const = 0;
81
82 virtual ::LevelChunk* getChunk(int, int) const = 0;
83
84 virtual ::LevelChunk* getChunk(::ChunkPos const&) const = 0;
85
86 virtual ::Level& getLevel() = 0;
87
88 virtual ::ILevel& getILevel() const = 0;
89
90 virtual ::LevelSeed64 getLevelSeed64() const = 0;
91
92 virtual short getAboveTopSolidBlock(int, int, bool, bool) const = 0;
93
94 virtual short getAboveTopSolidBlock(::BlockPos const&, bool, bool, bool) const = 0;
95
96 virtual short getHeight(::std::function<bool(::Block const&)> const&, ::BlockPos const&) const = 0;
97
98 virtual short getHeight(::std::function<bool(::Block const&)> const&, int, int) const = 0;
99
100 virtual ::HitResult clip(
101 ::Vec3 const&,
102 ::Vec3 const&,
103 bool,
104 ::ShapeType,
105 int,
106 bool,
107 bool,
108 ::Actor*,
109 ::std::function<bool(::BlockSource const&, ::Block const&, bool)> const&,
110 bool
111 ) const = 0;
112
113 virtual ::HitResult clip(::ClipParameters const&) const = 0;
114
115 virtual ::ChunkSource& getChunkSource() = 0;
116
117 virtual bool isSolidBlockingBlock(::BlockPos const&) const = 0;
118
119 virtual bool isSolidBlockingBlock(int, int, int) const = 0;
120
121 virtual bool areChunksFullyLoaded(::BlockPos const&, int) const = 0;
122
123 virtual bool mayPlace(::Block const&, ::BlockPos const&, uchar, ::Actor*, bool, ::Vec3) = 0;
124
125 virtual bool canDoBlockDrops() const = 0;
126
127 virtual bool canDoContainedItemDrops() const = 0;
128
129 virtual bool isInstaticking(::BlockPos const&) const = 0;
130
131 virtual bool checkBlockDestroyPermissions(::Actor&, ::BlockPos const&, ::ItemStackBase const&, bool) = 0;
132
133 virtual bool checkBlockPermissions(::Actor&, ::BlockPos const&, uchar, ::ItemStackBase const&, bool) = 0;
134
135 virtual void postGameEvent(::Actor*, ::GameEvent const&, ::BlockPos const&, ::Block const*) = 0;
136
137 virtual void fireBlockChanged(
138 ::BlockPos const&,
139 uint,
140 ::Block const&,
141 ::Block const&,
142 int,
143 ::BlockChangedEventTarget,
145 ::Actor*
146 ) = 0;
147
148 virtual void blockEvent(::BlockPos const&, int, int) = 0;
149
150 virtual ~IBlockSource() /*override*/ = default;
151 // NOLINTEND
152
153public:
154 // virtual function thunks
155 // NOLINTBEGIN
156
157 // NOLINTEND
158};
Definition AABB.h:18
Definition Actor.h:105
Definition BlockChangeContext.h:10
Definition BlockPos.h:19
Definition BlockSourceListener.h:18
Definition BlockSource.h:68
Definition Block.h:43
Definition ChunkPos.h:11
Definition ChunkSource.h:37
Definition Dimension.h:85
Definition EntityContext.h:16
Definition GameEvent.h:8
Definition HitResult.h:17
Definition IBlockSource.h:37
Definition IConstBlockSource.h:25
Definition ILevel.h:214
Definition ItemStackBase.h:44
Definition LevelChunk.h:79
Definition LevelSeed64.h:5
Definition Level.h:249
Definition Vec3.h:10
Definition ActorBlockSyncMessage.h:8
Definition ClipParameters.h:16