LeviLamina
Loading...
Searching...
No Matches
BlockSource.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/AutomaticID.h"
7#include "mc/deps/core/utility/optional_ref.h"
8#include "mc/deps/game_refs/EnableGetWeakRef.h"
9#include "mc/deps/game_refs/WeakRef.h"
10#include "mc/world/actor/ActorType.h"
11#include "mc/world/level/BlockChangedEventTarget.h"
12#include "mc/world/level/BlockDataFetchResult.h"
13#include "mc/world/level/IBlockSource.h"
14#include "mc/world/level/ShapeType.h"
15#include "mc/world/level/TickingQueueType.h"
16#include "mc/world/level/block/BlockSupportType.h"
17#include "mc/world/level/block/actor/BlockActorType.h"
18#include "mc/world/level/material/MaterialType.h"
19
20// auto generated forward declare list
21// clang-format off
22class AABB;
23class Actor;
24class Biome;
25class Block;
26class BlockActor;
27class BlockDescriptor;
28class BlockLegacy;
29class BlockPos;
32class BlockVolume;
33class BoundingBox;
34class ChunkPos;
35class ChunkSource;
36class Dimension;
37class EntityContext;
38class GameEvent;
40class HitResult;
42class ILevel;
43class ItemStackBase;
44class Level;
45class LevelChunk;
46class LevelSeed64;
47class Material;
48class SubChunkPos;
49class Vec3;
50class WeakEntityRef;
53struct Bounds;
54struct Brightness;
55struct BrightnessPair;
56struct ClipParameters;
57struct Tick;
58namespace BlockSourceVisitor { struct CollisionShape; }
59// clang-format on
60
61class Mob;
62class Container;
63class CompoundTag;
64
66 public ::EnableGetWeakRef<::BlockSource>,
67 public ::std::enable_shared_from_this<::BlockSource> {
68public:
69 LLNDAPI std::vector<Actor*> getEntities(
70 AABB const& range,
71 float extendDistance = 2.0f,
72 ActorType actorType = ActorType::TypeMask,
73 bool ignoreType = false
74 ) const;
75
76 LLNDAPI optional_ref<Container> tryGetContainer(BlockPos const& pos);
77
78 LLAPI optional_ref<Actor> spawnActor(CompoundTag const&);
79
80public:
81 // member variables
82 // NOLINTBEGIN
83 ::ll::TypedStorage<4, 4, ::std::thread::id const> mOwnerThreadID;
84 ::ll::TypedStorage<1, 1, bool const> mAllowUnpopulatedChunks;
85 ::ll::TypedStorage<1, 1, bool const> mPublicSource;
86 ::ll::TypedStorage<1, 1, bool> mCheckValidity;
87 ::ll::TypedStorage<8, 8, ::Level&> mLevel;
88 ::ll::TypedStorage<8, 8, ::ChunkSource&> mChunkSource;
89 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
90 ::ll::TypedStorage<2, 2, short const> mMaxHeight;
91 ::ll::TypedStorage<2, 2, short const> mMinHeight;
92 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDataFetchResult<::Block>>> mTempBlockFetchResult;
93 ::ll::TypedStorage<1, 1, bool> mAllowTickingChanges;
94 ::ll::TypedStorage<4, 12, ::BlockPos> mPlaceChunkPos;
95 ::ll::TypedStorage<8, 24, ::std::vector<::BlockSourceListener*>> mListeners;
96 ::ll::TypedStorage<8, 8, ::Tick> mCurrentTickForValidityChecks;
97 ::ll::TypedStorage<1, 1, bool> mIsPersistantBlockSource;
98 ::ll::TypedStorage<8, 8, ::ChunkPos> mLastChunkPos;
99 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::LevelChunk>> mLastChunkWeakPtr;
100 ::ll::TypedStorage<8, 8, ::LevelChunk*> mLastChunkDirectPtr;
101 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mRandomTickQueue;
102 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mTickQueue;
103 ::ll::TypedStorage<1, 2, ::BrightnessPair const> mDefaultBrightness;
104 ::ll::TypedStorage<8, 24, ::std::vector<::Actor*>> mTempEntityList;
105 ::ll::TypedStorage<8, 24, ::std::vector<::BlockActor*>> mTempBlockEntityList;
106 ::ll::TypedStorage<8, 24, ::std::vector<::AABB>> mTempCubeList;
107 // NOLINTEND
108
109public:
110 // virtual functions
111 // NOLINTBEGIN
112 // vIndex: 0
113 virtual ~BlockSource() /*override*/;
114
115 // vIndex: 26
116 virtual ::WeakRef<::BlockSource> getWeakRef() /*override*/;
117
118 // vIndex: 40
119 virtual ::Level& getLevel() /*override*/;
120
121 // vIndex: 35
122 virtual ::Dimension& getDimension() const /*override*/;
123
124 // vIndex: 34
125 virtual ::Dimension& getDimension() /*override*/;
126
127 // vIndex: 36
128 virtual ::Dimension const& getDimensionConst() const /*override*/;
129
130 // vIndex: 18
131 virtual ::DimensionType getDimensionId() const /*override*/;
132
133 // vIndex: 56
134 virtual bool isInstaticking(::BlockPos const& pos) const /*override*/;
135
136 // vIndex: 27
137 virtual void addListener(::BlockSourceListener& l) /*override*/;
138
139 // vIndex: 28
140 virtual void removeListener(::BlockSourceListener& l) /*override*/;
141
142 // vIndex: 39
143 virtual ::LevelChunk* getChunk(int x, int z) const /*override*/;
144
145 // vIndex: 38
146 virtual ::LevelChunk* getChunk(::ChunkPos const& pos) const /*override*/;
147
148 // vIndex: 37
149 virtual ::LevelChunk* getChunkAt(::BlockPos const& pos) const /*override*/;
150
151 // vIndex: 43
152 virtual short
153 getAboveTopSolidBlock(::BlockPos const& pos, bool includeWater, bool includeLeaves, bool iteratePastInitialBlocking)
154 const /*override*/;
155
156 // vIndex: 44
157 virtual short getAboveTopSolidBlock(int x, int z, bool includeWater, bool includeLeaves) const /*override*/;
158
159 // vIndex: 46
160 virtual short getHeight(::std::function<bool(::Block const&)> const& type, ::BlockPos const& pos) const
161 /*override*/;
162
163 // vIndex: 45
164 virtual short getHeight(::std::function<bool(::Block const&)> const& type, int x, int z) const /*override*/;
165
166 // vIndex: 13
167 virtual ::Material const& getMaterial(::BlockPos const& pos) const /*override*/;
168
169 // vIndex: 12
170 virtual ::Material const& getMaterial(int x, int y, int z) const /*override*/;
171
172 // vIndex: 33
173 virtual short getMaxHeight() const /*override*/;
174
175 // vIndex: 32
176 virtual short getMinHeight() const /*override*/;
177
178 // vIndex: 14
179 virtual bool hasBorderBlock(::BlockPos const pos) const /*override*/;
180
181 // vIndex: 23
182 virtual float getBrightness(::BlockPos const& pos) const /*override*/;
183
184 // vIndex: 6
185 virtual ::Block const& getLiquidBlock(::BlockPos const& p) const /*override*/;
186
187 // vIndex: 5
188 virtual ::Block const& getExtraBlock(::BlockPos const& p) const /*override*/;
189
190 // vIndex: 53
191 virtual bool mayPlace(
192 ::Block const& block,
193 ::BlockPos const& pos,
194 uchar face,
195 ::Actor* placer,
196 bool ignoreEntities,
197 ::Vec3 clickPos
198 ) /*override*/;
199
200 // vIndex: 7
201 virtual bool hasBlock(::BlockPos const& pos) const /*override*/;
202
203 // vIndex: 54
204 virtual bool canDoBlockDrops() const /*override*/;
205
206 // vIndex: 55
207 virtual bool canDoContainedItemDrops() const /*override*/;
208
209 // vIndex: 17
210 virtual bool hasChunksAt(::Bounds const& bounds, bool ignoreClientChunk) const /*override*/;
211
212 // vIndex: 16
213 virtual bool hasChunksAt(::BlockPos const& pos, int r, bool ignoreClientChunk) const /*override*/;
214
215 // vIndex: 15
216 virtual bool hasChunksAt(::AABB const& bb, bool ignoreClientChunk) const /*override*/;
217
218 // vIndex: 52
219 virtual bool areChunksFullyLoaded(::BlockPos const& pos, int r) const /*override*/;
220
221 // vIndex: 8
222 virtual bool containsAnyLiquid(::AABB const& box) const /*override*/;
223
224 // vIndex: 9
225 virtual bool containsMaterial(::AABB const& box, ::MaterialType material) const /*override*/;
226
227 // vIndex: 4
228 virtual ::BlockActor const* getBlockEntity(::BlockPos const& pos) const /*override*/;
229
230 // vIndex: 30
231 virtual ::gsl::span<::gsl::not_null<::Actor*>>
232 fetchEntities(::Actor const* except, ::AABB const& bb, bool useHitbox, bool getDisplayEntities) /*override*/;
233
234 // vIndex: 29
235 virtual ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
236 ::ActorType entityTypeId,
237 ::AABB const& bb,
238 ::Actor const* except,
239 ::std::function<bool(::Actor*)> selector
240 ) /*override*/;
241
242 // vIndex: 19
243 virtual void
244 fetchAABBs(::std::vector<::AABB>& shapes, ::AABB const& intersectTestBox, bool withUnloadedChunks) const
245 /*override*/;
246
247 // vIndex: 24
248 virtual ::std::vector<::AABB>& fetchAABBs(::AABB const& intersectTestBox, bool withUnloadedChunks) /*override*/;
249
250 // vIndex: 25
251 virtual ::std::vector<::AABB>& fetchCollisionShapes(
252 ::AABB const& intersectTestBox,
253 bool withUnloadedChunks,
254 ::std::optional<::EntityContext const> entity,
255 ::std::vector<::AABB>* tempShapes
256 ) /*override*/;
257
258 // vIndex: 20
259 virtual void fetchCollisionShapes(
260 ::std::vector<::AABB>& shapes,
261 ::AABB const& intersectTestBox,
262 bool withUnloadedChunks,
264 ::std::vector<::AABB>* tempShapes
265 ) const /*override*/;
266
267 // vIndex: 21
268 virtual void fetchCollisionShapesAndBlocks(
269 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
270 ::AABB const& intersectTestBox,
271 bool withUnloadedChunks,
273 ::std::vector<::AABB>* tempShapes
274 ) const /*override*/;
275
276 // vIndex: 22
277 virtual ::AABB getTallestCollisionShape(
278 ::AABB const& intersectTestBox,
279 float* actualSurfaceOffset,
280 bool withUnloadedChunks,
282 ) const /*override*/;
283
284 // vIndex: 48
285 virtual ::HitResult clip(
286 ::Vec3 const& A,
287 ::Vec3 const& B,
288 bool checkAgainstLiquid,
289 ::ShapeType shapeType,
290 int maxDistance,
291 bool ignoreBorderBlocks,
292 bool fullOnly,
293 ::Actor* actor,
294 ::std::function<bool(::BlockSource const&, ::Block const&, bool)> const& shouldCheckBlock
295 ) const /*override*/;
296
297 // vIndex: 47
298 virtual ::HitResult clip(::ClipParameters const& parameters) const /*override*/;
299
300 // vIndex: 10
301 virtual bool isInWall(::Vec3 const& pos) const /*override*/;
302
303 // vIndex: 11
304 virtual bool isUnderWater(::Vec3 const& pos, ::Block const& block) const /*override*/;
305
306 // vIndex: 3
307 virtual ::Block const& getBlock(int x, int y, int z) const /*override*/;
308
309 // vIndex: 2
310 virtual ::Block const& getBlock(::BlockPos const& pos) const /*override*/;
311
312 // vIndex: 1
313 virtual ::Block const& getBlock(::BlockPos const& pos, uint layer) const /*override*/;
314
315 // vIndex: 31
316 virtual bool setBlock(
317 ::BlockPos const& pos,
318 ::Block const& block,
319 int updateFlags,
320 ::ActorBlockSyncMessage const* syncMsg,
321 ::Actor* blockChangeSource
322 ) /*override*/;
323
324 // vIndex: 50
325 virtual bool isSolidBlockingBlock(int x, int y, int z) const /*override*/;
326
327 // vIndex: 51
328 virtual bool isSolidBlockingBlock(::BlockPos const& p) const /*override*/;
329
330 // vIndex: 59
331 virtual bool removeBlock(::BlockPos const& pos) /*override*/;
332
333 // vIndex: 41
334 virtual ::ILevel& getILevel() const /*override*/;
335
336 // vIndex: 42
337 virtual ::LevelSeed64 getLevelSeed64() const /*override*/;
338
339 // vIndex: 49
340 virtual ::ChunkSource& getChunkSource() /*override*/;
341
342 // vIndex: 58
343 virtual bool checkBlockPermissions(
344 ::Actor& entity,
345 ::BlockPos const& blockPos,
346 uchar face,
347 ::ItemStackBase const& item,
348 bool generateParticle
349 ) /*override*/;
350
351 // vIndex: 60
352 virtual void postGameEvent(
353 ::Actor* source,
354 ::GameEvent const& gameEvent,
355 ::BlockPos const& originPos,
356 ::Block const* affectedBlock
357 ) /*override*/;
358
359 // vIndex: 57
360 virtual void updateCheckForValidityState(bool checkForValidity) /*override*/;
361 // NOLINTEND
362
363public:
364 // member functions
365 // NOLINTBEGIN
366 MCAPI BlockSource(
367 ::Level& level,
368 ::Dimension& dimension,
369 ::ChunkSource& source,
370 bool publicSource,
371 bool allowUnpopulatedChunks,
372 bool allowClientTickingChanges
373 );
374
375 MCAPI void _addToTickingQueue(
376 ::BlockPos const& pos,
377 ::Block const& block,
378 int tickDelay,
379 int priorityOffset,
380 ::TickingQueueType queueType,
381 bool skipOverrides
382 );
383
384 MCAPI void _blockChanged(
385 ::BlockPos const& pos,
386 uint layer,
387 ::Block const& block,
388 ::Block const& previousBlock,
389 int updateFlags,
390 ::ActorBlockSyncMessage const* syncMsg,
391 ::Actor* blockChangeSource
392 );
393
394 MCAPI void _fetchBorderBlockCollisions(
395 ::std::vector<::AABB>& shapes,
396 ::AABB const& intersectTestBox,
398 bool
399 ) const;
400
401 MCAPI void _fetchEntityHelper(
402 ::WeakEntityRef entityRef,
403 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
404 ::AABB const& bb,
405 bool useHitbox
406 );
407
408 MCAPI bool _getBlockPermissions(::BlockPos const& pos, bool currentState);
409
410 MCAPI ::Brightness
411 _getRawBrightness(::BlockPos const& pos, ::Brightness skyDarken, bool propagate, bool accountForNight) const;
412
413 MCAPI void _removeFromTickingQueue(::BlockPos const& pos, ::Block const& block, ::TickingQueueType queueType);
414
415 MCAPI void _updateTallestCollisionShapeWithBorderBlockCollisions(
416 ::AABB const& intersectTestBox,
418 ::AABB& result,
419 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
420 float& currentDistanceSqr
421 ) const;
422
423 MCAPI void addToRandomTickingQueuePercentChance(
424 ::BlockPos const& pos,
425 ::Block const& block,
426 float percentChance,
427 int priorityOffset,
428 bool skipOverrides
429 );
430
431 MCAPI void addToTickingQueue(
432 ::BlockPos const& pos,
433 ::Block const& block,
434 int tickDelay,
435 int skipOverrides,
436 bool priorityOffset
437 );
438
439 MCAPI bool areChunksFullyLoaded(::BlockPos const& min, ::BlockPos const& max) const;
440
441 MCAPI void blockEvent(::BlockPos const& pos, int b0, int b1);
442
443 MCAPI bool canProvideSupport(::BlockPos const& pos, uchar face, ::BlockSupportType type) const;
444
445 MCAPI bool canSeeSky(::BlockPos const& pos) const;
446
447 MCAPI bool canSeeSkyFromBelowWater(::BlockPos const& pos);
448
449 MCAPI bool checkBlockDestroyPermissions(
450 ::Actor& entity,
451 ::BlockPos const& pos,
452 ::ItemStackBase const& item,
453 bool generateParticle
454 );
455
456 MCAPI bool containsAnyBlockInBox(::BoundingBox const& box, ::std::function<bool(::Block const&)> predicate);
457
458 MCAPI bool containsAnyBlockOfType(::BlockPos const& min, ::BlockPos const& max, ::Block const& type) const;
459
460 MCAPI bool containsAnySolidBlocking(::AABB const& box) const;
461
462 MCAPI uint64 countBlocksOfType(
463 ::BlockDescriptor const& blockDescriptor,
464 ::BlockPos const& min,
465 ::BlockPos const& max,
466 uint64 maxCount
467 ) const;
468
469 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
470 fetchActors(::ActorDefinitionIdentifier const& actorId, ::AABB const& bb);
471
472 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType bb, ::AABB const& blockActorTypeId) const;
473
474 MCAPI ::std::vector<::BlockActor*> const& fetchBlockEntities(::AABB const& bb);
475
476 MCAPI bool fetchBlocks(::BlockPos const& origin, ::BlockVolume& volume) const;
477
478 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const>
479 fetchBlocksInBox(::BoundingBox const& box, ::std::function<bool(::Block const&)> predicate);
480
481 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const>
482 fetchBlocksInBoxSorted(::BoundingBox const& box, ::std::function<bool(::Block const&)> predicate);
483
484 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const> fetchBlocksInCylinder(
485 ::BlockPos const& centerPos,
486 uint radius,
487 uint height,
488 ::std::function<bool(::Block const&)> predicate
489 );
490
491 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const> fetchBlocksInCylinderSorted(
492 ::BlockPos const& centerPos,
493 uint radius,
494 uint height,
495 ::std::function<bool(::Block const&)> predicate
496 );
497
498 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
499 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
500 ::AABB const& bb,
501 bool useHitbox,
502 bool getDisplayEntities
503 );
504
505 MCAPI ::std::vector<::Actor*> const& fetchEntities2(::ActorType type, ::AABB const& aabb, bool ignoreTargetType);
506
507 MCAPI ::Actor* fetchNearestEntityOfType(::Actor const* except, ::AABB const& bb, ::ActorType entityTypeId);
508
509 MCAPI bool findNextTopSolidBlockUnder(::BlockPos& pos);
510
511 MCAPI void fireBlockChanged(
512 ::BlockPos const& pos,
513 uint layer,
514 ::Block const& block,
515 ::Block const& oldBlock,
516 int flags,
517 ::BlockChangedEventTarget eventTarget,
518 ::ActorBlockSyncMessage const* syncMsg,
519 ::Actor* source
520 );
521
522 MCAPI void fireBlockEntityChanged(::BlockActor& te);
523
524 MCAPI ::Biome const& getBiome(::BlockPos const& pos) const;
525
526 MCAPI ::BlockActor* getBlockEntity(::BlockPos const&);
527
528 MCAPI ::BrightnessPair getBrightnessPair(::BlockPos const& pos) const;
529
530 MCAPI float getSeenPercent(::Vec3 const& center, ::AABB const& bb);
531
532 MCAPI void getTallestCollisionShapeFromUnloadedChunksAABBs(
533 ::AABB const& intersectTestBox,
534 ::AABB& tallestCollisionShape,
535 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
536 float& currentDistanceSqr
537 ) const;
538
539 MCAPI bool hasChunksAt(::BlockPos const& min, ::BlockPos const& max, bool ignoreClientChunk) const;
540
541 MCAPI ::std::pair<bool, ::std::optional<::SubChunkPos>>
542 hasSubChunksAt(::BlockPos const& min, ::BlockPos const& max) const;
543
544 MCAPI bool hasTickInCurrentTick(::BlockPos const& pos, ::TickingQueueType queueType) const;
545
546 MCAPI bool hasTickInPendingTicks(::BlockPos const& pos, ::TickingQueueType queueType) const;
547
548 MCAPI bool hasTickInPendingTicks(::BlockPos const& pos, ::Block const& block, ::TickingQueueType queueType) const;
549
550 MCAPI bool
551 hasTickInPendingTicks(::BlockPos const& pos, ::BlockLegacy const& block, ::TickingQueueType queueType) const;
552
553 MCAPI bool hasUntickedNeighborChunk(::ChunkPos const& pos, int chunkRadius) const;
554
555 MCAPI bool isEmptyBlock(int x, int y, int z);
556
557 MCAPI bool isNearUnloadedChunks(::ChunkPos const& pos) const;
558
559 MCAPI bool isTouchingMaterial(::BlockPos const& pos, ::MaterialType type) const;
560
561 MCAPI bool isUnobstructedByEntities(::AABB const& aabb, ::Actor const* ignoreEntity);
562
563 MCAPI bool isWithinHeightLimits(int y) const;
564
565 MCAPI void neighborChanged(::BlockPos const& neighPos, ::BlockPos const& myPos);
566
567 MCAPI void
568 postGameEvent(::Actor* source, ::GameEvent const& gameEvent, ::Vec3 const& originPos, ::Block const* affectedBlock);
569
570 MCAPI bool removeBlock(int x, int y, int z);
571
572 MCAPI bool setBlock(
573 ::BlockPos const& pos,
574 ::Block const& block,
575 int updateFlags,
576 ::std::shared_ptr<::BlockActor> blockEntity,
577 ::ActorBlockSyncMessage const* syncMsg,
578 ::Actor* blockChangeSource
579 );
580
581 MCAPI bool setBlock(int x, int y, int z, ::Block const& block, int updateFlags, ::Actor* blockChangeSource);
582
583 MCAPI void setBorderBlock(::BlockPos const& pos, bool val);
584
585 MCAPI bool setExtraBlock(::BlockPos const& p, ::Block const& block, int updateFlags);
586
587 MCAPI bool setExtraBlockSimple(::BlockPos const& pos, ::Block const& block);
588
589 MCAPI void updateNeighborsAt(::BlockPos const& pos);
590 // NOLINTEND
591
592public:
593 // static functions
594 // NOLINTBEGIN
595 MCAPI static bool containsAnyLiquid(::IConstBlockSource const& region, ::AABB const& box);
596
597 MCAPI static bool containsMaterial(::IConstBlockSource const& region, ::AABB const& box, ::MaterialType material);
598 // NOLINTEND
599
600public:
601 // constructor thunks
602 // NOLINTBEGIN
603 MCAPI void* $ctor(
604 ::Level& level,
605 ::Dimension& dimension,
606 ::ChunkSource& source,
607 bool publicSource,
608 bool allowUnpopulatedChunks,
609 bool allowClientTickingChanges
610 );
611 // NOLINTEND
612
613public:
614 // destructor thunk
615 // NOLINTBEGIN
616 MCAPI void $dtor();
617 // NOLINTEND
618
619public:
620 // virtual function thunks
621 // NOLINTBEGIN
622 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
623
624 MCFOLD ::Level& $getLevel();
625
626 MCFOLD ::Dimension& $getDimension() const;
627
628 MCFOLD ::Dimension& $getDimension();
629
630 MCFOLD ::Dimension const& $getDimensionConst() const;
631
632 MCAPI ::DimensionType $getDimensionId() const;
633
634 MCAPI bool $isInstaticking(::BlockPos const& pos) const;
635
636 MCAPI void $addListener(::BlockSourceListener& l);
637
638 MCAPI void $removeListener(::BlockSourceListener& l);
639
640 MCAPI ::LevelChunk* $getChunk(int x, int z) const;
641
642 MCAPI ::LevelChunk* $getChunk(::ChunkPos const& pos) const;
643
644 MCAPI ::LevelChunk* $getChunkAt(::BlockPos const& pos) const;
645
646 MCAPI short $getAboveTopSolidBlock(
647 ::BlockPos const& pos,
648 bool includeWater,
649 bool includeLeaves,
650 bool iteratePastInitialBlocking
651 ) const;
652
653 MCAPI short $getAboveTopSolidBlock(int x, int z, bool includeWater, bool includeLeaves) const;
654
655 MCAPI short $getHeight(::std::function<bool(::Block const&)> const& type, ::BlockPos const& pos) const;
656
657 MCAPI short $getHeight(::std::function<bool(::Block const&)> const& type, int x, int z) const;
658
659 MCAPI ::Material const& $getMaterial(::BlockPos const& pos) const;
660
661 MCAPI ::Material const& $getMaterial(int x, int y, int z) const;
662
663 MCAPI short $getMaxHeight() const;
664
665 MCAPI short $getMinHeight() const;
666
667 MCAPI bool $hasBorderBlock(::BlockPos const pos) const;
668
669 MCAPI float $getBrightness(::BlockPos const& pos) const;
670
671 MCAPI ::Block const& $getLiquidBlock(::BlockPos const& p) const;
672
673 MCAPI ::Block const& $getExtraBlock(::BlockPos const& p) const;
674
675 MCAPI bool $mayPlace(
676 ::Block const& block,
677 ::BlockPos const& pos,
678 uchar face,
679 ::Actor* placer,
680 bool ignoreEntities,
681 ::Vec3 clickPos
682 );
683
684 MCAPI bool $hasBlock(::BlockPos const& pos) const;
685
686 MCAPI bool $canDoBlockDrops() const;
687
688 MCAPI bool $canDoContainedItemDrops() const;
689
690 MCAPI bool $hasChunksAt(::Bounds const& bounds, bool ignoreClientChunk) const;
691
692 MCAPI bool $hasChunksAt(::BlockPos const& pos, int r, bool ignoreClientChunk) const;
693
694 MCAPI bool $hasChunksAt(::AABB const& bb, bool ignoreClientChunk) const;
695
696 MCAPI bool $areChunksFullyLoaded(::BlockPos const& pos, int r) const;
697
698 MCAPI bool $containsAnyLiquid(::AABB const& box) const;
699
700 MCAPI bool $containsMaterial(::AABB const& box, ::MaterialType material) const;
701
702 MCFOLD ::BlockActor const* $getBlockEntity(::BlockPos const& pos) const;
703
704 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
705 $fetchEntities(::Actor const* except, ::AABB const& bb, bool useHitbox, bool getDisplayEntities);
706
707 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> $fetchEntities(
708 ::ActorType entityTypeId,
709 ::AABB const& bb,
710 ::Actor const* except,
711 ::std::function<bool(::Actor*)> selector
712 );
713
714 MCAPI void
715 $fetchAABBs(::std::vector<::AABB>& shapes, ::AABB const& intersectTestBox, bool withUnloadedChunks) const;
716
717 MCAPI ::std::vector<::AABB>& $fetchAABBs(::AABB const& intersectTestBox, bool withUnloadedChunks);
718
719 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
720 ::AABB const& intersectTestBox,
721 bool withUnloadedChunks,
722 ::std::optional<::EntityContext const> entity,
723 ::std::vector<::AABB>* tempShapes
724 );
725
726 MCAPI void $fetchCollisionShapes(
727 ::std::vector<::AABB>& shapes,
728 ::AABB const& intersectTestBox,
729 bool withUnloadedChunks,
731 ::std::vector<::AABB>* tempShapes
732 ) const;
733
734 MCAPI void $fetchCollisionShapesAndBlocks(
735 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
736 ::AABB const& intersectTestBox,
737 bool withUnloadedChunks,
739 ::std::vector<::AABB>* tempShapes
740 ) const;
741
742 MCAPI ::AABB $getTallestCollisionShape(
743 ::AABB const& intersectTestBox,
744 float* actualSurfaceOffset,
745 bool withUnloadedChunks,
747 ) const;
748
749 MCAPI ::HitResult $clip(
750 ::Vec3 const& A,
751 ::Vec3 const& B,
752 bool checkAgainstLiquid,
753 ::ShapeType shapeType,
754 int maxDistance,
755 bool ignoreBorderBlocks,
756 bool fullOnly,
757 ::Actor* actor,
758 ::std::function<bool(::BlockSource const&, ::Block const&, bool)> const& shouldCheckBlock
759 ) const;
760
761 MCAPI ::HitResult $clip(::ClipParameters const& parameters) const;
762
763 MCAPI bool $isInWall(::Vec3 const& pos) const;
764
765 MCAPI bool $isUnderWater(::Vec3 const& pos, ::Block const& block) const;
766
767 MCAPI ::Block const& $getBlock(int x, int y, int z) const;
768
769 MCAPI ::Block const& $getBlock(::BlockPos const& pos) const;
770
771 MCAPI ::Block const& $getBlock(::BlockPos const& pos, uint layer) const;
772
773 MCAPI bool $setBlock(
774 ::BlockPos const& pos,
775 ::Block const& block,
776 int updateFlags,
777 ::ActorBlockSyncMessage const* syncMsg,
778 ::Actor* blockChangeSource
779 );
780
781 MCAPI bool $isSolidBlockingBlock(int x, int y, int z) const;
782
783 MCAPI bool $isSolidBlockingBlock(::BlockPos const& p) const;
784
785 MCAPI bool $removeBlock(::BlockPos const& pos);
786
787 MCFOLD ::ILevel& $getILevel() const;
788
789 MCAPI ::LevelSeed64 $getLevelSeed64() const;
790
791 MCFOLD ::ChunkSource& $getChunkSource();
792
793 MCAPI bool $checkBlockPermissions(
794 ::Actor& entity,
795 ::BlockPos const& blockPos,
796 uchar face,
797 ::ItemStackBase const& item,
798 bool generateParticle
799 );
800
801 MCAPI void $postGameEvent(
802 ::Actor* source,
803 ::GameEvent const& gameEvent,
804 ::BlockPos const& originPos,
805 ::Block const* affectedBlock
806 );
807
808 MCAPI void $updateCheckForValidityState(bool checkForValidity);
809 // NOLINTEND
810
811public:
812 // vftables
813 // NOLINTBEGIN
814 MCAPI static void** $vftable();
815 // NOLINTEND
816};
Definition AABB.h:16
Definition Actor.h:104
Definition Biome.h:27
Definition BlockActor.h:32
Definition BlockDescriptor.h:19
Definition BlockLegacy.h:88
Definition BlockPos.h:18
Definition BlockSourceListener.h:18
Definition BlockSource.h:67
Definition BlockTickingQueue.h:24
Definition BlockVolume.h:11
Definition Block.h:36
Definition BoundingBox.h:18
Definition ChunkPos.h:11
Definition ChunkSource.h:34
Definition CompoundTag.h:13
Definition Container.h:30
Definition Dimension.h:83
Definition EnableGetWeakRef.h:6
Definition EntityContext.h:16
Definition GameEvent.h:8
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:19
Definition IBlockSource.h:35
Definition IConstBlockSource.h:24
Definition ILevel.h:203
Definition ItemStackBase.h:35
Definition LevelChunk.h:73
Definition LevelSeed64.h:5
Definition Level.h:234
Definition Material.h:8
Definition Mob.h:47
Definition SubChunkPos.h:5
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition optional_ref.h:10
Definition ActorBlockSyncMessage.h:10
Definition ActorDefinitionIdentifier.h:13
Definition Bounds.h:10
Definition BrightnessPair.h:10
Definition Brightness.h:8
Definition ClipParameters.h:16
Definition Tick.h:5