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