63 public ::std::enable_shared_from_this<::BlockSource> {
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;
104 virtual ::WeakRef<::BlockSource> getWeakRef() ;
107 virtual ::Level& getLevel() ;
110 virtual ::Dimension& getDimension()
const ;
113 virtual ::Dimension& getDimension() ;
116 virtual ::Dimension
const& getDimensionConst()
const ;
119 virtual ::DimensionType getDimensionId()
const ;
122 virtual bool shouldFireEvents(
::LevelChunk const& c)
const ;
125 virtual bool isInstaticking(
::BlockPos const& pos)
const ;
134 virtual ::LevelChunk* getChunk(
int x,
int z)
const ;
137 virtual ::LevelChunk* getChunk(
::ChunkPos const& pos)
const ;
140 virtual ::LevelChunk* getChunkAt(
::BlockPos const& pos)
const ;
143 virtual short getAboveTopSolidBlock(
147 bool iteratePastInitialBlocking
151 virtual short getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const ;
154 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const
158 virtual short getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const ;
161 virtual ::Material
const& getMaterial(
::BlockPos const& pos)
const ;
164 virtual ::Material
const& getMaterial(
int x,
int y,
int z)
const ;
167 virtual short getMaxHeight()
const ;
170 virtual short getMinHeight()
const ;
173 virtual bool hasBorderBlock(
::BlockPos const pos)
const ;
176 virtual float getBrightness(
::BlockPos const& pos)
const ;
179 virtual bool mayPlace(
189 virtual bool canDoBlockDrops()
const ;
192 virtual bool canDoContainedItemDrops()
const ;
195 virtual bool hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const ;
198 virtual bool hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const ;
201 virtual bool hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const ;
204 virtual bool areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const ;
207 virtual bool containsAnyLiquid(
::AABB const& box)
const ;
210 virtual bool containsMaterial(
::AABB const& box, ::MaterialType material)
const ;
213 virtual void blockEvent(
::BlockPos const& pos,
int b0,
int b1) ;
216 virtual ::gsl::span<::gsl::not_null<::Actor*>>
217 fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities) ;
220 virtual ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
221 ::ActorType entityTypeId,
224 ::std::function<
bool(
::Actor*)> selector
229 fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const
233 virtual ::std::vector<::AABB>& fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks) ;
236 virtual ::std::vector<::AABB>& fetchCollisionShapes(
237 ::AABB const& intersectTestBox,
238 bool withUnloadedChunks,
239 ::std::optional<::EntityContext const> entity,
240 ::std::vector<::AABB>* tempShapes
244 virtual void fetchCollisionShapes(
245 ::std::vector<::AABB>& shapes,
246 ::AABB const& intersectTestBox,
247 bool withUnloadedChunks,
249 ::std::vector<::AABB>* tempShapes
253 virtual void fetchCollisionShapesAndBlocks(
254 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
255 ::AABB const& intersectTestBox,
256 bool withUnloadedChunks,
258 ::std::vector<::AABB>* tempShapes
262 virtual ::AABB getTallestCollisionShape(
263 ::AABB const& intersectTestBox,
264 float* actualSurfaceOffset,
265 bool withUnloadedChunks,
270 virtual ::HitResult clip(
273 bool checkAgainstLiquid,
274 ::ShapeType shapeType,
276 bool ignoreBorderBlocks,
280 bool stopOnFirstLiquidHit
287 virtual bool isInWall(
::Vec3 const& pos)
const ;
293 virtual void fireBlockChanged(
299 ::BlockChangedEventTarget eventTarget,
305 virtual ::Block
const& getBlock(
::BlockPos const& pos)
const ;
308 virtual ::Block
const& getBlock(
::BlockPos const& pos, uint layer)
const ;
311 virtual ::BlockActor
const* getBlockEntity(
::BlockPos const& pos)
const ;
314 virtual ::Block
const& getExtraBlock(
::BlockPos const& pos)
const ;
317 virtual ::Block
const& getLiquidBlock(
::BlockPos const& pos)
const ;
320 virtual bool hasBlock(
::BlockPos const& pos)
const ;
323 virtual bool setBlock(
332 virtual bool setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags) ;
338 virtual bool isSolidBlockingBlock(
int x,
int y,
int z)
const ;
341 virtual bool isSolidBlockingBlock(
::BlockPos const& p)
const ;
344 virtual ::ILevel& getILevel()
const ;
347 virtual ::LevelSeed64 getLevelSeed64()
const ;
350 virtual ::ChunkSource& getChunkSource() ;
353 virtual bool checkBlockPermissions(
358 bool generateParticle
362 virtual float getVisualLiquidHeight(
::Vec3 const& pos)
const ;
365 virtual void postGameEvent(
381 bool allowUnpopulatedChunks,
382 bool allowClientTickingChanges
385 MCAPI
void _addToTickingQueue(
390 ::TickingQueueType queueType,
394 MCAPI
void _blockChanged(
405 MCAPI
void _fetchBorderBlockCollisions(
406 ::std::vector<::AABB>& shapes,
407 ::AABB const& intersectTestBox,
412 MCAPI
void _fetchEntityHelper(
414 ::gsl::span<::gsl::not_null<::Actor const*>>
const& ignoredEntities,
419 MCAPI
void _fetchEntityHelper(
421 ::ActorType entityTypeId,
424 ::std::function<
bool(
::Actor*)> selector
427 MCAPI
bool _getBlockPermissions(
::BlockPos const& pos,
bool currentState);
429 MCAPI
float _getLiquidHeight(
::BlockPos const& pos, ::MaterialType mat,
bool blockedFromAbove)
const;
432 _getRawBrightness(
::BlockPos const& pos,
::Brightness skyDarken,
bool propagate,
bool accountForNight)
const;
434 MCAPI
void _removeFromTickingQueue(
::BlockPos const& pos,
::Block const& block, ::TickingQueueType queueType);
436 MCAPI
void _updateTallestCollisionShapeWithBorderBlockCollisions(
437 ::AABB const& intersectTestBox,
440 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
441 float& currentDistanceSqr
444 MCAPI
void addToRandomTickingQueuePercentChance(
452 MCAPI
void addToTickingQueue(
462 MCAPI
void blockEvent(
int x,
int y,
int z,
int b0,
int b1);
464 MCAPI
bool canSeeSky(
::BlockPos const& pos)
const;
466 MCAPI
bool canSeeSkyFromBelowWater(
::BlockPos const& pos);
468 MCAPI
bool checkBlockDestroyPermissions(
472 bool generateParticle
475 MCAPI
bool containsAnyBlockInBox(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
479 MCAPI
bool containsAnySolidBlocking(
::AABB const& box)
const;
481 MCAPI uint64 countBlocksOfType(
488 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
491 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType blockActorTypeId,
::AABB const& bb)
const;
494 fetchBlockEntities(
::AABB const& bb, ::std::vector<::BlockActor*>& blockEntityList,
bool withPreservedEntities);
498 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
501 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const>
502 fetchBlocksInBoxSorted(
::BoundingBox const& box, ::std::function<
bool(
::Block const&)> predicate);
504 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinder(
508 ::std::function<
bool(
::Block const&)> predicate
511 MCAPI ::gsl::span<::BlockDataFetchResult<::Block>
const> fetchBlocksInCylinderSorted(
515 ::std::function<
bool(
::Block const&)> predicate
518 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
519 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
522 bool getDisplayEntities
525 MCAPI ::std::vector<::Actor*>
const& fetchEntities2(::ActorType type,
::AABB const& aabb,
bool ignoreTargetType);
527 MCAPI ::Actor* fetchNearestEntityOfType(
::Actor const* except,
::AABB const& bb, ::ActorType entityTypeId);
529 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
530 fetchPlayers(
::AABB const& bb,
::Actor const* except, ::std::function<
bool(
::Actor*)> selector);
532 MCAPI
bool findNextTopSolidBlockUnder(
::BlockPos& pos);
536 MCAPI ::Biome
const& getBiome(
::BlockPos const& pos)
const;
538 MCAPI ::BiomeIdLatticeBatch getBiomeIdsInBatch(
::BlockPos const& centerPos,
int areaOffset,
int gridOffset)
const;
540 MCAPI ::BlockActor* getBlockEntity(
::BlockPos const&);
544 MCAPI
float getSeenPercent(
::Vec3 const& center,
::AABB const& bb);
546 MCAPI
int getSkylightBrightness(
::BlockPos const& pos)
const;
548 MCAPI ::Biome
const& getSurfaceBiome(
::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 isEmptyBlock(
::BlockPos const& pos)
const;
575 MCAPI
bool isNearUnloadedChunks(
::ChunkPos const& pos)
const;
577 MCAPI
bool isPositionUnderSnow(
::Vec3 const& p);
579 MCAPI
bool isTouchingMaterial(
::BlockPos const& pos, ::MaterialType type)
const;
581 MCAPI
bool isWithinHeightLimits(
int y)
const;
588 MCAPI ::std::shared_ptr<::BlockActor> removeBlockEntity(
::BlockPos const& blockPos);
594 ::std::shared_ptr<::BlockActor> blockEntity,
599 MCAPI
bool setBlockAndRetainCompatibleBlockActor(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
601 MCAPI
void setBorderBlock(
::BlockPos const& pos,
bool val);
605 MCAPI
bool setLiquidBlock(
::BlockPos const& pos,
::Block const& block,
bool useExtraData,
int updateFlags);
607 MCAPI ::Biome
const* tryGetBiome(
::BlockPos const& pos)
const;
609 MCAPI
void updateConnectionsAt(
::BlockPos const& pos);
611 MCAPI
void updateNeighborsAt(
::BlockPos const& pos);
613 MCAPI
void updateNeighborsAtExceptFromFacing(
::BlockPos const& pos,
int skipFacing);
623 MCFOLD static ::Block
const& getEmptyBlock();
634 bool allowUnpopulatedChunks,
635 bool allowClientTickingChanges
648 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
650 MCFOLD ::Level& $getLevel();
652 MCFOLD ::Dimension& $getDimension()
const;
654 MCFOLD ::Dimension& $getDimension();
656 MCFOLD ::Dimension
const& $getDimensionConst()
const;
658 MCAPI ::DimensionType $getDimensionId()
const;
660 MCAPI
bool $shouldFireEvents(
::LevelChunk const& c)
const;
662 MCAPI
bool $isInstaticking(
::BlockPos const& pos)
const;
668 MCAPI ::LevelChunk* $getChunk(
int x,
int z)
const;
670 MCAPI ::LevelChunk* $getChunk(
::ChunkPos const& pos)
const;
672 MCAPI ::LevelChunk* $getChunkAt(
::BlockPos const& pos)
const;
674 MCAPI
short $getAboveTopSolidBlock(
678 bool iteratePastInitialBlocking
681 MCAPI
short $getAboveTopSolidBlock(
int x,
int z,
bool includeWater,
bool includeLeaves)
const;
683 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
::BlockPos const& pos)
const;
685 MCAPI
short $getHeight(::std::function<
bool(
::Block const&)>
const& type,
int x,
int z)
const;
687 MCAPI ::Material
const& $getMaterial(
::BlockPos const& pos)
const;
689 MCAPI ::Material
const& $getMaterial(
int x,
int y,
int z)
const;
691 MCAPI
short $getMaxHeight()
const;
693 MCAPI
short $getMinHeight()
const;
695 MCAPI
bool $hasBorderBlock(
::BlockPos const pos)
const;
697 MCAPI
float $getBrightness(
::BlockPos const& pos)
const;
699 MCAPI
bool $mayPlace(
708 MCAPI
bool $canDoBlockDrops()
const;
710 MCAPI
bool $canDoContainedItemDrops()
const;
712 MCAPI
bool $hasChunksAt(
::Bounds const& bounds,
bool ignoreClientChunk)
const;
714 MCAPI
bool $hasChunksAt(
::BlockPos const& pos,
int r,
bool ignoreClientChunk)
const;
716 MCAPI
bool $hasChunksAt(
::AABB const& bb,
bool ignoreClientChunk)
const;
718 MCAPI
bool $areChunksFullyLoaded(
::BlockPos const& pos,
int r)
const;
720 MCAPI
bool $containsAnyLiquid(
::AABB const& box)
const;
722 MCAPI
bool $containsMaterial(
::AABB const& box, ::MaterialType material)
const;
724 MCAPI
void $blockEvent(
::BlockPos const& pos,
int b0,
int b1);
726 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
727 $fetchEntities(
::Actor const* except,
::AABB const& bb,
bool useHitbox,
bool getDisplayEntities);
729 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> $fetchEntities(
730 ::ActorType entityTypeId,
733 ::std::function<
bool(
::Actor*)> selector
737 $fetchAABBs(::std::vector<::AABB>& shapes,
::AABB const& intersectTestBox,
bool withUnloadedChunks)
const;
739 MCAPI ::std::vector<::AABB>& $fetchAABBs(
::AABB const& intersectTestBox,
bool withUnloadedChunks);
741 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
742 ::AABB const& intersectTestBox,
743 bool withUnloadedChunks,
744 ::std::optional<::EntityContext const> entity,
745 ::std::vector<::AABB>* tempShapes
748 MCAPI
void $fetchCollisionShapes(
749 ::std::vector<::AABB>& shapes,
750 ::AABB const& intersectTestBox,
751 bool withUnloadedChunks,
753 ::std::vector<::AABB>* tempShapes
756 MCAPI
void $fetchCollisionShapesAndBlocks(
757 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
758 ::AABB const& intersectTestBox,
759 bool withUnloadedChunks,
761 ::std::vector<::AABB>* tempShapes
764 MCAPI ::AABB $getTallestCollisionShape(
765 ::AABB const& intersectTestBox,
766 float* actualSurfaceOffset,
767 bool withUnloadedChunks,
771 MCAPI ::HitResult $clip(
774 bool checkAgainstLiquid,
775 ::ShapeType shapeType,
777 bool ignoreBorderBlocks,
781 bool stopOnFirstLiquidHit
786 MCAPI
bool $isInWall(
::Vec3 const& pos)
const;
790 MCAPI
void $fireBlockChanged(
796 ::BlockChangedEventTarget eventTarget,
801 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos)
const;
803 MCAPI ::Block
const& $getBlock(
::BlockPos const& pos, uint layer)
const;
805 MCFOLD ::BlockActor
const* $getBlockEntity(
::BlockPos const& pos)
const;
807 MCAPI ::Block
const& $getExtraBlock(
::BlockPos const& pos)
const;
809 MCAPI ::Block
const& $getLiquidBlock(
::BlockPos const& pos)
const;
811 MCAPI
bool $hasBlock(
::BlockPos const& pos)
const;
813 MCAPI
bool $setBlock(
821 MCAPI
bool $setExtraBlock(
::BlockPos const& pos,
::Block const& block,
int updateFlags);
825 MCAPI
bool $isSolidBlockingBlock(
int x,
int y,
int z)
const;
827 MCAPI
bool $isSolidBlockingBlock(
::BlockPos const& p)
const;
829 MCFOLD ::ILevel& $getILevel()
const;
831 MCAPI ::LevelSeed64 $getLevelSeed64()
const;
833 MCFOLD ::ChunkSource& $getChunkSource();
835 MCAPI
bool $checkBlockPermissions(
840 bool generateParticle
843 MCAPI
float $getVisualLiquidHeight(
::Vec3 const& pos)
const;
845 MCAPI
void $postGameEvent(
856 MCAPI
static void** $vftable();