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