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