67 public ::std::enable_shared_from_this<::BlockSource> {
69 LLNDAPI std::vector<Actor*> getEntities(
71 float extendDistance = 2.0f,
72 ActorType actorType = ActorType::TypeMask,
73 bool ignoreType =
false
83 ::ll::TypedStorage<4, 4, ::std::thread::id const> mOwnerThreadID;
84 ::ll::TypedStorage<1, 1, bool const> mAllowUnpopulatedChunks;
85 ::ll::TypedStorage<1, 1, bool const> mPublicSource;
86 ::ll::TypedStorage<1, 1, bool> mCheckValidity;
87 ::ll::TypedStorage<8, 8, ::Level&> mLevel;
88 ::ll::TypedStorage<8, 8, ::ChunkSource&> mChunkSource;
89 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
90 ::ll::TypedStorage<2, 2, short const> mMaxHeight;
91 ::ll::TypedStorage<2, 2, short const> mMinHeight;
92 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDataFetchResult<::Block>>> mTempBlockFetchResult;
93 ::ll::TypedStorage<1, 1, bool> mAllowTickingChanges;
94 ::ll::TypedStorage<4, 12, ::BlockPos> mPlaceChunkPos;
95 ::ll::TypedStorage<8, 24, ::std::vector<::BlockSourceListener*>> mListeners;
96 ::ll::TypedStorage<8, 8, ::Tick> mCurrentTickForValidityChecks;
97 ::ll::TypedStorage<1, 1, bool> mIsPersistantBlockSource;
98 ::ll::TypedStorage<8, 8, ::ChunkPos> mLastChunkPos;
99 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::LevelChunk>> mLastChunkWeakPtr;
100 ::ll::TypedStorage<8, 8, ::LevelChunk*> mLastChunkDirectPtr;
101 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mRandomTickQueue;
102 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mTickQueue;
103 ::ll::TypedStorage<1, 2, ::BrightnessPair const> mDefaultBrightness;
104 ::ll::TypedStorage<8, 24, ::std::vector<::Actor*>> mTempEntityList;
105 ::ll::TypedStorage<8, 24, ::std::vector<::BlockActor*>> mTempBlockEntityList;
106 ::ll::TypedStorage<8, 24, ::std::vector<::AABB>> mTempCubeList;
116 virtual ::WeakRef<::BlockSource> getWeakRef() ;
119 virtual ::Level& getLevel() ;
122 virtual ::Dimension& getDimension()
const ;
125 virtual ::Dimension& getDimension() ;
128 virtual ::Dimension
const& getDimensionConst()
const ;
131 virtual ::DimensionType getDimensionId()
const ;
134 virtual bool isInstaticking(
::BlockPos const& pos)
const ;
143 virtual ::LevelChunk* getChunk(
int x,
int z)
const ;
146 virtual ::LevelChunk* getChunk(
::ChunkPos const& pos)
const ;
149 virtual ::LevelChunk* getChunkAt(
::BlockPos const& pos)
const ;
153 getAboveTopSolidBlock(
::BlockPos const& pos,
bool includeWater,
bool includeLeaves,
bool iteratePastInitialBlocking)
157 virtual short getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const ;
160 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const
164 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const ;
167 virtual ::Material
const& getMaterial(
::BlockPos const& pos)
const ;
170 virtual ::Material
const& getMaterial(
int x,
int y,
int z)
const ;
173 virtual short getMaxHeight()
const ;
176 virtual short getMinHeight()
const ;
179 virtual bool hasBorderBlock(
::BlockPos const pos)
const ;
182 virtual float getBrightness(
::BlockPos const& pos)
const ;
185 virtual ::Block
const& getLiquidBlock(
::BlockPos const& p)
const ;
188 virtual ::Block
const& getExtraBlock(
::BlockPos const& p)
const ;
191 virtual bool mayPlace(
201 virtual bool hasBlock(
::BlockPos const& pos)
const ;
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 ::BlockActor
const* getBlockEntity(
::BlockPos const& pos)
const ;
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*>> fetchEntities(
236 ::ActorType entityTypeId,
239 ::std::function<
bool(
::Actor*)> selector
244 fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const
248 virtual ::std::vector<::AABB>& fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks) ;
251 virtual ::std::vector<::AABB>& fetchCollisionShapes(
252 ::AABB const& intersectTestBox,
253 bool withUnloadedChunks,
254 ::std::optional<::EntityContext const> entity,
255 ::std::vector<::AABB>* tempShapes
259 virtual void fetchCollisionShapes(
260 ::std::vector<::AABB>& shapes,
261 ::AABB const& intersectTestBox,
262 bool withUnloadedChunks,
264 ::std::vector<::AABB>* tempShapes
268 virtual void fetchCollisionShapesAndBlocks(
269 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
270 ::AABB const& intersectTestBox,
271 bool withUnloadedChunks,
273 ::std::vector<::AABB>* tempShapes
277 virtual ::AABB getTallestCollisionShape(
278 ::AABB const& intersectTestBox,
279 float* actualSurfaceOffset,
280 bool withUnloadedChunks,
285 virtual ::HitResult clip(
288 bool checkAgainstLiquid,
289 ::ShapeType shapeType,
291 bool ignoreBorderBlocks,
301 virtual bool isInWall(
::Vec3 const& pos)
const ;
304 virtual bool isUnderWater(
::Vec3 const& pos,
::Block const& block)
const ;
307 virtual ::Block
const& getBlock(
int x,
int y,
int z)
const ;
310 virtual ::Block
const& getBlock(
::BlockPos const& pos)
const ;
313 virtual ::Block
const& getBlock(
::BlockPos const& pos, uint layer)
const ;
316 virtual bool setBlock(
325 virtual bool isSolidBlockingBlock(
int x,
int y,
int z)
const ;
328 virtual bool isSolidBlockingBlock(
::BlockPos const& p)
const ;
331 virtual bool removeBlock(
::BlockPos const& pos) ;
334 virtual ::ILevel& getILevel()
const ;
337 virtual ::LevelSeed64 getLevelSeed64()
const ;
340 virtual ::ChunkSource& getChunkSource() ;
343 virtual bool checkBlockPermissions(
348 bool generateParticle
352 virtual void postGameEvent(
360 virtual void updateCheckForValidityState(
bool checkForValidity) ;
371 bool allowUnpopulatedChunks,
372 bool allowClientTickingChanges
375 MCAPI
void _addToTickingQueue(
380 ::TickingQueueType queueType,
384 MCAPI
void _blockChanged(
394 MCAPI
void _fetchBorderBlockCollisions(
395 ::std::vector<::AABB>& shapes,
396 ::AABB const& intersectTestBox,
401 MCAPI
void _fetchEntityHelper(
403 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
408 MCAPI
bool _getBlockPermissions(
::BlockPos const& pos,
bool currentState);
411 _getRawBrightness(
::BlockPos const& pos,
::Brightness skyDarken,
bool propagate,
bool accountForNight)
const;
413 MCAPI
void _removeFromTickingQueue(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType);
415 MCAPI
void _updateTallestCollisionShapeWithBorderBlockCollisions(
416 ::AABB const& intersectTestBox,
419 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
420 float& currentDistanceSqr
423 MCAPI
void addToRandomTickingQueuePercentChance(
431 MCAPI
void addToTickingQueue(
441 MCAPI
void blockEvent(
::BlockPos const& pos,
int b0,
int b1);
443 MCAPI
bool canProvideSupport(
::BlockPos const& pos, uchar face, ::BlockSupportType type)
const;
445 MCAPI
bool canSeeSky(
::BlockPos const& pos)
const;
447 MCAPI
bool canSeeSkyFromBelowWater(
::BlockPos const& pos);
449 MCAPI
bool checkBlockDestroyPermissions(
453 bool generateParticle
456 MCAPI
bool containsAnyBlockInBox(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
460 MCAPI
bool containsAnySolidBlocking(
::AABB const& box)
const;
462 MCAPI uint64 countBlocksOfType(
469 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
472 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType bb,
::AABB const& blockActorTypeId)
const;
474 MCAPI ::std::vector<::BlockActor*>
const& fetchBlockEntities(
::AABB const& bb);
478 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
481 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
482 fetchBlocksInBoxSorted(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
484 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinder(
488 ::std::function<
bool(
::Block const&)> predicate
491 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinderSorted(
495 ::std::function<
bool(
::Block const&)> predicate
498 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
499 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
502 bool getDisplayEntities
505 MCAPI ::std::vector<::Actor*>
const& fetchEntities2(::ActorType type,
::AABB const& aabb,
bool ignoreTargetType);
507 MCAPI ::Actor* fetchNearestEntityOfType(
::Actor const* except,
::AABB const& bb, ::ActorType entityTypeId);
509 MCAPI
bool findNextTopSolidBlockUnder(
::BlockPos& pos);
511 MCAPI
void fireBlockChanged(
517 ::BlockChangedEventTarget eventTarget,
524 MCAPI ::Biome
const& getBiome(
::BlockPos const& pos)
const;
526 MCAPI ::BlockActor* getBlockEntity(
::BlockPos const&);
528 MCAPI ::BrightnessPair getBrightnessPair(
::BlockPos const& pos)
const;
530 MCAPI
float getSeenPercent(
::Vec3 const& center,
::AABB const& bb);
532 MCAPI
void getTallestCollisionShapeFromUnloadedChunksAABBs(
533 ::AABB const& intersectTestBox,
534 ::AABB& tallestCollisionShape,
535 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
536 float& currentDistanceSqr
539 MCAPI
bool hasChunksAt(
::BlockPos const& min,
::BlockPos const& max,
bool ignoreClientChunk)
const;
541 MCAPI ::std::pair<bool, ::std::optional<::SubChunkPos>>
544 MCAPI
bool hasTickInCurrentTick(
::BlockPos const& pos, ::TickingQueueType queueType)
const;
546 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos, ::TickingQueueType queueType)
const;
548 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType)
const;
553 MCAPI
bool hasUntickedNeighborChunk(
::ChunkPos const& pos,
int chunkRadius)
const;
555 MCAPI
bool isEmptyBlock(
int x,
int y,
int z);
557 MCAPI
bool isNearUnloadedChunks(
::ChunkPos const& pos)
const;
559 MCAPI
bool isTouchingMaterial(
::BlockPos const& pos, ::MaterialType type)
const;
561 MCAPI
bool isUnobstructedByEntities(
::AABB const& aabb,
::Actor const* ignoreEntity);
563 MCAPI
bool isWithinHeightLimits(
int y)
const;
570 MCAPI
bool removeBlock(
int x,
int y,
int z);
576 ::std::shared_ptr<::BlockActor> blockEntity,
581 MCAPI
bool setBlock(
int x,
int y,
int z,
::Block const& block,
int updateFlags,
::Actor* blockChangeSource);
583 MCAPI
void setBorderBlock(
::BlockPos const& pos,
bool val);
585 MCAPI
bool setExtraBlock(
::BlockPos const& p,
::Block const& block,
int updateFlags);
589 MCAPI
void updateNeighborsAt(
::BlockPos const& pos);
608 bool allowUnpopulatedChunks,
609 bool allowClientTickingChanges
622 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
624 MCFOLD ::Level& $getLevel();
626 MCFOLD ::Dimension& $getDimension()
const;
628 MCFOLD ::Dimension& $getDimension();
630 MCFOLD ::Dimension
const& $getDimensionConst()
const;
632 MCAPI ::DimensionType $getDimensionId()
const;
634 MCAPI
bool $isInstaticking(
::BlockPos const& pos)
const;
640 MCAPI ::LevelChunk* $getChunk(
int x,
int z)
const;
642 MCAPI ::LevelChunk* $getChunk(
::ChunkPos const& pos)
const;
644 MCAPI ::LevelChunk* $getChunkAt(
::BlockPos const& pos)
const;
646 MCAPI
short $getAboveTopSolidBlock(
650 bool iteratePastInitialBlocking
653 MCAPI
short $getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const;
655 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const;
657 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const;
659 MCAPI ::Material
const& $getMaterial(
::BlockPos const& pos)
const;
661 MCAPI ::Material
const& $getMaterial(
int x,
int y,
int z)
const;
663 MCAPI
short $getMaxHeight()
const;
665 MCAPI
short $getMinHeight()
const;
667 MCAPI
bool $hasBorderBlock(
::BlockPos const pos)
const;
669 MCAPI
float $getBrightness(
::BlockPos const& pos)
const;
671 MCAPI ::Block
const& $getLiquidBlock(
::BlockPos const& p)
const;
673 MCAPI ::Block
const& $getExtraBlock(
::BlockPos const& p)
const;
675 MCAPI
bool $mayPlace(
684 MCAPI
bool $hasBlock(
::BlockPos const& pos)
const;
686 MCAPI
bool $canDoBlockDrops()
const;
688 MCAPI
bool $canDoContainedItemDrops()
const;
690 MCAPI
bool $hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const;
692 MCAPI
bool $hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const;
694 MCAPI
bool $hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const;
696 MCAPI
bool $areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const;
698 MCAPI
bool $containsAnyLiquid(
::AABB const& box)
const;
700 MCAPI
bool $containsMaterial(
::AABB const& box, ::MaterialType material)
const;
702 MCFOLD ::BlockActor
const* $getBlockEntity(
::BlockPos const& pos)
const;
704 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
705 $fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities);
707 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> $fetchEntities(
708 ::ActorType entityTypeId,
711 ::std::function<
bool(
::Actor*)> selector
715 $fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const;
717 MCAPI ::std::vector<::AABB>& $fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks);
719 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
720 ::AABB const& intersectTestBox,
721 bool withUnloadedChunks,
722 ::std::optional<::EntityContext const> entity,
723 ::std::vector<::AABB>* tempShapes
726 MCAPI
void $fetchCollisionShapes(
727 ::std::vector<::AABB>& shapes,
728 ::AABB const& intersectTestBox,
729 bool withUnloadedChunks,
731 ::std::vector<::AABB>* tempShapes
734 MCAPI
void $fetchCollisionShapesAndBlocks(
735 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
736 ::AABB const& intersectTestBox,
737 bool withUnloadedChunks,
739 ::std::vector<::AABB>* tempShapes
742 MCAPI ::AABB $getTallestCollisionShape(
743 ::AABB const& intersectTestBox,
744 float* actualSurfaceOffset,
745 bool withUnloadedChunks,
749 MCAPI ::HitResult $clip(
752 bool checkAgainstLiquid,
753 ::ShapeType shapeType,
755 bool ignoreBorderBlocks,
763 MCAPI
bool $isInWall(
::Vec3 const& pos)
const;
765 MCAPI
bool $isUnderWater(
::Vec3 const& pos,
::Block const& block)
const;
767 MCAPI ::Block
const& $getBlock(
int x,
int y,
int z)
const;
769 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos)
const;
771 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos, uint layer)
const;
773 MCAPI
bool $setBlock(
781 MCAPI
bool $isSolidBlockingBlock(
int x,
int y,
int z)
const;
783 MCAPI
bool $isSolidBlockingBlock(
::BlockPos const& p)
const;
785 MCAPI
bool $removeBlock(
::BlockPos const& pos);
787 MCFOLD ::ILevel& $getILevel()
const;
789 MCAPI ::LevelSeed64 $getLevelSeed64()
const;
791 MCFOLD ::ChunkSource& $getChunkSource();
793 MCAPI
bool $checkBlockPermissions(
798 bool generateParticle
801 MCAPI
void $postGameEvent(
808 MCAPI
void $updateCheckForValidityState(
bool checkForValidity);
814 MCAPI
static void** $vftable();