71 public ::std::enable_shared_from_this<::BlockSource> {
73 LLNDAPI std::vector<Actor*> getEntities(
75 float extendDistance = 2.0f,
76 ActorType actorType = ActorType::TypeMask,
77 bool ignoreType =
false
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;
113 BlockSource& operator=(BlockSource
const&);
114 BlockSource(BlockSource
const&);
120 virtual ~BlockSource() ;
122 virtual ::WeakRef<::BlockSource> getWeakRef() ;
124 virtual ::Level& getLevel() ;
126 virtual ::Dimension& getDimension()
const ;
128 virtual ::Dimension& getDimension() ;
130 virtual ::Dimension
const& getDimensionConst()
const ;
132 virtual ::DimensionType getDimensionId()
const ;
134 virtual bool shouldFireEvents(
::LevelChunk const& c)
const ;
136 virtual bool isInstaticking(
::BlockPos const& pos)
const ;
142 virtual ::LevelChunk* getChunk(
int x,
int z)
const ;
144 virtual ::LevelChunk* getChunk(
::ChunkPos const& pos)
const ;
146 virtual ::LevelChunk* getChunkAt(
::BlockPos const& pos)
const ;
148 virtual short getAboveTopSolidBlock(
152 bool iteratePastInitialBlocking
155 virtual short getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const ;
162 virtual ::Material
const& getMaterial(
::BlockPos const& pos)
const ;
164 virtual ::Material
const& getMaterial(
int x,
int y,
int z)
const ;
166 virtual short getMaxHeight()
const ;
168 virtual short getMinHeight()
const ;
170 virtual bool hasBorderBlock(
::BlockPos const pos)
const ;
172 virtual float getBrightness(
::BlockPos const& pos)
const ;
174 virtual bool mayPlace(
183 virtual bool canDoBlockDrops(
::Actor const* instigatingActor)
const ;
185 virtual bool canDoContainedItemDrops(
::Actor const* instigatingActor)
const ;
187 virtual bool hasChunk(
::ChunkPos const& pos,
bool serverSideOnly)
const ;
189 virtual bool hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const ;
191 virtual bool hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const ;
193 virtual bool hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const ;
195 virtual bool areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const ;
197 virtual bool containsAnyLiquid(
::AABB const& box)
const ;
199 virtual bool containsMaterial(
::AABB const& box, ::SharedTypes::v1_26_20::MaterialType material)
const ;
201 virtual void blockEvent(
::BlockPos const& pos,
int b0,
int b1) ;
203 virtual ::gsl::span<::gsl::not_null<::Actor*>>
204 fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities) ;
206 virtual ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
207 ::ActorType entityTypeId,
210 ::std::function<
bool(
::Actor*)> selector
214 fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const
217 virtual ::std::vector<::AABB>& fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks) ;
219 virtual ::std::vector<::AABB>& fetchCollisionShapes(
220 ::AABB const& intersectTestBox,
221 bool withUnloadedChunks,
222 ::std::optional<::EntityContext const> entity,
223 ::std::vector<::AABB>* tempShapes
226 virtual void fetchCollisionShapes(
227 ::std::vector<::AABB>& shapes,
228 ::AABB const& intersectTestBox,
229 bool withUnloadedChunks,
231 ::std::vector<::AABB>* tempShapes
234 virtual void fetchCollisionShapesAndBlocks(
235 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
236 ::AABB const& intersectTestBox,
237 bool withUnloadedChunks,
239 ::std::vector<::AABB>* tempShapes
242 virtual ::AABB getTallestCollisionShape(
243 ::AABB const& intersectTestBox,
244 float* actualSurfaceOffset,
245 bool withUnloadedChunks,
249 virtual ::HitResult clip(
252 bool checkAgainstLiquid,
253 ::ShapeType shapeType,
255 bool ignoreBorderBlocks,
258 ::std::function<
bool(::BlockSource
const&,
::Block const&,
bool)>
const& shouldCheckBlock,
259 bool stopOnFirstLiquidHit
264 virtual bool isInWall(
::Vec3 const& pos)
const ;
268 virtual void fireBlockChanged(
274 ::BlockChangedEventTarget eventTarget,
281 virtual ::Block
const& getBlock(
::BlockPos const& pos)
const ;
283 virtual ::Block
const& getBlock(
::BlockPos const& pos, uint layer)
const ;
285 virtual ::BlockActor
const* getBlockEntity(
::BlockPos const& pos)
const ;
287 virtual ::Block
const& getExtraBlock(
::BlockPos const& pos)
const ;
289 virtual ::Block
const& getLiquidBlock(
::BlockPos const& pos)
const ;
291 virtual bool hasBlock(
::BlockPos const& pos)
const ;
293 virtual bool setBlock(
301 virtual bool setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags) ;
305 virtual bool isSolidBlockingBlock(
int x,
int y,
int z)
const ;
307 virtual bool isSolidBlockingBlock(
::BlockPos const& p)
const ;
309 virtual ::ILevel& getILevel()
const ;
311 virtual ::LevelSeed64 getLevelSeed64()
const ;
313 virtual ::ChunkSource& getChunkSource() ;
315 virtual bool checkBlockDestroyPermissions(
319 bool generateParticle
322 virtual bool checkBlockPermissions(
327 bool generateParticle
330 virtual void postGameEvent(
346 bool allowUnpopulatedChunks,
347 bool allowClientTickingChanges
350 MCAPI
void _blockChanged(
361 MCAPI
void _fetchEntityHelper(
363 ::gsl::span<::gsl::not_null<::Actor const*>>
const& ignoredEntities,
366 ::std::function<
bool(
::Actor*)> selector
369 MCAPI ::Brightness _getRawBrightness(
::BlockPos const& pos,
::Brightness skyDarken,
bool accountForNight)
const;
371 MCAPI
void addToRandomTickingQueue(
379 MCAPI
void addToRandomTickingQueuePercentChance(
391 MCAPI
bool canProvideSupport(
::BlockPos const& pos, uchar face, ::BlockSupportType type)
const;
393 MCAPI
bool canSeeSky(
::BlockPos const& pos)
const;
395 MCAPI
bool canSeeSkyFromBelowWater(
::BlockPos const& pos);
399 MCAPI
bool containsAnySolidBlocking(
::AABB const& box)
const;
401 MCAPI uint64 countBlocksOfType(
408 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
411 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType blockActorTypeId,
::AABB const& bb)
const;
414 fetchBlockEntities(
::AABB const& bb, ::std::vector<::BlockActor*>& blockEntityList,
bool withPreservedEntities);
416 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
419 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinder(
426 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
427 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
430 bool getDisplayEntities,
431 ::std::function<
bool(
::Actor*)> selector
434 MCAPI ::std::vector<::Actor*>
const& fetchEntities2(::ActorType type,
::AABB const& aabb,
bool ignoreTargetType);
436 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
437 fetchPlayers(
::AABB const& bb,
::Actor const* except, ::std::function<
bool(
::Actor*)> selector);
440 MCAPI
void fetchRenderBlockActorComponents(
442 ::std::vector<::gsl::not_null<::IVanillaRenderBlockActorComponent*>>& blockEntityList,
443 bool withPreservedEntities
447 MCAPI
bool findNextTopSolidBlockUnder(
::BlockPos& pos);
449 MCAPI
void fireBlockEntityAboutToBeRemoved(::std::shared_ptr<::BlockActor> te);
451 MCAPI ::Biome
const& getBiome(
::BlockPos const& pos)
const;
454 MCAPI ::BiomeIdLatticeBatch getBiomeIdsInBatch(
::BlockPos const& centerPos,
int areaOffset,
int gridOffset)
const;
457 MCFOLD ::BlockActor* getBlockEntity(
::BlockPos const& pos);
459 MCAPI ::BrightnessPair getBrightnessPair(
::BlockPos const& pos)
const;
461 MCAPI ::BlockPos getHeightmapPos(
::BlockPos const& xzPos)
const;
467 MCAPI
float getSeenPercent(
::Vec3 const& center,
::AABB const& bb);
469 MCAPI
int getSkylightBrightness(
::BlockPos const& pos)
const;
472 MCAPI ::Biome
const& getSurfaceBiome(
::BlockPos const& pos)
const;
475 MCAPI ::std::pair<bool, ::std::optional<::SubChunkPos>>
478 MCAPI
bool hasTickInCurrentTick(
::BlockPos const& pos)
const;
480 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos, ::TickingQueueType queueType)
const;
482 MCAPI
bool hasTickInPendingTicks(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType)
const;
485 hasTickInPendingTicks(
::BlockPos const& pos,
::BlockType const& block, ::TickingQueueType queueType)
const;
488 MCAPI
bool isPositionUnderSnow(
::Vec3 const& p);
491 MCAPI
bool isTouchingMaterial(
::BlockPos const& pos, ::SharedTypes::v1_26_20::MaterialType type)
const;
493 MCAPI
bool isUnobstructedByEntities(
::AABB const& aabb,
::Actor const* ignoreEntity);
501 ::std::shared_ptr<::BlockActor> blockEntity,
506 MCAPI
bool setBlockAndRetainCompatibleBlockActor(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
510 MCAPI
void updateConnectionsAt(
::BlockPos const& pos);
512 MCAPI
void updateNeighborsAt(
::BlockPos const& pos);
514 MCAPI
void updateNeighborsAtExceptFromFacing(
::BlockPos const& pos,
int skipFacing);
531 bool allowUnpopulatedChunks,
532 bool allowClientTickingChanges
545 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
547 MCFOLD ::Level& $getLevel();
549 MCFOLD ::Dimension& $getDimension()
const;
551 MCFOLD ::Dimension
const& $getDimensionConst()
const;
553 MCAPI ::DimensionType $getDimensionId()
const;
555 MCAPI
bool $shouldFireEvents(
::LevelChunk const& c)
const;
557 MCAPI
bool $isInstaticking(
::BlockPos const& pos)
const;
563 MCAPI ::LevelChunk* $getChunk(
int x,
int z)
const;
565 MCAPI ::LevelChunk* $getChunk(
::ChunkPos const& pos)
const;
567 MCAPI ::LevelChunk* $getChunkAt(
::BlockPos const& pos)
const;
569 MCAPI
short $getAboveTopSolidBlock(
573 bool iteratePastInitialBlocking
576 MCAPI
short $getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const;
582 MCAPI ::Material
const& $getMaterial(
::BlockPos const& pos)
const;
584 MCAPI ::Material
const& $getMaterial(
int x,
int y,
int z)
const;
586 MCAPI
short $getMaxHeight()
const;
588 MCAPI
short $getMinHeight()
const;
590 MCAPI
bool $hasBorderBlock(
::BlockPos const pos)
const;
592 MCAPI
float $getBrightness(
::BlockPos const& pos)
const;
594 MCAPI
bool $mayPlace(
603 MCAPI
bool $canDoBlockDrops(
::Actor const* instigatingActor)
const;
605 MCAPI
bool $canDoContainedItemDrops(
::Actor const* instigatingActor)
const;
607 MCAPI
bool $hasChunk(
::ChunkPos const& pos,
bool serverSideOnly)
const;
609 MCAPI
bool $hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const;
611 MCAPI
bool $hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const;
613 MCAPI
bool $hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const;
615 MCAPI
bool $areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const;
617 MCAPI
bool $containsAnyLiquid(
::AABB const& box)
const;
619 MCAPI
bool $containsMaterial(
::AABB const& box, ::SharedTypes::v1_26_20::MaterialType material)
const;
621 MCAPI
void $blockEvent(
::BlockPos const& pos,
int b0,
int b1);
623 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
624 $fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities);
626 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> $fetchEntities(
627 ::ActorType entityTypeId,
630 ::std::function<
bool(
::Actor*)> selector
634 $fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const;
636 MCAPI ::std::vector<::AABB>& $fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks);
638 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
639 ::AABB const& intersectTestBox,
640 bool withUnloadedChunks,
641 ::std::optional<::EntityContext const> entity,
642 ::std::vector<::AABB>* tempShapes
645 MCAPI
void $fetchCollisionShapes(
646 ::std::vector<::AABB>& shapes,
647 ::AABB const& intersectTestBox,
648 bool withUnloadedChunks,
650 ::std::vector<::AABB>* tempShapes
653 MCAPI
void $fetchCollisionShapesAndBlocks(
654 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
655 ::AABB const& intersectTestBox,
656 bool withUnloadedChunks,
658 ::std::vector<::AABB>* tempShapes
661 MCAPI ::AABB $getTallestCollisionShape(
662 ::AABB const& intersectTestBox,
663 float* actualSurfaceOffset,
664 bool withUnloadedChunks,
668 MCAPI ::HitResult $clip(
671 bool checkAgainstLiquid,
672 ::ShapeType shapeType,
674 bool ignoreBorderBlocks,
677 ::std::function<
bool(::BlockSource
const&,
::Block const&,
bool)>
const& shouldCheckBlock,
678 bool stopOnFirstLiquidHit
683 MCAPI
bool $isInWall(
::Vec3 const& pos)
const;
687 MCAPI
void $fireBlockChanged(
693 ::BlockChangedEventTarget eventTarget,
700 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos)
const;
702 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos, uint layer)
const;
704 MCFOLD ::BlockActor
const* $getBlockEntity(
::BlockPos const& pos)
const;
706 MCAPI ::Block
const& $getExtraBlock(
::BlockPos const& pos)
const;
708 MCAPI ::Block
const& $getLiquidBlock(
::BlockPos const& pos)
const;
710 MCAPI
bool $hasBlock(
::BlockPos const& pos)
const;
712 MCAPI
bool $setBlock(
720 MCAPI
bool $setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
724 MCAPI
bool $isSolidBlockingBlock(
int x,
int y,
int z)
const;
726 MCAPI
bool $isSolidBlockingBlock(
::BlockPos const& p)
const;
728 MCFOLD ::ILevel& $getILevel()
const;
730 MCAPI ::LevelSeed64 $getLevelSeed64()
const;
732 MCFOLD ::ChunkSource& $getChunkSource();
734 MCAPI
bool $checkBlockDestroyPermissions(
738 bool generateParticle
741 MCAPI
bool $checkBlockPermissions(
746 bool generateParticle
749 MCAPI
void $postGameEvent(