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