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