66 public ::std::enable_shared_from_this<::BlockSource> {
68 LLNDAPI std::vector<Actor*> getEntities(
70 float extendDistance = 2.0f,
71 ActorType actorType = ActorType::TypeMask,
72 bool ignoreType =
false
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;
119 virtual ::WeakRef<::BlockSource> getWeakRef() ;
122 virtual ::Level& getLevel() ;
125 virtual ::Dimension& getDimension()
const ;
128 virtual ::Dimension& getDimension() ;
131 virtual ::Dimension
const& getDimensionConst()
const ;
134 virtual ::DimensionType getDimensionId()
const ;
137 virtual bool shouldFireEvents(
::LevelChunk const& c)
const ;
140 virtual bool isInstaticking(
::BlockPos const& pos)
const ;
149 virtual ::LevelChunk* getChunk(
int x,
int z)
const ;
152 virtual ::LevelChunk* getChunk(
::ChunkPos const& pos)
const ;
155 virtual ::LevelChunk* getChunkAt(
::BlockPos const& pos)
const ;
158 virtual short getAboveTopSolidBlock(
162 bool iteratePastInitialBlocking
166 virtual short getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const ;
169 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const
173 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const ;
176 virtual ::Material
const& getMaterial(
::BlockPos const& pos)
const ;
179 virtual ::Material
const& getMaterial(
int x,
int y,
int z)
const ;
182 virtual short getMaxHeight()
const ;
185 virtual short getMinHeight()
const ;
188 virtual bool hasBorderBlock(
::BlockPos const pos)
const ;
191 virtual float getBrightness(
::BlockPos const& pos)
const ;
194 virtual bool mayPlace(
204 virtual bool canDoBlockDrops()
const ;
207 virtual bool canDoContainedItemDrops()
const ;
210 virtual bool hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const ;
213 virtual bool hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const ;
216 virtual bool hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const ;
219 virtual bool areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const ;
222 virtual bool containsAnyLiquid(
::AABB const& box)
const ;
225 virtual bool containsMaterial(
::AABB const& box, ::MaterialType material)
const ;
228 virtual void blockEvent(
::BlockPos const& pos,
int b0,
int b1) ;
231 virtual ::gsl::span<::gsl::not_null<::Actor*>>
232 fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities) ;
235 virtual ::gsl::span<::gsl::not_null<::Actor*>>
240 fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const
244 virtual ::std::vector<::AABB>& fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks) ;
247 virtual ::std::vector<::AABB>& fetchCollisionShapes(
248 ::AABB const& intersectTestBox,
249 bool withUnloadedChunks,
250 ::std::optional<::EntityContext const> entity,
251 ::std::vector<::AABB>* tempShapes
255 virtual void fetchCollisionShapes(
256 ::std::vector<::AABB>& shapes,
257 ::AABB const& intersectTestBox,
258 bool withUnloadedChunks,
260 ::std::vector<::AABB>* tempShapes
264 virtual void fetchCollisionShapesAndBlocks(
265 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
266 ::AABB const& intersectTestBox,
267 bool withUnloadedChunks,
269 ::std::vector<::AABB>* tempShapes
273 virtual ::AABB getTallestCollisionShape(
274 ::AABB const& intersectTestBox,
275 float* actualSurfaceOffset,
276 bool withUnloadedChunks,
281 virtual ::HitResult clip(
284 bool checkAgainstLiquid,
285 ::ShapeType shapeType,
287 bool ignoreBorderBlocks,
291 bool stopOnFirstLiquidHit
298 virtual bool isInWall(
::Vec3 const& pos)
const ;
304 virtual void fireBlockChanged(
310 ::BlockChangedEventTarget eventTarget,
316 virtual ::Block
const& getBlock(
::BlockPos const& pos)
const ;
319 virtual ::Block
const& getBlock(
::BlockPos const& pos, uint layer)
const ;
322 virtual ::BlockActor
const* getBlockEntity(
::BlockPos const& pos)
const ;
325 virtual ::Block
const& getExtraBlock(
::BlockPos const& pos)
const ;
328 virtual ::Block
const& getLiquidBlock(
::BlockPos const& pos)
const ;
331 virtual bool hasBlock(
::BlockPos const& pos)
const ;
334 virtual bool setBlock(
343 virtual bool setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags) ;
349 virtual bool isSolidBlockingBlock(
int x,
int y,
int z)
const ;
352 virtual bool isSolidBlockingBlock(
::BlockPos const& p)
const ;
355 virtual ::ILevel& getILevel()
const ;
358 virtual ::LevelSeed64 getLevelSeed64()
const ;
361 virtual ::ChunkSource& getChunkSource() ;
364 virtual bool checkBlockPermissions(
369 bool generateParticle
373 virtual float getVisualLiquidHeight(
::Vec3 const& pos)
const ;
376 virtual void postGameEvent(
392 bool allowUnpopulatedChunks,
393 bool allowClientTickingChanges
396 MCAPI
void _addToTickingQueue(
401 ::TickingQueueType queueType,
405 MCAPI
void _blockChanged(
416 MCAPI
void _fetchBorderBlockCollisions(
417 ::std::vector<::AABB>& shapes,
418 ::AABB const& intersectTestBox,
423 MCAPI
void _fetchEntityHelper(
425 ::gsl::span<::gsl::not_null<::Actor const*>>
const& ignoredEntities,
430 MCAPI
void _fetchEntityHelper(
432 ::ActorType entityTypeId,
435 ::std::function<
bool(
::Actor*)> selector
438 MCAPI
bool _getBlockPermissions(
::BlockPos const& pos,
bool currentState);
441 _getRawBrightness(
::BlockPos const& pos,
::Brightness skyDarken,
bool propagate,
bool accountForNight)
const;
443 MCAPI
void _removeFromTickingQueue(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType);
445 MCAPI
void _updateTallestCollisionShapeWithBorderBlockCollisions(
446 ::AABB const& intersectTestBox,
449 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
450 float& currentDistanceSqr
453 MCAPI
void addToRandomTickingQueuePercentChance(
461 MCAPI
void addToTickingQueue(
471 MCAPI
bool canSeeSky(
::BlockPos const& pos)
const;
473 MCAPI
bool canSeeSkyFromBelowWater(
::BlockPos const& pos);
475 MCAPI
bool checkBlockDestroyPermissions(
479 bool generateParticle
482 MCAPI
bool containsAnyBlockInBox(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
486 MCAPI
bool containsAnySolidBlocking(
::AABB const& box)
const;
488 MCAPI uint64 countBlocksOfType(
495 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
498 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType blockActorTypeId,
::AABB const& bb)
const;
500 MCAPI ::std::vector<::BlockActor*>
const& fetchBlockEntities(
::AABB const& bb);
504 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
507 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
508 fetchBlocksInBoxSorted(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
510 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinder(
514 ::std::function<
bool(
::Block const&)> predicate
517 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinderSorted(
521 ::std::function<
bool(
::Block const&)> predicate
524 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
525 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
528 bool getDisplayEntities
531 MCAPI ::std::vector<::Actor*>
const& fetchEntities2(::ActorType type,
::AABB const& aabb,
bool ignoreTargetType);
533 MCAPI ::Actor* fetchNearestEntityOfType(
::Actor const* except,
::AABB const& bb, ::ActorType entityTypeId);
535 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
536 fetchPlayers(
::AABB const& bb,
::Actor const* except, ::std::function<
bool(
::Actor*)> selector);
538 MCAPI
bool findNextTopSolidBlockUnder(
::BlockPos& pos);
542 MCAPI ::Biome
const& getBiome(
::BlockPos const& pos)
const;
544 MCAPI ::BlockActor* getBlockEntity(
::BlockPos const&);
546 MCAPI
float getSeenPercent(
::Vec3 const& center,
::AABB const& bb);
548 MCAPI
int getSkylightBrightness(
::BlockPos const& pos)
const;
550 MCAPI
void getTallestCollisionShapeFromUnloadedChunksAABBs(
551 ::AABB const& intersectTestBox,
552 ::AABB& tallestCollisionShape,
553 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
554 float& currentDistanceSqr
557 MCAPI
bool hasChunksAt(
::BlockPos const& min,
::BlockPos const& max,
bool ignoreClientChunk)
const;
559 MCAPI ::std::pair<bool, ::std::optional<::SubChunkPos>>
562 MCAPI
bool hasTickInCurrentTick(
::BlockPos const& pos, ::TickingQueueType queueType)
const;
564 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos, ::TickingQueueType queueType)
const;
566 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType)
const;
569 hasTickInPendingTicks(
::BlockPos const& pos,
::BlockType const& block, ::TickingQueueType queueType)
const;
571 MCAPI
bool hasUntickedNeighborChunk(
::ChunkPos const& pos,
int chunkRadius)
const;
573 MCAPI
bool isNearUnloadedChunks(
::ChunkPos const& pos)
const;
575 MCAPI
bool isTouchingMaterial(
::BlockPos const& pos, ::MaterialType type)
const;
577 MCAPI
bool isWithinHeightLimits(
int y)
const;
584 MCAPI ::std::shared_ptr<::BlockActor> removeBlockEntity(
::BlockPos const& blockPos);
590 ::std::shared_ptr<::BlockActor> blockEntity,
595 MCAPI
bool setBlockAndRetainCompatibleBlockActor(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
597 MCAPI
void setBorderBlock(
::BlockPos const& pos,
bool val);
601 MCAPI
bool setLiquidBlock(
::BlockPos const& pos,
::Block const& block,
bool useExtraData,
int updateFlags);
603 MCAPI
void updateConnectionsAt(
::BlockPos const& pos);
605 MCAPI
void updateNeighborsAt(
::BlockPos const& pos);
607 MCAPI
void updateNeighborsAtExceptFromFacing(
::BlockPos const& pos,
int skipFacing);
617 MCFOLD static ::Block
const& getEmptyBlock();
628 bool allowUnpopulatedChunks,
629 bool allowClientTickingChanges
642 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
644 MCFOLD ::Level& $getLevel();
646 MCFOLD ::Dimension& $getDimension()
const;
648 MCFOLD ::Dimension& $getDimension();
650 MCFOLD ::Dimension
const& $getDimensionConst()
const;
652 MCAPI ::DimensionType $getDimensionId()
const;
654 MCAPI
bool $shouldFireEvents(
::LevelChunk const& c)
const;
656 MCAPI
bool $isInstaticking(
::BlockPos const& pos)
const;
662 MCAPI ::LevelChunk* $getChunk(
int x,
int z)
const;
664 MCAPI ::LevelChunk* $getChunk(
::ChunkPos const& pos)
const;
666 MCAPI ::LevelChunk* $getChunkAt(
::BlockPos const& pos)
const;
668 MCAPI
short $getAboveTopSolidBlock(
672 bool iteratePastInitialBlocking
675 MCAPI
short $getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const;
677 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const;
679 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const;
681 MCAPI ::Material
const& $getMaterial(
::BlockPos const& pos)
const;
683 MCAPI ::Material
const& $getMaterial(
int x,
int y,
int z)
const;
685 MCAPI
short $getMaxHeight()
const;
687 MCAPI
short $getMinHeight()
const;
689 MCAPI
bool $hasBorderBlock(
::BlockPos const pos)
const;
691 MCAPI
float $getBrightness(
::BlockPos const& pos)
const;
693 MCAPI
bool $mayPlace(
702 MCAPI
bool $canDoBlockDrops()
const;
704 MCAPI
bool $canDoContainedItemDrops()
const;
706 MCAPI
bool $hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const;
708 MCAPI
bool $hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const;
710 MCAPI
bool $hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const;
712 MCAPI
bool $areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const;
714 MCAPI
bool $containsAnyLiquid(
::AABB const& box)
const;
716 MCAPI
bool $containsMaterial(
::AABB const& box, ::MaterialType material)
const;
718 MCAPI
void $blockEvent(
::BlockPos const& pos,
int b0,
int b1);
720 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
721 $fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities);
724 $fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const;
726 MCAPI ::std::vector<::AABB>& $fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks);
728 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
729 ::AABB const& intersectTestBox,
730 bool withUnloadedChunks,
731 ::std::optional<::EntityContext const> entity,
732 ::std::vector<::AABB>* tempShapes
735 MCAPI
void $fetchCollisionShapes(
736 ::std::vector<::AABB>& shapes,
737 ::AABB const& intersectTestBox,
738 bool withUnloadedChunks,
740 ::std::vector<::AABB>* tempShapes
743 MCAPI
void $fetchCollisionShapesAndBlocks(
744 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
745 ::AABB const& intersectTestBox,
746 bool withUnloadedChunks,
748 ::std::vector<::AABB>* tempShapes
751 MCAPI ::AABB $getTallestCollisionShape(
752 ::AABB const& intersectTestBox,
753 float* actualSurfaceOffset,
754 bool withUnloadedChunks,
758 MCAPI ::HitResult $clip(
761 bool checkAgainstLiquid,
762 ::ShapeType shapeType,
764 bool ignoreBorderBlocks,
768 bool stopOnFirstLiquidHit
773 MCAPI
bool $isInWall(
::Vec3 const& pos)
const;
777 MCAPI
void $fireBlockChanged(
783 ::BlockChangedEventTarget eventTarget,
788 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos)
const;
790 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos, uint layer)
const;
792 MCFOLD ::BlockActor
const* $getBlockEntity(
::BlockPos const& pos)
const;
794 MCAPI ::Block
const& $getExtraBlock(
::BlockPos const& pos)
const;
796 MCAPI ::Block
const& $getLiquidBlock(
::BlockPos const& pos)
const;
798 MCAPI
bool $hasBlock(
::BlockPos const& pos)
const;
800 MCAPI
bool $setBlock(
808 MCAPI
bool $setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
812 MCAPI
bool $isSolidBlockingBlock(
int x,
int y,
int z)
const;
814 MCAPI
bool $isSolidBlockingBlock(
::BlockPos const& p)
const;
816 MCFOLD ::ILevel& $getILevel()
const;
818 MCAPI ::LevelSeed64 $getLevelSeed64()
const;
820 MCFOLD ::ChunkSource& $getChunkSource();
822 MCAPI
bool $checkBlockPermissions(
827 bool generateParticle
830 MCFOLD
float $getVisualLiquidHeight(
::Vec3 const& pos)
const;
832 MCAPI
void $postGameEvent(
843 MCAPI
static void** $vftable();